Pure-FTPd is a free, secure, and feature-rich FTP server solution that supports various authentication methods and is ideal for web hosting environments. This guide will show you how to install and configure Pure-FTPd on Ubuntu 24.04, whether you're running a local server or a VPS server. Pure-FTPd is known for its security and ease of configuration, making it a great choice for managing FTP services.
Step 1: Update Your System
Before installing any software, it's always recommended to update your package list and ensure that your system is running the latest security patches. Open your terminal and run the following command:
sudo apt update && sudo apt upgrade -y
Step 2: Install Pure-FTPd
To install Pure-FTPd on Ubuntu 24.04, use the following command:
sudo apt install pure-ftpd -y
Once the installation is complete, the Pure-FTPd service will start automatically. You can verify its status with the following command:
sudo systemctl status pure-ftpd
Step 3: Configure Pure-FTPd
Now that Pure-FTPd is installed, we need to configure it for secure operation. You can find the main configuration files in the /etc/pure-ftpd
directory. Let's make a few adjustments for optimal performance and security.
Create FTP User Directory
By default, Pure-FTPd operates in a secure manner by using virtual users. First, create a directory for storing your FTP users' files:
sudo mkdir -p /home/ftpusers
Next, adjust the permissions so that Pure-FTPd can access the directory:
sudo chown -R ftpuser:ftpgroup /home/ftpusers
Enable Virtual Users
To manage FTP accounts with virtual users, you need to enable Pure-FTPd's virtual user functionality. Create a virtual user file to store your FTP users:
sudo pure-pw useradd ftpuser -u ftpuser -d /home/ftpusers/ftpuser
Set a password for the FTP user:
sudo pure-pw passwd ftpuser
Next, compile the virtual user database:
sudo pure-pw mkdb
Step 4: Enable TLS/SSL for Secure FTP
To enhance security, it’s important to encrypt FTP traffic. Pure-FTPd supports TLS/SSL for secure FTP connections. First, generate an SSL certificate:
sudo mkdir -p /etc/ssl/private/
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
Make sure to secure the SSL certificate file:
sudo chmod 600 /etc/ssl/private/pure-ftpd.pem
Now, enable TLS by editing the configuration file:
sudo nano /etc/pure-ftpd/conf/TLS
Add the following line:
1
Save and exit the file, then restart Pure-FTPd to apply the changes:
sudo systemctl restart pure-ftpd
Step 5: Adjust Firewall Settings
If you have a firewall running on your VPS server, make sure to allow FTP and TLS traffic. Run the following commands to allow ports 21 (FTP) and 990 (TLS) through UFW:
sudo ufw allow 21/tcp
sudo ufw allow 990/tcp
Then, restart the UFW firewall:
sudo ufw reload
Step 6: Test the FTP Connection
Now that Pure-FTPd is installed and configured, you can test the FTP connection using an FTP client like FileZilla or the command line. Connect to your server using the FTP user credentials you created earlier.
In FileZilla, enter the server's IP address, the FTP user credentials, and port 21 for FTP or port 990 for FTPS. Make sure to use the correct protocol (FTPS for a secure connection).
Running Pure-FTPd on a VPS Server
Pure-FTPd is a lightweight and secure FTP solution, making it an excellent choice for managing file transfers on a VPS server. By enabling TLS/SSL, you ensure that file transfers remain encrypted, which is essential when running FTP services on a public-facing server like a VPS.
Looking for a Reliable VPS Solution?
If you're looking for a reliable and scalable VPS server to host your Pure-FTPd server or any other application, consider using WindowsVPS. With WindowsVPS, you get high-performance VPS hosting with full control over your server, ensuring a secure and optimized environment for your FTP services.