No ID at signup · Storage VPS from 500 GB to 8 TB · Pay in BTC, USDT, USDC, ETH, SOL, LTC
Language: English
Get storage

restic · rest-server against SFTP

Restic: REST server or SFTP for backups to a storage VPS?

Both backends store the same encrypted repository in the same folder layout. The difference is who may delete what, how many people share the server, and how much the protocol costs on the wire.

Last updated: · 7 min read

Quick answer

Restic: REST server or SFTP for backups to a VPS?

For restic backups to a VPS, use rest-server when clients must not delete snapshots: its --append-only mode refuses deletions and --private-repos keeps each user in their own folder. Use SFTP when one trusted machine backs up and you want nothing but SSH. On a Coffervale storage VPS, 1 TB costs $1.66 a month on 12 months (2 November 2026).

What is the difference between restic's REST server and SFTP backends?

FeatureSFTPrest-server
Software on the VPSOpenSSH, already installedrest-server (Debian 13 package restic-rest-server, or the restic/rest-server Docker image)
TransportSSHHTTP or HTTPS, port 8000 by default
LoginSSH keys per Unix accountHTTP user and password from an htpasswd file (bcrypt or SHA)
Client can delete old snapshotsYesNo, with --append-only
Users kept apartUnix accounts and folder permissions--private-repos: each user only under /<user>/
Repository layout on diskSame as a local repositorySame as a local repository
Repository encryptionrestic, always onrestic, always on

Is rest-server faster than SFTP?

The rest-server project says yes: compared with SFTP, the REST backend performs better and scales further. Its README gives the reason: SFTP moves data in chunks of at most 32 KiB and the server acknowledges every packet, while REST sends whole files over HTTP. Plain HTTP removes the TLS overhead too, since restic already encrypts everything it sends; the README adds that HTTPS then mostly serves to protect the login. That is the project's own claim, not a benchmark we ran. On a storage VPS with hard disks, the disks and your uplink often set the pace before the protocol does.

On the client side, SFTP has one known annoyance: restic's documentation notes that SFTP servers close connections when they receive nothing for a while, which long scans of unchanged files can trigger.

When is plain SFTP the better choice?

When one machine you trust backs up to its own account and you want no extra service, no extra port and nothing new to patch. restic needs only restic -r sftp:user@host:/path init and an SSH key without a passphrase prompt, since an automatic backup cannot stop to ask for one. The weakness is the one that matters most against ransomware: whoever controls the client can also run restic forget --prune and delete every snapshot, because SFTP has no append-only mode.

To keep each SFTP account from browsing the rest of the server, OpenSSH can lock it into its own folder with no shell:

/etc/ssh/sshd_config.d/restic-sftp.conf, then sshd -t && systemctl reload ssh
Match User restic-laptop
    ForceCommand internal-sftp
    ChrootDirectory /srv/restic-sftp/%u
    AllowTcpForwarding no
    X11Forwarding no
Account, chroot and repository, as root on the VPS; the client then uses sftp:[email protected]:/repo
useradd --no-create-home --home-dir /srv/restic-sftp/restic-laptop --shell /usr/sbin/nologin restic-laptop
install -d -m 755 -o root -g root /srv/restic-sftp/restic-laptop
install -d -m 700 -o restic-laptop -g restic-laptop /srv/restic-sftp/restic-laptop/repo
install -d -m 700 -o restic-laptop -g restic-laptop /srv/restic-sftp/restic-laptop/.ssh
echo 'ssh-ed25519 AAAA...client-key... laptop' > /srv/restic-sftp/restic-laptop/.ssh/authorized_keys
chown restic-laptop:restic-laptop /srv/restic-sftp/restic-laptop/.ssh/authorized_keys
chmod 600 /srv/restic-sftp/restic-laptop/.ssh/authorized_keys

How do I run rest-server with append-only and private repositories?

On Debian 13, install restic-rest-server, point it at a data folder outside /home, and pass --append-only --private-repos plus TLS in its defaults file. The packaged service runs as the restic-rest-server user, reads BACKUP_DIR, LISTEN and ARGS from /etc/default/restic-rest-server, refuses to start until BACKUP_DIR is set, and hides /home from the daemon. With --private-repos, the user laptop may only open repositories under /laptop/, so several people can share one storage VPS without seeing each other's snapshots. A self-signed certificate is enough, because the client pins it with --cacert.

On the storage VPS, as root (Debian 13)
apt install restic-rest-server apache2-utils openssl
install -d -m 750 -o restic-rest-server -g restic-rest-server /srv/restic

openssl req -x509 -newkey rsa:3072 -nodes -days 3650 \
    -keyout /etc/restic-rest-server/key.pem -out /etc/restic-rest-server/cert.pem \
    -subj '/CN=coffer-backup' -addext 'subjectAltName=IP:203.0.113.10'
chown root:restic-rest-server /etc/restic-rest-server/key.pem
chmod 640 /etc/restic-rest-server/key.pem

cat > /etc/default/restic-rest-server <<'EOF'
BACKUP_DIR=/srv/restic
LISTEN=:8000
ARGS="--htpasswd-file /etc/restic-rest-server/users.htpasswd --append-only --private-repos --tls --tls-cert /etc/restic-rest-server/cert.pem --tls-key /etc/restic-rest-server/key.pem"
EOF

htpasswd -B /etc/restic-rest-server/users.htpasswd laptop
chown root:restic-rest-server /etc/restic-rest-server/users.htpasswd
chmod 640 /etc/restic-rest-server/users.htpasswd
systemctl enable restic-rest-server
systemctl restart restic-rest-server
On the client: credentials in a private file, not in the URL
mkdir -p ~/.config/restic
scp [email protected]:/etc/restic-rest-server/cert.pem ~/.config/restic/coffer.pem

cat > ~/.config/restic/coffer.env <<'EOF'
RESTIC_REPOSITORY=rest:https://203.0.113.10:8000/laptop/
RESTIC_REST_USERNAME=laptop
RESTIC_REST_PASSWORD=the-htpasswd-password
RESTIC_PASSWORD_FILE=/home/me/.config/restic/repo-password
RESTIC_CACERT=/home/me/.config/restic/coffer.pem
EOF
chmod 600 ~/.config/restic/coffer.env

set -a; . ~/.config/restic/coffer.env; set +a
restic init
restic backup ~/Documents ~/Pictures

How do I prune snapshots when rest-server is append-only?

Run forget --prune from a trusted admin machine over a path that is not append-only, and write the policy with --keep-within. rest-server keeps the repository in the same layout as a local repository, so SFTP as root reaches the very same folder, and the repository password never has to be typed on the VPS.

The --keep-within part matters. restic's documentation describes an attacker who adds empty snapshots to an append-only repository so that a policy such as one snapshot per week drops the real ones; a time-based policy keeps both the junk and the genuine snapshots. It only helps while the system clock is right when forget runs, and it is no reason to skip a look at restic snapshots first.

From the admin machine, never from the client
restic -r sftp:[email protected]:/srv/restic/laptop snapshots
restic -r sftp:[email protected]:/srv/restic/laptop forget --keep-within 90d --prune
restic -r sftp:[email protected]:/srv/restic/laptop check --read-data-subset=5%

Which backend should I pick?

Pick rest-server whenever the machine being backed up faces the internet; pick SFTP for a single, well-kept machine where simplicity wins. An append-only target cannot be emptied by the attacker who encrypts your server, and that one property outweighs the extra daemon.

Your situationBackendWhy
One laptop or desktop, one accountSFTPNothing to install, no new port
Public servers that could be hackedrest-server --append-onlyA stolen client cannot delete history
Several people or machines on one VPSrest-server --private-reposEach login sees its own folder only
Only HTTP or HTTPS allowed out of the networkrest-serverWorks where SSH is blocked
Both: clients append-only, admin prunesrest-server for clients, SFTP as root for the adminSame folder, two levels of access

What does a restic target cost per TB?

According to Coffervale's survey of 2 November 2026, Backblaze B2, an object store restic supports natively, cost $6.95 per TB a month, while storage VPS plans from hosts that take crypto without an ID document had a median of $4.00 per TB. An object store needs no server to maintain but offers neither of the two backends discussed here; a storage VPS runs both. We take no backup of your server and keep no copy of your data anywhere else, so what sits on a Coffervale storage VPS should be one of your copies, never the only one: the VPS is your off-site copy, as How do I use a VPS for off-site backups? explains. If you would rather use Borg, follow How do I set up a Borg backup server on a VPS?; to encrypt the disk underneath, see How do I mount and format the storage disk on a Linux VPS?. Plans and terms are on How much does a storage VPS cost per month?.

Questions about restic on a VPS

Is restic over SFTP encrypted?

Twice. restic encrypts every file it stores with AES-256 and authenticates it with Poly1305-AES before upload, and SSH encrypts the connection. The VPS only ever holds ciphertext.

Does rest-server need HTTPS if restic already encrypts the data?

Yes, for the login. Without TLS, the HTTP user and password cross the network in clear text, and anyone who captures them can write to your repository. Use --tls, or keep rest-server on localhost and reach it through an SSH tunnel.

Can rest-server and SFTP serve the same repository?

Yes. Both use the same folder layout as a local repository, so clients can write through an append-only rest-server while an admin prunes the same folder over SFTP.

Which port does rest-server listen on?

Port 8000 on all addresses by default. Open it in the firewall only to the addresses that back up, or bind it to a private address such as a WireGuard interface.

Which restic version should I run?

The latest release on 2 November 2026 was restic 0.19.1, of 5 July 2026; Debian 13 ships 0.18.0. Repository format version 2, the current default, needs restic 0.14.0 or newer on every machine that opens it.

Sources (10)
  1. Rest Server README: why use it, append-only mode, private repos, htpasswd, TLS — restic project (read 2026-11-02)
  2. restic documentation: Preparing a new repository (SFTP, REST Server, B2) — restic project (read 2026-11-02)
  3. restic documentation: Removing backup snapshots, security considerations in append-only mode — restic project (read 2026-11-02)
  4. restic documentation: Scripting, environment variables — restic project (read 2026-11-02)
  5. restic documentation: References, repository encryption — restic project (read 2026-11-02)
  6. restic releases (0.19.1 of 5 July 2026) — restic project on GitHub (read 2026-11-02)
  7. Debian trixie package restic-rest-server 0.13.0-2: service unit and defaults — Debian (read 2026-11-02)
  8. Debian trixie package search: restic 0.18.0 — Debian (read 2026-11-02)
  9. sshd_config(5): Match, ChrootDirectory, ForceCommand — OpenBSD project (OpenSSH) (read 2026-11-02)
  10. B2 Cloud Storage pricing backblaze.com/cloud-storage/pricing — Backblaze (read 2026-11-02)

From $1.24/month · no KYC

Get storage