📞 🇺🇸 +1 361 304 4309 📞 🇮🇳 +91 76769 02281 ✉️ [email protected]
Server Management

How to Set Up Restic Backup on Linux Server

How to Set Up Restic Backup on Linux Server

Restic is a modern backup tool with built-in encryption, deduplication and compression. It supports multiple backends and is significantly faster than traditional tools.

Step 1 — Install Restic

sudo apt install restic -y

Step 2 — Initialize Repository

# Local
restic init --repo /backups/myrepo

# S3
export AWS_ACCESS_KEY_ID=your_key
export AWS_SECRET_ACCESS_KEY=your_secret
restic init --repo s3:s3.amazonaws.com/mybucket/restic

# Backblaze B2
export B2_ACCOUNT_ID=your_id
export B2_ACCOUNT_KEY=your_key
restic init --repo b2:mybucket:restic

Step 3 — Create Backup

export RESTIC_REPOSITORY=/backups/myrepo
export RESTIC_PASSWORD=your-strong-password
restic backup /var/www --exclude='*.log'

Step 4 — Backup MySQL

mysqldump --all-databases -u root -p'password' |   restic backup --stdin --stdin-filename all-databases.sql

Step 5 — Schedule

0 2 * * * RESTIC_PASSWORD=password restic backup /var/www && restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune

Step 6 — Restore

restic snapshots
restic restore latest --target /restore/

Conclusion

Restic provides enterprise-grade backup features for free. Our team configures automated backup solutions using Restic.

#restic #backup #linux #encryption
Share:
🛠️ Need Expert Help?

Don't want to do this yourself?

Our certified engineers implement this for you — correctly, securely, and within hours. Available 24/7 with 15-minute emergency response.

  • ✅ 19+ years experience
  • ✅ 60+ certified engineers
  • ✅ 1,600+ servers managed
  • ✅ 40+ countries served
  • ✅ Plans from $49/mo

Get Expert Help — Free Consultation

We respond within 4 hours · No commitment required

Please enter your name and a valid email.

No spam. Privacy Policy

Comments