UnderHost
Knowledgebase Docs

VPS Disaster Recovery: Prepare and recover quickly

Create a disaster recovery plan for your VPS. Learn recovery strategies, backup tools, restore procedures, and when to contact UnderHost support.

On this page

VPS disaster recovery differs significantly from shared hosting. You have root access, full control over software, and can implement sophisticated recovery strategies. This flexibility comes with responsibility—your disaster recovery plan is entirely your own.

VPS disaster recovery advantages

On a Cloud VPS at UnderHost, you have several powerful recovery options:

  • Snapshots: One-click point-in-time restoration (if available in your VPS plan)
  • Full SSH access: Complete control to restore files, databases, configurations
  • Custom scripts: Automate backups and restore processes
  • Multiple storage options: Store backups locally, offsite, or cloud-based
  • No data center restrictions: Move your VPS to a different data center if needed
  • Reboot capabilities: Restart services or the entire server

Common disaster scenarios

ScenarioCauseRecovery Priority
Website downWeb server crashed, port blocked, or configuration brokenHigh (1 hour RTO)
Database offlineMySQL/MariaDB crashed, disk full, or corruptedCritical (30 min RTO)
Disk fullLogs, uploads, or cached files consumed all spaceHigh (1-4 hours RTO)
Compromised accountHacker accessed root or created backdoorCritical (immediate RTO)
Data corruptionMalware, bad script, or corrupted databaseMedium (4-24 hours RTO)
Hardware failurePhysical server failure (rare on modern clouds)Medium (2-4 hours RTO)
Deleted filesAccidental `rm -rf` or misconfigured scriptMedium (depends on backup age)
Network connection lostISP issue, firewall rule, or UnderHost network problemLow (dependency on external factors)

Before disaster strikes

1. Implement automated backups

Option A: Use UnderHost VPS snapshots (if available)

  • Log in to CustomerPanel
  • Navigate to your VPS service
  • Check if snapshot/backup feature is available
  • Schedule automatic daily snapshots
  • Keep 7-30 days of snapshots depending on storage

Option B: Set up backup cron jobs

# Daily database backup at 2 AM
0 2 * * * mysqldump -u root -p'password' --all-databases | gzip > /backups/db-$(date +\%Y-\%m-\%d).sql.gz

# Daily file backup at 2:30 AM
30 2 * * * tar -czf /backups/files-$(date +\%Y-\%m-\%d).tar.gz /home/user/public_html /etc/nginx

# Delete old backups (keep 30 days)
0 3 * * * find /backups -name "*.gz" -mtime +30 -delete

Option C: Use backup services

  • Duplicity (encrypted incremental backups)
  • Rsync to offsite server
  • AWS S3, Backblaze B2, or other cloud storage

2. Document your recovery procedures

Write down step-by-step recovery processes:

  • Where backups are stored (local path, remote server, cloud service)
  • How to download/access backups
  • How to restore files: `tar -xzf backup.tar.gz -C /`
  • How to restore database: `mysql < backup.sql`
  • How to verify restoration (spot checks, service tests)
  • Services to restart in order: MySQL, PHP-FPM, Nginx, etc.
  • Contact info for UnderHost support and your own team

3. Test disaster recovery procedures

  • Monthly: Verify backup integrity (can you extract a recent backup?)
  • Quarterly: Practice a full restore to a test environment
  • Annually: Perform complete recovery test and document results

4. Configure monitoring and alerts

# Monitor disk usage
df -h / | grep -v "^Filesystem" | awk '{print $5}' | sed 's/%//' | while read usage; do
  if [ $usage -gt 80 ]; then
    echo "ALERT: Disk usage at ${usage}%" | mail -s "VPS Alert" admin@example.com
  fi
done

# Monitor database status
mysqladmin -u root -p'password' ping || echo "MySQL down" | mail -s "VPS Alert" admin@example.com

# Monitor web server
curl -s http://localhost/ > /dev/null || echo "Web server down" | mail -s "VPS Alert" admin@example.com

Recovery tools and options

VPS snapshot restore (fastest)

If your VPS plan includes snapshots:

  1. Log in to CustomerPanel
  2. Go to your VPS service
  3. Look for "Snapshots" or "Backups" section
  4. Select a snapshot from before the disaster
  5. Click "Restore to this snapshot"
  6. Wait for restoration (usually 5-30 minutes)
  7. Verify server is responding (ping, SSH, web access)

Recovery time: 10-30 minutes

Limitations: Only restores to exact point-in-time; any changes made after snapshot are lost

Backup file restoration (most common)

# Download backup
scp user@backup-server:/backups/files-latest.tar.gz /tmp/
scp user@backup-server:/backups/db-latest.sql.gz /tmp/

# Restore files
tar -xzf /tmp/files-latest.tar.gz -C /

# Restore database
gunzip /tmp/db-latest.sql.gz
mysql < /tmp/db-latest.sql

# Verify web server is running
systemctl status nginx
systemctl status php-fpm

# Test website
curl http://localhost/

Recovery time: 15-60 minutes (depends on backup size)

Manual file recovery from offsite storage

If your VPS is completely lost and needs to be rebuilt:

  1. Order a new VPS from UnderHost (or use existing if functional)
  2. Install operating system (Ubuntu, CentOS, etc.)
  3. Install web server, database, PHP, etc.
  4. Download backup from offsite storage
  5. Restore files and database
  6. Reconfigure domain DNS pointing to new IP
  7. Verify SSL certificate (may need reissue if new server)

Recovery time: 2-4 hours (full server rebuild)

During a disaster

First 5 minutes:

  • ☐ Recognize the problem (website down, database offline, SSH not responding)
  • ☐ Check if it's your VPS or your internet connection (try pinging from multiple locations)
  • ☐ Log into CustomerPanel and check VPS status
  • ☐ Notify your users if appropriate (status page, social media)

First 15 minutes:

  • ☐ Try simple fixes: restart the service (`systemctl restart nginx`), check disk usage (`df -h`)
  • ☐ Check logs for errors (`tail -100 /var/log/nginx/error.log`)
  • ☐ If fixable quickly, apply fix and verify service recovers

If not recovered in 15 minutes:

  • ☐ Declare recovery needed
  • ☐ If you have snapshots, try snapshot restore (safest, fastest)
  • ☐ If you have backups, prepare for file/database restoration
  • ☐ If unable to recover yourself, contact UnderHost support

Recovery order (critical first)

When recovering multiple services, restore in this order:

  1. Network/kernel: VPS must be online and SSH accessible (verify with ping, SSH)
  2. Storage: Free up disk space if full (delete logs, old backups, temp files)
  3. Database: MySQL/MariaDB must be running (stop apps first, restore DB, then start apps)
  4. Website files: Restore website code and content
  5. Web server: Nginx or Apache must be running and serving files
  6. PHP/application runtime: PHP-FPM or equivalent must be active
  7. DNS: Update DNS records if IP changed or server moved
  8. SSL/HTTPS: Install or reissue SSL certificate if needed
  9. Email: Verify mail server if running on VPS
  10. Monitoring/backups: Resume automated backups, monitoring, updates

When to contact UnderHost

Contact UnderHost support when:

  • VPS is not responding: Can't SSH, can't ping, console shows errors
  • Hardware failure: Disk errors, memory issues, network port down
  • You need snapshot restore but don't know how: Support can walk you through CustomerPanel
  • You need data recovery from old backups: Contact support; we may have retained backups
  • Network is down: Issue is outside your VPS (we're investigating infrastructure)
  • You've lost all backups and need help: Support can discuss recovery options

Contact UnderHost Support: Open a support ticket or call emergency support line (details in your welcome email)

Disaster prevention

Reduce the chance of disaster:

  • Keep your VPS updated: `apt update && apt upgrade` weekly
  • Monitor disk usage: Don't let it fill up
  • Monitor logs: Watch for errors that predict failure
  • Monitor services: Alert if web server or database goes down
  • Use firewall rules: Block unnecessary traffic
  • Use strong passwords: Reduce compromise risk
  • Keep software current: Security patches reduce break-ins
  • Have a restore plan: Document everything before you need it
Hope for the best, plan for the worst

Disaster recovery planning is not pessimism—it's responsible management. Document procedures now while you're calm. Test them quarterly. When disaster strikes (and statistically, it will), you'll be ready.

Related: Disaster recovery planning | Backup best practices | VPS management | Server monitoring

Was this article helpful?

Need a Cloud VPS?

Launch an UnderHost Cloud VPS when you need root access, dedicated resources, custom software, or more control than shared hosting.

Related articles

Back to Cloud VPS