Admins and moderators: feel free to move this topic somewhere else or edit it if necessary.
These are extended, step-by-step instructions on how I installed rclone
and set up everything to back up my Discourse to Dropbox. For Google Drive users, I believe most of these steps will also apply.
I followed some of the instructions originally provided by Christoph (@tophee) here:
Since I’m not an expert at all, they seemed very limited and I would eventually fail, so I got help from ChatGPT and everything is working! I documented everything, step by step, for those of you who are probably not advanced users like myself, and need that extra hand along the way.
Install rclone
remotely and prepare for Dropbox
SSH to your server:
ssh root@xxx.xxx.xxx.xxx
When on your server:
root@ServerNameHere:~#
Install rclone
:
sudo curl https://rclone.org/install.sh | sudo bash
If successful, run:
sudo rclone config
When it shows:
2025/08/13 11:29:31 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q>
… type n
. Hit Enter
.
When presented with:
Enter name for new remote.
name>
Give it a name, for example dropbox_backup
. Hit Enter
.
It will show you a list in red and green (it did for me), and one of those options is Dropbox. Each option has a number associated with it. Mine was:
14 / Dropbox
\ (dropbox)
At the bottom, where it says Storage>
, add the number for Dropbox. So, in my case, I ended up with Storage>14
. Hit Enter
.
It will show:
Option client_id.
OAuth Client Id.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_id>
Just hit Enter
to leave it blank. Do the same when it shows:
Option client_secret.
OAuth Client Secret.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_secret>
When it shows:
Edit advanced config?
y) Yes
n) No (default)
y/n>
Type n
and hit Enter
.
When it shows:
Use web browser to automatically authenticate rclone with remote?
* Say Y if the machine running rclone has a web browser you can use
* Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.
y) Yes (default)
n) No
y/n>
Type n
and hit Enter
.
When it shows:
Option config_token.
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
rclone authorize "dropbox"
Then paste the result.
Enter a value.
config_token>
… Stop!
Install rclone
locally and authorize Dropbox
Install rclone
on your computer. In my case, I opened a new Terminal window on my Mac so I could install rclone
without interfering with the previous process, because I need to continue after getting the Dropbox token.
I first checked if I had it installed on my Mac by running:
rclone version
I didn’t, so I had to install it. In my particular case, I’m using MacPorts, because Homebrew doesn’t work well with Catalina; pick your preferred option.
Homebrew command:
brew install rclone
MacPorts command:
sudo port install rclone
Once it’s installed, in that same window, run:
rclone authorize "dropbox"
This dropbox
name is NOT related to the dropbox_backup
name we picked earlier.
Once you run that, the browser will open the authorization window.
If it doesn’t, paste this URL into your browser: http://127.0.0.1:53682/auth
(according to these instructions).
Log into Dropbox. Click the Allow
button. If all goes well, you will get the message:
Success!
All done. Please go back to rclone.
Close that window.
Finish Dropbox set up
Go back to Terminal, and it will show a long token (it will be super long, I just made it shorter here):
{"access_token":"sl.u.AF5VJTs.................ZvNhniOToyQG","token_type":"bearer","refresh_token":"jygyhExsHRgAAAAAAAAAAfeHd8D0l5jzLvuiZ1onH2nXP2YeC2ycrbm5eQ5Y3uc6","expiry":"2025-08-13T16:58:41.072138+01:00","expires_in":14400}
Copy everything from the opening {
to the closing }
, including the braces themselves, and paste it in the other window:
Option config_token.
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
rclone authorize "dropbox"
Then paste the result.
Enter a value.
config_token> PASTE_TOKEN_HERE
Hit Enter
.
If everything is successful, you will see something like:
Configuration complete.
Options:
- type: dropbox
- token: {"access_token":"sl.u.AF5VJTs7..........ToyQG","token_type":"bearer","refresh_token":"jygyhExsHRgAAAAAAAAAAfeHd8D0l5jzLvuiZ1onH2nXP2YeC2ycrbm5eQ5Y3uc6","expiry":"2025-08-13T16:58:41.072138+01:00","expires_in":14400}
Keep this "dropbox_backup" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>
Choose y
to keep it. This will save the remote as dropbox_backup
on your server, and you’ll be able to use it for rclone
commands. Hit Enter
.
It will show:
Current remotes:
Name Type
==== ====
dropbox_backup dropbox
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q>
Type q
to quit the configuration. Your dropbox_backup
remote is now ready to use. Hit Enter
.
While still in root@
, run rclone lsd dropbox_backup:
This will list all top-level directories in your Dropbox to confirm the connection works.
Back ups
Manual
To back up manually, assuming you have a typical setup (not a two-container setup), run:
sudo rclone copy /var/discourse/shared/standalone/backups/default --exclude tmp/ dropbox_backup:backups
/var/discourse/shared/standalone/backups/default
→ source folder on your server (I confirm that this path is accurate on a typical setup–not a two-container setup–at least as of Aug 2025).--exclude tmp/
→ skips temporary files.dropbox_backup:backups
→ remote name (dropbox_backup
) and folder in Dropbox (backups
).
This will upload all backup files (except tmp/
) to your Dropbox, to a folder called backups
, using that name we picked earlier: dropbox_backup
.
If you want a folder with spaces, for example Discourse Backups
, run this instead:
sudo rclone copy /var/discourse/shared/standalone/backups/default --exclude tmp/ "dropbox_backup:Discourse Backups"
If everything goes as planned, you will now see a Discourse Backups
folder (or whatever name you picked) in your Dropbox with all your backup files.
Since you got to this point, go ahead and close the second window in Terminal, the one used to install rclone
on your computer, to avoid any confusion moving forward.
Cron job
Now, let’s create a cron job to automate this process:
crontab -e
You will be presented with:
no crontab for root - using an empty one
Select an editor. To change later, run select-editor again.
1. /bin/nano <---- easiest
2. /usr/bin/vim.basic
3. /usr/bin/vim.tiny
4. /bin/ed
Choose 1-4 [1]:
Choose 1
. Hit Enter
.
You will see something like:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
At the end of all that, add the cron job. To copy the backups every day at 6 pm, add the following:
0 18 * * * rclone copy /var/discourse/shared/standalone/backups/default --exclude tmp/ "dropbox_backup:Discourse Backups"
So your “list” will end with:
(INITIAL TEXT HERE)
# m h dom mon dow command
0 18 * * * rclone copy /var/discourse/shared/standalone/backups/default --exclude tmp/ "dropbox_backup:Discourse Backups"
Press Ctrl+X
. At the bottom of the window, it will ask to save. Press Y
and then Enter
.
You’re done!
You can run the cron job more frequently if you want to, as only new files will be copied over anyway.
Note that the copy
option will add more and more backups to your Dropbox even when the ones on your server get deleted. If you only want to keep the ones that are also kept on your server, use sync
instead of copy
.