For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /directadmin/backups/setting_up_backups_via_sftp_in_directadmin.md.

Setting Up Backups via SFTP in DirectAdmin

Important

This guide is applicable only to our DirectAdmin VPS plans. If you have a DirectAdmin Shared Hosting or Reseller plan, backups are automatically handled by us.

SFTP (SSH File Transfer Protocol) backups in DirectAdmin provide a secure way to back up your hosting server's data, including websites, databases, and configuration files, to a remote server.

Requirements

Before proceeding, make sure you have:

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

Configure SFTP Backup Scripts

Log in to the DirectAdmin server

Log in to your DirectAdmin server using your root credentials.

Change your current directory to the DirectAdmin Custom Scripts directory:

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

Clone the SFTP backup repository

Clone the following GitHub repository:

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

Copy the PHP scripts

Copy the required PHP scripts into the Custom Scripts directory:

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 ownership

Set the required file permissions and change the ownership of the scripts:

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

Configure Backups in DirectAdmin

Log in to DirectAdmin

Log in to the DirectAdmin panel using your Admin user credentials.

Navigate to Admin Tools → Admin Backup/Transfer.

Admin Backup/Transfer option

Open the backup scheduling page

Click Schedule to configure a backup.

Schedule backup option

Select users to back up

Select All Users or choose specific users you want to back up.

Click Next to continue.

Select users for backup

Configure the backup schedule

Choose Now to create a one-time backup immediately, or select Cron Scheduling to configure recurring backups at a specific time.

Configure backup schedule

Configure the backup destination

Choose where to store the backup. You can select a local destination or a remote server.

For SFTP backups, select the FTP option and enter the destination details:

  • IP: Remote server IP address.
  • Username: Remote server username.
  • Password: Remote server password.
  • Path: Destination directory on the remote server.
  • SSH Port: Remote server SSH port.

Make sure to select the Secure FTP option.

Configure remote SFTP backup destination

Select backup data and schedule

Select the data you want to back up. Usually, you can select All Data.

Click Schedule to save the backup configuration.

Select backup data and schedule

Tip

For recurring backups, choose a suitable cron schedule and ensure the remote server has sufficient storage space.