Prerequisites
Before setting up SFTP backups, make sure you have:
- SFTP server credentials (host, port, username, password/key)
- SSH access to your VPS
What is SFTP?
SFTP (SSH File Transfer Protocol) is a secure alternative to FTP that encrypts both authentication and data.
Configure SFTP Backup in HestiaCP
Step 1: Log in to HestiaCP
https://YOUR_SERVER_IP:8083
Step 2: Navigate to SERVER Section
Click on SERVER in the top menu bar.
Step 3: Go to Backup Tab → Remote
Step 4: Select SFTP as Type
Fill in:
- Type: SFTP
- Host: backup.example.com
- Port: 22
- Username: backupuser
- Password: (or leave blank if using SSH key)
- Directory: /backup/hestiacp/
Step 5: Set Up SSH Key Authentication (Recommended)
On your HestiaCP server:
ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa_hestia_backup
Copy public key to remote server:
ssh-copy-id -i /root/.ssh/id_rsa_hestia_backup.pub backupuser@backup.example.com
Step 6: Test and Save
Click Test Connection then Save.
Manual SFTP Backup Script
#!/bin/bash
BACKUP_DIR="/backup"
REMOTE_HOST="backup.example.com"
REMOTE_USER="backupuser"
REMOTE_PATH="/backup/hestiacp/"
# Create backup first
/usr/local/hestia/bin/v-backup-users
# Upload to SFTP server
sftp $REMOTE_USER@$REMOTE_HOST <
Using lftp for SFTP (Better for many files)
apt install lftp -y
lftp sftp://backupuser@backup.example.com -e "mirror -R /backup /backup/hestiacp/; quit"
✅ SFTP backup has been configured successfully!