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
| Scenario | Cause | Recovery Priority |
|---|---|---|
| Website down | Web server crashed, port blocked, or configuration broken | High (1 hour RTO) |
| Database offline | MySQL/MariaDB crashed, disk full, or corrupted | Critical (30 min RTO) |
| Disk full | Logs, uploads, or cached files consumed all space | High (1-4 hours RTO) |
| Compromised account | Hacker accessed root or created backdoor | Critical (immediate RTO) |
| Data corruption | Malware, bad script, or corrupted database | Medium (4-24 hours RTO) |
| Hardware failure | Physical server failure (rare on modern clouds) | Medium (2-4 hours RTO) |
| Deleted files | Accidental `rm -rf` or misconfigured script | Medium (depends on backup age) |
| Network connection lost | ISP issue, firewall rule, or UnderHost network problem | Low (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:
- Log in to CustomerPanel
- Go to your VPS service
- Look for "Snapshots" or "Backups" section
- Select a snapshot from before the disaster
- Click "Restore to this snapshot"
- Wait for restoration (usually 5-30 minutes)
- 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:
- Order a new VPS from UnderHost (or use existing if functional)
- Install operating system (Ubuntu, CentOS, etc.)
- Install web server, database, PHP, etc.
- Download backup from offsite storage
- Restore files and database
- Reconfigure domain DNS pointing to new IP
- 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:
- Network/kernel: VPS must be online and SSH accessible (verify with ping, SSH)
- Storage: Free up disk space if full (delete logs, old backups, temp files)
- Database: MySQL/MariaDB must be running (stop apps first, restore DB, then start apps)
- Website files: Restore website code and content
- Web server: Nginx or Apache must be running and serving files
- PHP/application runtime: PHP-FPM or equivalent must be active
- DNS: Update DNS records if IP changed or server moved
- SSL/HTTPS: Install or reissue SSL certificate if needed
- Email: Verify mail server if running on VPS
- 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
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
Need a Cloud VPS?
Launch an UnderHost Cloud VPS when you need root access, dedicated resources, custom software, or more control than shared hosting.





















