Setting up backups via SFTP in DirectAdmin

SFTP (SSH File Transfer Protocol) backups in DirectAdmin refer to a method of securely backing up your web hosting server's data, including websites, databases, and configuration files, to a remote server using the SFTP protocol.

Requirements:

  • root user access to the DirectAdmin server.
  • Admin user access to the DirectAdmin panel.

Step 1 - Setting up the scripts required to enable SFTP based backups

Log in to your DirectAdmin server using your root credentials.

Change your Current Directory to the Custom Scripts Directory

cd /usr/local/directadmin/scripts/custom/

Clone the following GitHub Repository by using

git clone https://github.com/poralix/directadmin-sftp-backups.git

Copy PHP Scripts

cp -f directadmin-sftp-backups/ftp_download.php ./
cp -f directadmin-sftp-backups/ftp_list.php ./
cp -f directadmin-sftp-backups/ftp_upload.php ./

Set File Permissions and Change File Ownership by using

chmod 700 ftp_*.php
chown diradmin:diradmin ftp_*.php

Step 2 - Setting up the backup in DirectAdmin

Login to the DirectAdmin Panel using the Admin user access.

Learn how to establish backups in DirectAdmin, by accessing the "Admin Tools" section and selecting "Admin Backup/Transfer" for secure data protection.

First

Click on Schedule for backups,

First

You can select either All Users or a specific set of users to back up. Click on Next,

First

Select Now if you require to create a one-time backup right away, or select the Cron Scheduling to create a recurring backup at a specific time.

First

Choose the destination for the backup. It can be created locally or on a remote server. Since we are focusing on SFTP, we will select the FTP option here.

Fill in the destination details — IP, Username, Password, Path, and SSH Port. Also, make sure to select the Secure FTP option.

First

In the last step, Select what data should be backed up, usually All Data and click on Schedule.

First

Done!


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS