# Back up Linux to UK S3 with rclone and restic

> Back up a Linux server to S3-compatible storage in the UK: rclone for plain copies, restic for encrypted, versioned backups, with schedules and a test restore.

Source: https://wharfcloud.co.uk/guides/rclone-restic-s3-backup-uk · Last updated 3 December 2026 · WharfCloud

Published 3 December 2026. Reading time about 8 minutes.

## Short answer

Use rclone when you want a plain copy of files in a bucket, and restic when you want proper backups: encrypted before they leave the server, deduplicated, with many restore points and a retention policy. Both work with any S3-compatible service once you give them the endpoint, region, bucket and an access key. For restic, set the repository to `s3:` followed by the endpoint address and bucket, keep the repository password somewhere outside the server, run `restic forget --prune` on a schedule and test a restore.

## rclone or restic?

Table: rclone and restic compared for server backups

|  | rclone | restic |
| --- | --- | --- |
| What lands in the bucket | Your files as they are, readable with any S3 tool | An encrypted repository that only restic can read |
| Encryption | Optional, with a separate crypt remote | Always on, with your repository password |
| Restore points | One copy (the latest), unless you arrange more | Many snapshots, kept by your retention rules |
| Best for | Mirroring a folder, moving data, sharing exports with your own apps | Backups you may need to roll back to a date |

Many people use both: restic for the server's backups, rclone for one-off copies and migrations.

## What you need from your storage

- The **endpoint** address and the **region** name to use. In the commands below they are `YOUR_ENDPOINT` and `YOUR_REGION`.
- A **bucket**, created in your storage panel. Below it is `YOUR_BUCKET`.
- An **access key** and **secret key**. Below they are `YOUR_ACCESS_KEY` and `YOUR_SECRET_KEY`.

With WharfCloud UK Object Storage all four are shown in your panel. Keep the secret key out of shell history and out of Git: the files below are readable by root only.

## rclone: copy files to a bucket

Install rclone from your distribution (`sudo apt install rclone`) or from rclone.org for a newer version. Then add a remote to `/root/.config/rclone/rclone.conf`. For an S3-compatible service that has no preset in rclone, the provider is `Other`:

```ini
[ukstore]
type = s3
provider = Other
access_key_id = YOUR_ACCESS_KEY
secret_access_key = YOUR_SECRET_KEY
endpoint = https://YOUR_ENDPOINT
region = YOUR_REGION
no_check_bucket = true
```

`no_check_bucket = true` stops rclone trying to create the bucket, which you have already made in the panel. Always name the bucket: listing every bucket on the account is not available, so `rclone lsd ukstore:` on its own shows nothing. Then copy and check:

```bash
rclone lsd ukstore:YOUR_BUCKET
rclone copy /srv/exports ukstore:YOUR_BUCKET/exports --progress
rclone check /srv/exports ukstore:YOUR_BUCKET/exports
```

> **No ACL header** Uploads that carry an ACL header are refused, even `private`. Objects are always private, so there is nothing to set: leave `acl` out of the remote (no `acl` line), or pass `--s3-acl ""` on the command line. If `rclone config` asks for a canned ACL, leave it empty.

> **copy or sync** `rclone copy` only adds and updates files. `rclone sync` also deletes files in the bucket that are gone from the source, so a mistake on the server is copied to the bucket too. Use `sync` with `--dry-run` first, and do not treat a synced mirror as a backup.

## restic: encrypted backups with restore points

Install restic (`sudo apt install restic`, then `sudo restic self-update` for the latest release). Put the settings in a file only root can read, for example `/root/restic.env`:

```bash
export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
export AWS_DEFAULT_REGION=YOUR_REGION
export RESTIC_REPOSITORY=s3:https://YOUR_ENDPOINT/YOUR_BUCKET/server1
export RESTIC_PASSWORD_FILE=/root/.restic-password
```

Create a long random password in `/root/.restic-password`, then create the repository and take a first backup:

```bash
chmod 600 /root/restic.env
openssl rand -base64 32 > /root/.restic-password && chmod 600 /root/.restic-password
. /root/restic.env
restic init
restic backup /etc /srv /home --exclude-caches
restic snapshots
```

> **Store the password somewhere else** Without the repository password, the backup cannot be read by anyone, including you. Keep a copy in your password manager, not only on the server you are backing up.

Databases should be dumped to a file first (for example with `pg_dump` or `mysqldump`) and that file backed up, rather than copying live database files.

## Schedule it and keep storage in check

A nightly job that backs up, applies your retention rules and checks the repository is enough for most servers. As root, `crontab -e`:

```bash
15 2 * * * . /root/restic.env && restic backup /etc /srv /home --exclude-caches --quiet && restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune --quiet
30 4 * * 0 . /root/restic.env && restic check --quiet
```

`forget` removes snapshots outside the rules and `--prune` frees the space they used. Without pruning, the repository only grows. Make sure a failed run reaches a person: send cron's output to an address someone reads, or ping a heartbeat monitor at the end of the job.

Size your storage for the retention you keep, not just one copy. On WharfCloud UK Object Storage you get an email at 80% of your package and again when it is full, and uploads stop if you stay above 110% for 7 days.

## Test a restore

A backup you have never restored is a hope, not a plan. Restore to a scratch folder and compare:

```bash
. /root/restic.env
restic restore latest --target /tmp/restore-test --include /etc/hostname
restic mount /mnt/restic
```

`restic mount` (with FUSE installed) shows every snapshot as a folder, which makes it easy to pick out a single file. Try a full restore onto a spare server once a year and time it.

## Next step: Off-site storage in London for these backups

UK Object Storage is S3-compatible, kept in London, with no egress or request fees, so restores and `restic check` runs cost nothing extra.

- **UK Object Storage:** [See UK Object Storage](https://wharfcloud.co.uk/object-storage), UK Object Storage, from £3/month.

Not sure which fits? [Ask an engineer](https://wharfcloud.co.uk/contact?topic=object-storage); we reply in UK business hours.

## Frequently asked questions

### Does restic work with any S3-compatible storage?

Yes. Give restic a repository address made of s3: and the endpoint address, followed by the bucket name, set the access key and secret key in the usual AWS environment variables, and set the region in AWS_DEFAULT_REGION. For services other than Amazon it uses path-style bucket addresses by default.

### Is rclone a backup tool?

It is a copy and sync tool. It can be part of a backup if you copy to dated folders or keep versions another way, but on its own a synced mirror also mirrors deletions and ransomware damage.

### Is the data encrypted?

restic encrypts everything on the server before it is sent, with your repository password. rclone sends files as they are over HTTPS, unless you add an rclone crypt remote.

## Sources

- [rclone documentation: Amazon S3 and S3-compatible storage](https://rclone.org/s3/)
- [restic documentation: Preparing a new repository (S3-compatible storage)](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html)
- [restic documentation: Removing backup snapshots](https://restic.readthedocs.io/en/stable/060_forget.html)

---

WharfCloud is a trading name of Sunucu Internet Services Consultancy Ltd, registered in England and Wales, company number 12963678.
Support: engineers Monday to Friday, 08:00 to 18:00 UK time. Critical incidents: A person responds to critical incidents within 1 hour (Every day, 07:00 to 23:00 UK time). Automated monitoring and automated recovery overnight and at weekends.
Contact: hello@wharfcloud.co.uk · https://wharfcloud.co.uk/contact