Skip to content

AS213941 · Peering-20% on all VPS with code NVH20 · Delivered in 60 seconds

Linux VPSFrom €2.49/monthWindows VPSFrom €3.49/monthFiveM serverFrom €0.99/monthMinecraft serverFrom €1.99/month
VPS & Cloud

Ranges

Linux NVMe VPSRoot access, Debian, Ubuntu, Alma…Windows RDP VPSRemote desktop, licence includedDedicated serversIntel Xeon Gold, exclusive resourcesPterodactyl VPSGame panel preinstalled

Network and hosting

Anti-DDoSWeb hostingColocationIP transitVPN

Professionals

Reseller VPSReseller programme
Solutions

Bots and automation

AI agents VPSA server for your coding assistants and autonomous agentsOllama VPSYour private AI without a GPU, data in FranceTelegram bot VPSPython or Node.js, always reachableDiscord bot VPSMusic, moderation, tickets: no downtimeVinted bot VPSMonitor and Discord alerts 24/7n8n VPSWorkflows with no execution limitVPN VPSAn encrypted tunnel exiting in FranceWeb scraping VPSScheduled data collection, dedicated IP

Trading

Forex VPSYour robots manage positions overnightMetaTrader 4 VPSSeveral MT4 terminals on one machineMetaTrader 5 VPSForex, indices and stocks in MT5NinjaTrader VPSFutures and NinjaScript strategiesProp firm VPSChallenges and funded accounts, terminal always onlineAfrica trading VPSMetaTrader in Paris, from North or West AfricaRDP VPSWindows remote desktop, always onTrading bot VPSOpen-source crypto bots, protected API keys

Broker and prop firm VPS

FTMO VPSDedicated French IP, outside the USFundedNext VPSPrivate VPS for your EAsThe5ers VPSFixed IP, consistent locationIC Markets VPSWithout the 15 lots a month quotaPepperstone VPSMT4, MT5 and cTrader, fixed priceXM VPSNo $5,000 minimum balanceExness VPSSmall accounts welcome, 7 ms to London

Windows desktop

Windows 10 VPSFor software that requires Windows 10Windows 11 VPSA modern Windows desktop, reachable anywhereSEO VPSLarge-site crawls without tying up your PCStreaming VPSAn OBS studio streaming from the data centreWordPress VPSFast websites on NVMe disks
Marketplace

AI

OllamaLocal language models, with no external APIOpen WebUIA chat interface for your Ollama modelsAnythingLLMA private AI assistant for your documentsLangflowVisual editor for agents, RAG flows and AI APIsFlowiseBuild AI agents and chatbots visuallyQdrantVector database for RAG and semantic search

Trading

MetaTrader 5Official MT5 terminal, ready for your EAsMetaTrader 4Official MT4 terminal, ready for your EAsForex VPS pack (MT4 + MT5)MT4 and MT5 together, on a VPS tuned for tradingNinjaTrader 8NinjaTrader 8 with its prerequisitesFreqtradeOpen-source crypto trading bot, in simulation modeInteractive Brokers TWS / IB GatewayTWS or IB Gateway, official stable version

Bots and agents

Claude CodeAnthropic's coding agent, in your terminalCodex CLIOpenAI's command-line coding agentTelegram botYour Telegram bot, with automatic restartDiscord botYour Discord bot, with automatic restartOpenClawOpen-source personal AI assistant, active 24/7Hermes AgentAutonomous open-source AI agent

Deployment and automation

DockerThe container engine and Docker Composen8nYour automations, with no execution limitPortainerManage your Docker containers from your browserCoolifyDeploy your applications from Git, on your own serverUptime KumaMonitor your sites and servers, with alerts

Websites and databases

WordPressThe most widely used CMS, on a fast Nginx stackApache + PHP + MySQLApache, PHP and MariaDB, ready for your sitesMySQL (MariaDB)MySQL-compatible database serverPleskPlesk hosting panel, with your own licenceNextcloudYour own cloud for files, calendar and contacts

Network and security

WireGuardYour encrypted VPN, preinstalled free of chargeVaultwardenA self-hosted password manager

Game servers

FiveMFiveM server with txAdmin and MariaDB, ready to useMinecraftTurnkey Minecraft Java server, plugins and mods includedRustRust server with automatic updates and Oxide or CarbonCounter-Strike 2Dedicated Counter-Strike 2 server, installed for youPalworldDedicated Palworld server, installed for youValheimDedicated Valheim server, installed for you
Gaming

Game servers

FiveM servertxAdmin, ESX, QBCoreMinecraft serverJava, Bedrock, modpacksRust serverOxide, Carbon, wipesNova-Life serverNova-Life: Amboise RP

Protection and tools

FiveM Anti-DDoSFree tools
Resources

Learn

DocumentationBlog

Assistance

ContactSLA commitment
View plans Client area Peering · AS213941

Installation

Backing up a VPS with BorgBackup: encrypted, deduplicated, off-server

By the NVHCloud team · 2026-09-18 · 4 min read

On a VPS, backing up your data is your responsibility: it is the other side of root access. BorgBackup is the reference tool for this on Linux. It encrypts data before it leaves the server, stores identical blocks only once, which makes daily backups very light, and lets you restore a single file in seconds.

1. The golden rule: a backup off the server

A backup stored on the same VPS as the data protects you neither from the server being deleted by mistake, nor from a break-in, nor from ransomware that encrypts the whole disk. Apply the 3-2-1 rule: three copies of the data, on two different media, one of them off site.

In practice, you need storage reachable over SSH somewhere other than the server being backed up: a second storage VPS, a server at home, or a Borg-compatible storage service. In this guide, that machine is called backup.example.com.

2. Install Borg

Borg must be installed on both machines, the VPS and the storage server:

apt update && apt install -y borgbackup

On the VPS, create an SSH key dedicated to backups, without a passphrase since it will be used by an automated task:

ssh-keygen -t ed25519 -f /root/.ssh/borg -N "" -C "borg@$(hostname)"
cat /root/.ssh/borg.pub

On the storage server, create a borg user and add the public key to its ~/.ssh/authorized_keys file, restricting it to Borg commands only:

command="borg serve --restrict-to-path /home/borg/repos",restrict ssh-ed25519 AAAA... borg@myvps

This restriction limits the damage if the VPS were compromised: the key cannot open a shell on the storage server.

3. Create the remote repository

Choose a long passphrase and store it in a file readable by root only:

openssl rand -base64 32 > /root/.borg-pass
chmod 600 /root/.borg-pass
export BORG_RSH="ssh -i /root/.ssh/borg"
export BORG_PASSCOMMAND="cat /root/.borg-pass"
borg init --encryption=repokey-blake2 ssh://[email protected]/home/borg/repos/myvps

Export the repository key immediately and keep it, together with the passphrase, somewhere other than the VPS: in a password manager, for example.

borg key export ssh://[email protected]/home/borg/repos/myvps /root/borg-key.txt
cat /root/borg-key.txt   # copy it somewhere safe, then delete the file
⚠️ Without the key and the passphrase, the backups are unreadable, including to you. If the VPS disappears and these two items were only stored on it, your backups are lost.

4. The backup script

The files of a database in use cannot be copied reliably. So you first export the databases to a file, then Borg backs up that export with everything else. Create /root/backup.sh:

#!/bin/bash
set -euo pipefail
export BORG_REPO="ssh://[email protected]/home/borg/repos/myvps"
export BORG_RSH="ssh -i /root/.ssh/borg"
export BORG_PASSCOMMAND="cat /root/.borg-pass"
# 1. consistent database export
mkdir -p /var/backups/sql
mariadb-dump --all-databases --single-transaction --routines --events \
  | gzip > /var/backups/sql/all-databases.sql.gz
# 2. backup
borg create --stats --compression zstd,3 --exclude-caches \
  --exclude '/var/www/*/wp-content/cache' \
  ::'{hostname}-{now:%Y-%m-%d_%H%M}' \
  /etc /var/www /home /root /var/backups/sql
# 3. retention: 7 daily, 4 weekly, 6 monthly
borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6
borg compact
chmod 700 /root/backup.sh
/root/backup.sh

The first run sends everything; later runs only send changed blocks and usually take from a few seconds to a few minutes. Adapt the list of folders to your use: add, for example, the folder of your game servers or your Docker volumes.

💡 With Docker, do not run mariadb-dump on the host: run the export inside the container with docker exec, then back up the resulting file. See Docker and Docker Compose.

5. Automate

One line in /etc/cron.d/ runs the backup every night at 3:30 and keeps a record in a log:

echo '30 3 * * * root /root/backup.sh >> /var/log/borg.log 2>&1' > /etc/cron.d/borg

The script contains all its variables, so it works from cron with no extra configuration. This is the most common mistake with Borg: a command that works by hand but fails at night because the passphrase is not set.

6. Restore

First export the script's three variables in your terminal, then list the available archives:

borg list

Restore a file or folder: borg extract restores into the current folder, recreating the tree. Work in a temporary folder so you do not overwrite anything by mistake:

mkdir -p /tmp/restore && cd /tmp/restore
borg extract ::myvps-2026-09-18_0330 var/www/mysite.com/wp-config.php

Browse an archive like a folder, to find a file without knowing its exact path:

apt install -y python3-pyfuse3
mkdir -p /mnt/borg && borg mount ::myvps-2026-09-18_0330 /mnt/borg
ls /mnt/borg
borg umount /mnt/borg

Restore the databases from the export:

borg extract ::myvps-2026-09-18_0330 var/backups/sql/all-databases.sql.gz
gunzip -c var/backups/sql/all-databases.sql.gz | mariadb

7. Keep checking over time

  • Read the log from time to time: tail -n 30 /var/log/borg.log. A backup that fails silently for weeks is the most common scenario.
  • Check the integrity of the repository once a month with borg check.
  • Test a full restore at least once a quarter, ideally on a test VPS. A backup that has never been restored is only a hypothesis.

To get an alert on failure, combine this script with the monitoring described in monitoring your VPS. And if you host a WordPress site, see also installing WordPress on a VPS.

Frequently asked questions

Where should VPS backups be stored?

Always somewhere other than the VPS itself: a second server, ideally in another data centre, a home server or a storage service reachable over SSH. A backup on the same disk protects you neither from the server being deleted nor from a break-in.

How much space do Borg backups take?

Thanks to deduplication, each new archive only stores the blocks changed since the previous one. With the retention in this guide, i.e. 17 archives, the total space is often barely more than one full compressed backup, for a site whose files change little.

Can I restore a single file without restoring everything?

Yes. borg extract accepts a specific path, and borg mount lets you browse an archive like an ordinary folder to copy only what you need.

Borg or rsync: which should I choose?

rsync copies the state at a given moment: if a file is corrupted or encrypted by ransomware, the next copy overwrites it. Borg keeps a history of encrypted, deduplicated versions, which lets you go back to the state of a precise date. For backups, Borg is the better choice.

Linux NVMe VPS

Root access, Intel Xeon Gold and NVMe, delivered in 60 seconds. From €2.49/month.