This guide will show you how to install Docmost on your machine, using Docker. Additionally, you can use Rclone and crontab to setup weekly backups for your instance in Proton drive.
Before installing Docmost, create a .env file from the .env.template file and fill it. All the purposes of the variables are defined inside the template file.
Additionally, make sure the following tools are installed on your machine:
zipunzipdockerrclone(optional)crontab(optional)
APP_URL: The base URL of your Docmost instance.APP_SECRET: The secret of docmost, you can generate one usingopenssl rand -hex 32.PG_PASSWORD: The PostgreSQL password.
Docmost requires Docker to function properly. Follow the official instructions to install Docker based on your operating system:
Rclone is a tool for syncing and managing files in cloud storage. It will allow you to store your backups on your Proton Drive account.
Installation:
sudo -v ; curl https://rclone.org/install.sh | sudo bash -s betaOnce the environment variables are set, execute the following command:
docker compose up -dThis will initialize Docmost and PostgreSQL using Docker.
After installing Rclone, follow these steps to configure it for Proton Drive:
- Run the configuration command:
rclone config
- Enter n to create a new remote.
- Give a name to the remote: use the same name as specified in the
.envfile forRCLONE_REMOTE_NAME. - Then, a list of configurations should appear, you need to enter Proton Drive id (which is as of today 43 or protondrive)
- Enter your username and password, leaving the rest of the settings as default.
To verify that Rclone is correctly set up, run:
rclone ls $RCLONE_REMOTE_NAME:A list of the files stored in your Proton Drive account should appear.
Once these prerequisites are installed and configured, you can proceed with installing Docmost.
To automatically back up your Docmost database every Monday at 8 PM (as described in the below example), you need to create a cron job that runs save_backup.sh.
-
Open the cron job editor:
crontab -e
-
Add the following line at the end of the file:
0 20 * * 1 cd /home/ubuntu/doc/backup && ./save_backup.sh >> backups.log 2>&1
0 20 * * 1means the script will run at 20:00 (8 PM) every Monday.cd /home/ubuntu/doc/backup &&is mandatory to find .env>> backups.logappend logs to backups.log2>&1redirects stderr to stdout
TODO : voir pour avoir un fichier de log pour chaque backup
-
Save and exit the editor.
To check if the cron job is set up correctly, run:
crontab -lThis should display the newly added cron job.
Now, your database backups will automatically run every Monday at 8 PM.
To restore a specific database backup using restore_backup.sh, follow these steps:
Execute the following command, replacing <backup-file.tar.gz> with the actual backup file you want to restore:
./restore_backup.sh /path/to/<backup-file.tar.gz>- Ensure that the backup file exists and is accessible before running the script.
- The restore process will replace the current database with the backup version.
Now, you can use restore_backup.sh to revert to a specific backup whenever necessary.
- Error processing file upload. (error 400 in console)
docker exec -u 0 -it docmost_instance sh chown -R 1000:1000 /app/data/storage
This repo is used for our personnal use, you can see the public part of our documentation here