Using an FTP Server for 3CX Backups - Linux
On this topic
In this guide, we will be discussing the supported FTP solutions available for 3CX Backup and Restore (Linux). These are editor’s picks of free and open source software that have been tested based on their reliability and performance with 3CX. For more information on this feature within your 3CX PBX, check out the Backup & Restore feature.
The FTP server software mentioned in this article is vsftpd. FTP Servers run independently of your 3CX PBX, it is not required that both run on the same operating system.
FTP Server for Linux
For this example, we will be using Debian for 3CX as the base operating system that the FTP server will be running. The FTP server software we will be using is vsftpd (very secure file transfer protocol daemon - daemon is Linux lingo for Server). Amongst Linux users, vsftpd is considered the most highly regarded FTP server software. As such, we’ve come to like it a lot for its constant performance, reliability, ease of administrative use and of course security. Most of all, it’s free for anyone to download and use with no costs involved.
Installing the vsftpd FTP server
- Log on to a terminal on your Linux system via SSH or other means.
- Prior to installing any package, we will update the repository information by issuing the command: apt-get update .
- To install vsftpd, issue the command: apt-get -y install vsftpd .
- Enable vsftpd to start on boot with the command: systemctl enable vsftpd.service
Configuring the vsftpd FTP server
- Whilst still logged on to the terminal of your Linux server, issue the command:
nano /etc/vsftpd.conf . This will launch a terminal based text-editor where you will edit the file /etc/vsftpd.conf to configure your FTP server.
- From the above screenshot you can see the minimal configuration directives that need to be present for the FTP server to run as intended. Lines starting with a hash (#) are commented out configuration directives and are not considered by vsftpd during startup. Configure each directive to suit your environment and then to save and exit press ctrl+X and then Y. If you are running behind a NAT, proceed to step 3 otherwise to step 4.
- If you are running behind a NAT, you will have to set the following options in order to enable the use of passive FTP. To do this, uncomment the line by removing the # from the beginning of each directive and set them as follows:
If you prefer a different port range for passive FTP connections then configure the pasv_min_port and pasv_max_port to values to suit your environment. The pasv_address directive should contain your Public IP address.
- Once you have saved and exited nano, you have to restart vsftpd in order for your new settings to take effect by issuing the command: systemctl restart vsftpd.service .
Adding an FTP user to vsftpd
- Whilst still logged on to your Linux terminal, issue the command:
useradd -m -s /bin/nologin 3cxbackup
In the aforementioned command, 3cxbackup is the username of the FTP user. Change this to suit your requirements. Note that we add the -s /bin/nologin parameter in order to disallow this account to be used for SSH or terminal access.
- To set a password for the new FTP user, issue the command: passwd 3cxbackup, where 3cxbackup is the username of the FTP account that you selected. Once you have set the password you can proceed with setting up this account for 3CX Backup & Restore.