An FTP (File Transfer Protocol) server allows users to upload, download, and manage files on a remote system. On Ubuntu, vsftpd (Very Secure FTP Daemon) is one of the most reliable and widely used FTP servers due to its performance, stability, and security features.
This article explains every command and configuration option in detail, making it suitable for beginners as well as system administrators.
Step 1: Update the System Package Index
Before installing any new software, it is important to update Ubuntu’s package list. This ensures your system knows about the latest versions of available packages and security updates.
sudo apt update

What this does:
- Refreshes the local repository index
- Prevents installation issues caused by outdated package information
- Recommended before every installation
Step 2: Install vsftpd FTP Server
Now that the package list is updated, you can install the vsftpd FTP server package.
sudo apt install vsftpd

Step 3: Verify vsftpd Installation
After installation, it is good practice to verify that vsftpd is installed correctly and accessible.
vsftpd -v

Step 4: Start the FTP Service
Once installed, the FTP service must be started so it can accept incoming connections.
sudo systemctl start vsftpd

Step 5: Enable vsftpd to Start on Boot
To ensure the FTP service remains available after a system reboot, enable it at startup.
sudo systemctl enable vsftpd

What this does:
- Automatically starts vsftpd whenever the system boots
- Prevents service downtime after restarts
Step 6: Check FTP Service Status
Before continuing, verify that the vsftpd service is running correctly.
sudo systemctl status vsftpd

Step 7: Open the vsftpd Configuration File and Modify FTP Configuration Settings
The main configuration file controls how the FTP server behaves. To customize access and permissions, open it using a nano editor.
nano /etc/vsftpd.conf
Inside the configuration file, update or confirm the following highlighted settings to enable user access and uploads.
anonymous_enable=YES
local_enable=YES
write_enable=YES
anon_upload_enable=YES

After editing:
- Save: `CTRL + O` → Enter
- Exit: `CTRL + X`
Step 8: Restart vsftpd to Apply Changes
After modifying the configuration file, the FTP service must be restarted to apply the new settings.
sudo systemctl restart vsftpd

Step 9: Enable the Firewall (UFW)
Ubuntu includes a built-in firewall called UFW (Uncomplicated Firewall). Enabling it improves server security.
sudo ufw enable

What this does:
- Activates the firewall
- Blocks unauthorized incoming traffic by default
- Protects your server from network threats
Step 10: Allow FTP Traffic Through Firewall
FTP uses port 21, which must be allowed through the firewall for clients to connect.
sudo ufw allow ftp

Step 11: Verify Firewall Rules
Check the firewall status to ensure FTP access is allowed.
sudo ufw status

Step 12: Connect to the FTP Server
Now that the server is configured, you can test connectivity using the FTP client.
ftp {IP}

Once testing is complete, exit the FTP client safely.
exit

Final Notes
You have now successfully:
- Installed an FTP server on Ubuntu
- Enabled user and anonymous access
- Allowed file uploads
- Configured firewall rules
- Tested FTP connectivity
For production environments, it is recommended to:
- Disable anonymous access
- Use FTPS (Secure FTP)
- Restrict users to home directories
- Configure passive mode
