Docs / Backup & Recovery / Setting Up Restic Backups to S3-Compatible Storage

Setting Up Restic Backups to S3-Compatible Storage

By Admin · Jan 19, 2026 · Updated Apr 24, 2026 · 7 views · 3 min read

Getting restic right from the start saves hours of debugging later. In this comprehensive guide, we'll cover everything from initial setup to production-ready configuration, including s3 and backup considerations.

Prerequisites

  • A registered domain name (for public-facing services)
  • Basic familiarity with the Linux command line
  • Root or sudo access to the server
  • Sufficient storage for backups (2-3x data size)
  • A VPS running Ubuntu 22.04 or later (2GB+ RAM recommended)

Backup Configuration

Regular maintenance is essential for keeping your restic installation running smoothly. Schedule periodic reviews of log files, disk usage, and security updates to prevent issues before they occur.


# Install and initialize backup tool
sudo apt install -y restic
restic init --repo /backup/repo

# Create first backup
restic backup --repo /backup/repo /etc /home /var/www

# List backups
restic snapshots --repo /backup/repo

Make sure to restart the service after applying these changes. Some settings require a full restart rather than a reload to take effect.

Advanced Settings

The default configuration works well for development environments, but production servers require additional tuning. Pay particular attention to connection limits, timeout values, and logging settings.

Scheduling Automated Backups

The default configuration works well for development environments, but production servers require additional tuning. Pay particular attention to connection limits, timeout values, and logging settings.


# Automated backup script: /usr/local/bin/backup.sh
#!/bin/bash
set -euo pipefail

BACKUP_REPO="/backup/repo"
LOG_FILE="/var/log/backup.log"
DATE=$(date +%Y-%m-%d_%H-%M)

echo "[$DATE] Starting backup..." >> $LOG_FILE

# Database dump
mysqldump --all-databases | gzip > /tmp/db-$DATE.sql.gz

# Run backup
restic backup --repo $BACKUP_REPO /etc /home /var/www /tmp/db-$DATE.sql.gz

# Cleanup old backups (keep 30 days)
restic forget --repo $BACKUP_REPO --keep-daily 7 --keep-weekly 4 --keep-monthly 3 --prune

rm /tmp/db-$DATE.sql.gz
echo "[$DATE] Backup completed successfully" >> $LOG_FILE

The output should show the service running without errors. If you see any warning messages, address them before proceeding to the next step.

Encryption and Security

It's recommended to test this configuration in a staging environment before deploying to production. This helps identify potential compatibility issues and allows you to benchmark performance differences.


# Install and initialize backup tool
sudo apt install -y restic
restic init --repo /backup/repo

# Create first backup
restic backup --repo /backup/repo /etc /home /var/www

# List backups
restic snapshots --repo /backup/repo

The output should show the service running without errors. If you see any warning messages, address them before proceeding to the next step.

Summary

You've successfully configured restic on your VPS. Remember to monitor performance, keep your software updated, and maintain regular backups. If you run into issues, consult the official documentation or open a support ticket for assistance.

Was this article helpful?