Prerequisites
Before backing up configuration, make sure you have:
- SSH access to your VPS
- Root or sudo privileges
Backup HestiaCP Configuration Files
ssh hxroot@YOUR_SERVER_IP -p 22
Create backup directory:
mkdir -p /backup/hestia-config
Backup main configuration:
cp -r /usr/local/hestia/data/ /backup/hestia-config/
cp /usr/local/hestia/conf/hestia.conf /backup/hestia-config/
cp -r /usr/local/hestia/ssl/ /backup/hestia-config/
Backup templates:
cp -r /usr/local/hestia/data/templates/ /backup/hestia-config/templates/
Package backup:
tar -czf /backup/hestia-config_$(date +%Y%m%d).tar.gz /backup/hestia-config/
Backup User Data Separately
/usr/local/hestia/bin/v-backup-users
Backup Database
mysqldump hestia > /backup/hestia-db_$(date +%Y%m%d).sql
Automated Config Backup Script
#!/bin/bash
BACKUP_DIR="/backup/hestia-config"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
cp /usr/local/hestia/conf/hestia.conf $BACKUP_DIR/hestia.conf.$DATE
cp -r /usr/local/hestia/data/templates $BACKUP_DIR/templates.$DATE
mysqldump hestia > $BACKUP_DIR/hestia_db.$DATE.sql
tar -czf $BACKUP_DIR/hestia_full_$DATE.tar.gz $BACKUP_DIR/
echo "Config backup completed at $DATE"
✅ HestiaCP configuration has been backed up.