Restic writes to many storage targets through a single abstract backend layer. This episode compares the local, SFTP, S3-compatible (MinIO/AWS/GCS/Azure/B2), and REST server backends — complete with repository URLs, credential configuration, and upload/download limits for controlled bandwidth.

So far your repository lives in a local directory. This episode widens the options: where your data lives determines reliability, cost, and backup speed. Restic uses one abstract backend layer — the commands stay the same, only the repository URL changes.
Choose a backend by weighing three things: where the data must be safe (off-site?), how much it costs, and how much bandwidth is available.
The simplest, suited for laptops, mounted NAS, or external disks:
restic -r /backup/restic backup /dataPros: no network, no credentials, zero latency. Cons: not off-site — if one disk fails, the backup is gone too. It should only be the first layer of a 3-2-1 strategy (three copies, two media, one off-site).
Back up to another server over SSH without installing anything on the server side — a shell account is enough:
restic -r sftp:user@backup.example.com:/backup/restic backup /dataSSH keys and agent are used automatically by restic. Pros: off-site without extra software. Cons: performance limited to one SSH connection, and the SSH user needs write access to that directory.
Note
SFTP requires a shell user on the target server. If you don't want to grant shell access, use rest-server (covered below), which runs as a dedicated HTTP daemon.
The most popular type for the cloud: AWS S3, MinIO (self-hosted), GCS, Azure Blob, and Backblaze B2. They all speak the S3 protocol.
export AWS_ACCESS_KEY_ID=minioadmin
export AWS_SECRET_ACCESS_KEY=minioadmin
restic -r s3:https://minio.example.com/backup-bucket backup /dataexport AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=...
restic -r s3:s3.ap-southeast-1.amazonaws.com/backup-bucket backup /datas3:s3.ap-southeast-1.amazonaws.com/bucket — path style, region in the subdomain.s3:https://bucket.s3.amazonaws.com/ — virtual host style for global buckets.s3:s3.amazonaws.com/bucket — default region us-east-1.Other backends use different prefixes — b2:, azure:, gs:. The details are in the official docs; the configuration principle is identical: URL + credentials via env.
rest-server is a dedicated daemon that speaks restic's HTTP(S) protocol. It is the answer for multi-host backups with authentication and access control — we build it out fully in episode 12. Its URL:
restic -r rest:https://backup.example.com/restic-repo backup /dataThe key difference from SFTP: rest-server cannot read the data contents (it only moves encrypted blobs), and each client can be restricted with --append-only for ransomware protection (episode 14).
All backend credentials are read from the environment — never put them on the command line (visible in ps and history):
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_DEFAULT_REGION=ap-southeast-1To avoid saturating an office or home connection:
restic -r s3:... backup /data --limit-upload 4096
restic -r s3:... restore latest --target /tmp/r --limit-download 8192--limit-upload 4096 limits to ~4 MiB/s; --limit-download applies during restore. Add both to your automation scripts (episode 9) so backups don't "swallow" working-hours bandwidth.
| Backend | Off-site? | Cost | Performance | Use Case |
|---|---|---|---|---|
| Local | no | free | best | first layer, laptops |
| SFTP | yes | VPS rental | moderate | private server without extra apps |
| S3-compatible | yes | per-GiB | high | cloud production, self-hosted MinIO |
| rest-server | yes | VPS rental | moderate | multi-host with authentication |
The principle: local for speed, cloud for durability. The best strategy combines both — a local backup every hour, then an encrypted copy to S3 every night.
-r URL changes.--limit-upload/--limit-download for bandwidth.In the next episode, episode 8, we manage history: forget & prune (retention policy) — composing restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6, setting policy based on RPO/RTO, using --keep-tag/--keep-within, and cleaning up unused blobs with --prune.