Docs / Backup & Recovery / Full Server Recovery from Bare Metal

Full Server Recovery from Bare Metal

By Admin · Mar 26, 2026 · Updated Apr 23, 2026 · 6 views · 3 min read

Managing bare-metal effectively is a crucial skill for any system administrator. This tutorial provides step-by-step instructions for recovery configuration, along with best practices for production environments.

Backup Configuration

If you encounter issues during setup, check the system logs first. Most problems can be diagnosed by examining the output of journalctl or the application-specific log files in /var/log/.


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

# Create first backup
bare-metal backup --repo /backup/repo /etc /home /var/www

# List backups
bare-metal snapshots --repo /backup/repo

The configuration above sets the recommended values for a VPS with 2-4GB of RAM. Adjust the memory-related settings proportionally if your server has different specifications.

Configuration Options

The recovery component plays a crucial role in the overall architecture. Understanding how it interacts with bare-metal will help you make better configuration decisions.

  • Use SSH keys instead of password authentication
  • Keep all software components up to date
  • Use strong, unique passwords for all services
  • Set up fail2ban for brute force protection
  • Enable firewall and allow only necessary ports

Scheduling Automated Backups

After applying these changes, monitor the server's resource usage for at least 24 hours to ensure stability. Tools like htop, iostat, and vmstat can provide real-time insights into system performance.


# 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
bare-metal backup --repo $BACKUP_REPO /etc /home /var/www /tmp/db-$DATE.sql.gz

# Cleanup old backups (keep 30 days)
bare-metal 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

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

Encryption and Security

Regular maintenance is essential for keeping your bare-metal 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 bare-metal
bare-metal init --repo /backup/repo

# Create first backup
bare-metal backup --repo /backup/repo /etc /home /var/www

# List backups
bare-metal snapshots --repo /backup/repo

Each line in the configuration serves a specific purpose. The comments explain the reasoning behind each setting, making it easier to customize for your specific use case.

Summary

You've successfully configured bare-metal 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?