Using an FTP Server for 3CX Backups - Linux
This guide presents the supported FTP solutions available for 3CX Backup and Restore on Linux.
Important Note
The FTP servers tested by 3CX on Linux are vsftpd and Pro-FTPd. An FTP server runs independently of your 3CX PBX and is not required to be installed on the same machine. The FTP server mentioned in this guide is vsftpd.
FTP Server for Linux
This guide describes the installation of the “vsftpd” (very secure file transfer protocol daemon) FTP server on Debian 9/ Debian 10, free for anyone to download and use. To install the “vsftpd” FTP server:
- Use an account with administrative privileges to log on to your Linux system via SSH or local terminal.
- Update the APT repository information with the command:
- Install vsftpdwith the command:
- Enable the vsftpdservice to start on boot with the command:
Configure the vsftpd FTP Service
- Use the terminal on your Linux server to edit the file /etc/vsftpd.confand configure the FTP service, using this command:
- These are the minimal configuration options that need to be included in the configuration file for the vsftpdservice to run as intended:
listen=YES listen_ipv6=NO anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES use_localtime=NO xferlog_enable=YES xferlog_file=/var/log/vsftpd.log #Data Connection Timeout control for large file transfer - adjust accordingly. data_connection_timeout=3600 chroot_local_user=YES chroot_list_enable=NO secure_chroot_dir=/var/run/vsftpd/empty pam_service_name=ftp allow_writeable_chroot=YES #pasv_enable=YES #pasv_max_port=10100 #pasv_min_port=10090 #pasv_address=X.X.X.X
Lines starting with a hash (#) are commented out configuration options and are not applied by “vsftpd” during startup. Configure each option based on your environment and if your FTP server is running behind a NAT device, proceed to step “3”, otherwise skip to step “4”.
- If your FTP server is behind a NAT device, you need to enable the use of passive FTP. To do this, uncomment or add these configuration options at the end of the configuration file:
pasv_enable=YES
pasv_max_port=10100
pasv_min_port=10090
pasv_address=X.X.X.X
Configure these passive FTP connection options to suit your network environment:
- “pasv_min_port” and “pasv_max_port” - set a different port range (min - max).
- “pasv_address” - replace the “X.X.X.X” to match your public IP address.
- Press Ctrl+X, thenYandEnterto save the file and exit the editor.
- Restart the vsftpdservice to apply the configured options with the command:
Add an FTP User to vsftpd
- Using the Linux terminal, create a new FTP user with the command:
In this example we create the FTP user “3cxftpuser” with the “-s /bin/nologin” option to disable shell access for this account, i.e. to be used only for file transfers.
- To set a password for the new FTP user, use this command:
- Proceed to use the configured FTP service and user for the Backup and Restore function in the 3CX Management Console.
See More
- Using an FTP Server for 3CX Backups - Windows
- Learn how to use the 3CX Backup and Restore Commands
Last Updated
This document was last updated on 2 June 2023