Hostxpeed
Login Get Started →
Control Panel

How to Backup Database in HestiaCP

6 min read
26 views
Jun 10, 2026

Prerequisites

Before backing up a database, make sure you have:

  • Access to HestiaCP control panel
  • Database credentials or root access

Method 1: Backup via HestiaCP Web Interface

Step 1: Log in to HestiaCP

https://YOUR_SERVER_IP:8083

Step 2: Navigate to DB Section

Click on DB in the top menu bar.

Step 3: Click Backup Icon

Click the backup/download icon next to the database.

The database will be exported as an SQL file and downloaded to your computer.

Method 2: Backup via SSH (mysqldump)

ssh hxroot@YOUR_SERVER_IP -p 22

Backup single database:

mysqldump -u username -p database_name > backup.sql

Backup with timestamp:

mysqldump -u username -p database_name > backup_$(date +%Y%m%d).sql

Backup all databases:

mysqldump -u root -p --all-databases > all_databases_backup.sql

Backup with compression:

mysqldump -u username -p database_name | gzip > backup.sql.gz

Method 3: Automated Daily Backup via Cron

Create backup script:

nano /root/backup_db.sh

Add content:

#!/bin/bash
BACKUP_DIR="/backup/databases"
mkdir -p $BACKUP_DIR
mysqldump -u username -p'password' database_name | gzip > $BACKUP_DIR/db_$(date +%Y%m%d_%H%M%S).sql.gz
# Keep only last 7 days
find $BACKUP_DIR -name "*.sql.gz" -mtime +7 -delete

Make executable and add to cron:

chmod +x /root/backup_db.sh
crontab -e

Add:

0 2 * * * /root/backup_db.sh

Using HestiaCP Backup System

HestiaCP includes databases in scheduled backups. Go to SERVER → Configure to set backup schedule.

✅ Database backup has been created successfully!

Was this article helpful?