Log inSign up

Push server data to your own storage with rclone

Install rclone, define a remote with rclone config (an S3-compatible bucket, an SFTP host or a WebDAV share you already use), then copy with rclone copy /srv/backups store:server-backups. Use rclone sync --dry-run before any real sync, wrap sensitive data in a crypt remote, and schedule the command with a systemd timer.

Topic: File transfer and archives · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13, Rocky Linux 9, AlmaLinux 9 · Updated 2026-12-03

What does rclone do on a server?

rclone is a command line tool that talks to dozens of storage back ends with one set of commands: ls, copy, sync, check, mount. On a VPS it is typically used to ship backup archives, database dumps or upload folders off the machine to storage you already rent or run yourself, such as an S3-compatible bucket, a WebDAV share on a Nextcloud instance, or a second server reached over SFTP.

BitcoinVPS does not sell object or block storage, so the destination is whatever you already have. Pair rclone with an archiving step (Borg, restic as in the daily backups tutorial, or plain tar) to get versioned off-site copies.

How do I install rclone?

Distribution packages exist but often lag behind; the project install script fetches the current release and verifies it.

# Ubuntu, Debian
sudo apt update
sudo apt install curl unzip

# Rocky Linux 9, AlmaLinux 9
sudo dnf install curl unzip

curl -fsSL https://rclone.org/install.sh -o rclone-install.sh
less rclone-install.sh          # read it before running
sudo bash rclone-install.sh

rclone version

The binary lands in /usr/bin/rclone. Re-running the script later upgrades it, or use sudo rclone selfupdate. If you prefer distribution packages, sudo apt install rclone works on Ubuntu and Debian, and Rocky or AlmaLinux provide it through EPEL; check the version, since some back end options only exist in newer releases.

How do I add an S3-compatible bucket as a remote?

Run rclone config for an interactive walk-through, or create the remote in one line when you already know the details.

rclone config create store s3 \
  provider=Other \
  endpoint=https://s3.example.net \
  access_key_id=YOUR_KEY_ID \
  secret_access_key=YOUR_SECRET \
  region=auto

rclone lsd store:
rclone mkdir store:server-backups

The configuration is saved in ~/.config/rclone/rclone.conf for the current user (for root, under /root). It contains your secret in plain form, so keep it private with chmod 600, or set a configuration password through rclone config, then supply it to scheduled jobs with RCLONE_CONFIG_PASS or --password-command. Ask your storage provider for a key restricted to a single bucket.

Can I use an SFTP or WebDAV destination instead?

Yes, both are built in. An SFTP remote reuses SSH keys, which suits a second server or a home NAS:

rclone config create nas sftp \
  host=198.51.100.24 user=deploy port=22 \
  key_file=/home/deploy/.ssh/backup_ed25519

rclone config create cloud webdav \
  url=https://cloud.example.net/remote.php/dav/files/deploy/ \
  vendor=nextcloud user=deploy pass=$(rclone obscure 'APP-PASSWORD')

WebDAV passwords must be stored obscured, which is what rclone obscure does (it hides, it does not encrypt). For storage services that sign in through a browser, run rclone authorize on your desktop and paste the resulting token into the server prompt, since the VPS has no browser.

What is the difference between copy, sync and move?

copy adds and updates files on the destination but never deletes; sync makes the destination identical, deleting extras; move copies and then removes the source files. For backups, copy is the forgiving default.

rclone copy /srv/backups store:server-backups -P
rclone sync /var/www/uploads store:uploads-mirror --dry-run
rclone sync /var/www/uploads store:uploads-mirror \
  --backup-dir store:uploads-old/$(date +%F)
rclone move /var/log/archive store:old-logs --min-age 30d

The --backup-dir option turns a risky sync into a safe one: anything that would be deleted or overwritten is moved to a dated folder instead. Always read a --dry-run before the first real sync.

How do I encrypt files before they leave the server?

Layer a crypt remote over the storage remote. File contents and names are encrypted locally with keys only you hold.

rclone config create secure crypt \
  remote=store:server-backups-enc \
  password=$(rclone obscure 'LONG-PASSPHRASE') \
  password2=$(rclone obscure 'SECOND-SALT')

rclone copy /srv/dumps secure: -P
rclone ls secure:
rclone ls store:server-backups-enc

The last two listings show readable names through secure: and scrambled names on the raw bucket. Keep a copy of both passphrases somewhere off the server; without them the data cannot be recovered. Prefer typing the secrets into the interactive rclone config prompt so they never sit in shell history.

How do I filter files and control bandwidth?

Filters keep junk out, and a few flags keep rclone from crowding the server.

rclone copy /srv/app store:app-copy \
  --exclude "node_modules/**" --exclude "*.tmp" \
  --bwlimit "08:00,10M 23:00,off" \
  --transfers 4 --checkers 8 -P

The --bwlimit timetable caps speed to 10 MB per second during the day and lifts it at night. Uploads count as outgoing transfer on your plan, so large first runs are worth planning; the usage tutorial shows how to keep an eye on totals.

How do I schedule and verify rclone runs?

Create a oneshot service and a timer, then confirm the result with rclone check.

sudo tee /etc/systemd/system/rclone-push.service >/dev/null <<EOF
[Unit]
Description=Copy backups to remote storage
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
User=deploy
ExecStart=/usr/bin/rclone copy /srv/backups store:server-backups --log-file /home/deploy/rclone.log --log-level INFO
EOF

sudo tee /etc/systemd/system/rclone-push.timer >/dev/null <<EOF
[Timer]
OnCalendar=*-*-* 04:30
Persistent=true

[Install]
WantedBy=timers.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now rclone-push.timer
rclone check /srv/backups store:server-backups --one-way

check --one-way confirms every local file exists on the remote with the same size and hash. More timer options are in cron jobs and systemd timers.

What should I do when rclone fails?

  • AccessDenied or 403: the key lacks permission for that bucket or the endpoint or region is wrong. Test with rclone lsd store: -vv.
  • directory not found: create the bucket or folder first with rclone mkdir.
  • Time skew errors on S3-compatible storage: the server clock is off; enable time sync as shown in time sync.
  • Too many open files during large runs: lower --transfers and --checkers.

Questions about Sync to remote storage with rclone

Does BitcoinVPS provide a bucket I can sync to?

No. We do not offer object or block storage, so rclone points at storage you already use or another server you run. The optional daily backup add-on is a separate, whole-server service restored through a support ticket.

Can rclone mount a remote like a disk?

Yes: install fuse3 and run rclone mount store:bucket /mnt/store --vfs-cache-mode writes. It is convenient for browsing but slower than copy for bulk work.

Is rclone sync safe for backups?

Only with care. A deleted local file is deleted remotely on the next run. Use copy, or sync with --backup-dir, and keep a versioned tool such as Borg or restic for real history.

How do I move the configuration to another server?

Copy rclone.conf over SSH and set mode 600. Run rclone config file to see where it lives on each machine.

Can rclone copy directly between two remotes?

Yes, for example rclone copy store:a nas:/srv/a. Data streams through the server running rclone unless both remotes support server-side copy.