A budget VPS usually ships with a small disk, and that small disk is exactly why backups get skipped. A full copy of the server every night eats the disk in a week, so people back up nothing and hope for the best. This borgbackup setup guide takes a different route. Deduplication means BorgBackup stores each unique chunk of data once, so ten daily backups of a mostly unchanged server cost little more than one full copy. On a small VPS, that difference decides whether backups happen at all.
BorgBackup is a command-line backup tool for Linux that deduplicates, compresses, and encrypts your data. It was built for exactly this situation: a small server, a tight disk, and an owner who wants restores to work when something breaks. There is no web panel to maintain and no agent phoning home. You install it, point it at a repository, and schedule it with cron. If you already follow the 3-2-1 backup rule for servers, BorgBackup slots in as the tool that creates the local and offsite copies.
BorgBackup Setup Guide: What You Need Before You Start
Before you install anything, decide where the repository will live. BorgBackup writes to a repository, which is a folder that holds every backup archive plus an index. On a budget VPS you have two sensible choices: a second disk or volume attached to the same VPS, or a second cheap VPS or storage box reached over SSH. A repository on the same disk as the data it backs up protects you against accidental deletion and bad updates, but it does nothing if the disk itself dies. That is why the offsite option matters, even when the offsite box is the cheapest VPS you can find.
You also need to pick an encryption mode. BorgBackup offers repokey mode, which stores the key inside the repository and protects it with a passphrase, and keyfile mode, which keeps the key in a local file. For a single VPS, repokey is the practical choice: the key travels with the repository, so a restore on a fresh server only needs the passphrase. Write that passphrase down somewhere outside the VPS. A backup you cannot decrypt is the same as no backup.
Installing BorgBackup on Ubuntu and Debian
On Ubuntu 24.04 and Debian 12, BorgBackup is in the standard repositories, so installation is one command: apt install borgbackup. The packaged version is stable and well tested, and it is the version most small-server guides assume. If you need a newer release, the project ships a standalone binary, but for a budget VPS the repository package is enough and it updates with the rest of the system.
BorgBackup Repository Setup on a Small Disk
A careful borgbackup repository setup avoids the most common beginner mistake, which is creating the repository inside the folder being backed up. That loop fills the disk fast. Keep the repository outside the backup source, for example at /var/backups/borg for a local repository, or on the remote box at a path like /srv/borg-repo.
To create a local repository, run borg init –encryption=repokey /var/backups/borg. BorgBackup asks for a passphrase twice and then creates the repository. The command also accepts a –compression option, and zstd is a good default for a small VPS because it compresses well without burning much CPU. For a remote repository over SSH, the same command works with a location like user@backup-server:/srv/borg-repo, as long as BorgBackup is installed on the remote side too and key-based SSH login works. If you have not set that up yet, read our guide on setting up SSH keys on a new VPS first, because password prompts break automated backups.
Your First Deduplicated Backup
With the repository ready, create your first archive with a command like borg create /var/backups/borg::first-backup /etc /var/www /home. The part after the double colon is the archive name; use a date-based name such as backup-2026-11-11 in real use so you can tell archives apart later. The paths at the end are what gets backed up. Exclude cache and log directories that change constantly and add nothing to a restore, for example with –exclude /var/www/*/cache. Those exclusions keep deduplicated backups vps owners run from ballooning for no reason.
The first backup takes the longest because every chunk is new. Watch the output and note how long it takes and how much space the repository uses afterwards, which borg info reports. The second backup is where deduplication shows its value: run the same command the next day and it finishes much faster, because only changed chunks are stored. On a typical small VPS running a website and a database, daily changes are a small fraction of the total data, so ten daily archives often use little more than twice the space of one.
Automating BorgBackup with Cron
A backup you run by hand is a backup you will forget. Put the backup command in a small shell script and schedule it with cron. The script should set the BORG_PASSPHRASE environment variable from a file only root can read, run borg create with a dated archive name, then run borg prune to drop old archives. Keep the passphrase out of the crontab itself and out of any file that gets backed up in plain text.
A simple nightly schedule works for most small servers: one archive a day, kept for seven days, plus one archive a week kept for four weeks. That retention policy is what borg prune enforces with flags like –keep-daily=7 –keep-weekly=4. After pruning, run borg compact to reclaim the space freed by deleted archives. On a budget VPS, compact matters, because without it the repository keeps growing even though old archives are gone. A borg backup budget vps setup lives or dies on this step: prune without compact is how small disks fill up silently.
Pruning Old Backups So a Small Disk Lasts
Retention is a trade-off between how far back you can restore and how much disk you burn. Seven daily archives plus four weekly ones is a reasonable default for a small VPS, and it keeps roughly a month of history. If your data changes fast or your disk is tight, drop to three daily archives and keep one monthly archive for the longer view. The right answer depends on what you would actually need to restore: a deleted file from yesterday, or a database from three weeks ago.
Restoring a File from a BorgBackup Archive
Restores are the whole point, so practise one before you need it. To list what an archive holds, run borg list followed by the archive name. To pull a single file out, run borg extract with the archive name and the file path, for example borg extract /var/backups/borg::backup-2026-11-11 etc/nginx/nginx.conf. BorgBackup extracts relative to your current directory, so run it from a scratch folder to avoid overwriting live files by accident.
For a full restore, extract the whole archive into an empty directory and copy back only what you need. That is slower than restoring in place, but it is safer, because you can compare the restored files with the live ones before you replace anything. If the repository lives on a remote box, you can also mount it with borg mount and browse it like a normal folder, which makes picking out one file quick and low-risk. Test a restore at least once a month. The confidence it gives you is worth more than the ten minutes it costs.
Common Mistakes on a Budget VPS
The most common mistake is backing up the repository itself, which doubles the size of every archive. Exclude the repository path explicitly if it sits under a backed-up directory. The second mistake is storing the only copy of the passphrase on the same VPS, which makes it useless exactly when the VPS is gone. Keep it in a password manager or on paper somewhere safe. The third is never testing a restore, which we covered above. The fourth is skipping the offsite copy entirely. A local repository protects you against your own mistakes, but a dead disk or a suspended provider needs a copy somewhere else. Even a cheap second VPS holding only the BorgBackup repository is enough, and it pairs well with the rsync backup tutorial for incremental server backups to a second VPS if you want a second copy method alongside BorgBackup.
Start small, verify every step, and let the schedule run. A borgbackup setup guide is only useful if the backups it produces actually restore, and the only way to know that is to test them. Set up the repository today, schedule the nightly job tonight, and do your first test restore this week. That is the whole job, and a budget VPS is more than enough hardware for it.