Installing an FTP server on Ubuntu with vsftpd offers several key benefits. It enables file transfers between a client computer and a remote server. Users can upload, download, and organize files remotely. This is especially valuable for web developers, system administrators, and others who frequently manage large file transfers.
In this tutorial, you’ll learn how to set up an FTP server on Ubuntu with vsftpd (Very Secure FTP Daemon).
Setting Up an FTP Server on Ubuntu Using vsftpd
Vsftpd’s robust security features include SSL/TLS encryption. This ensures sensitive data is protected during file transfers. Follow the steps below to install the FTP Server on Ubuntu using Vsftpd:

Get Reliable Hosting with HostOnce’s Linux VPS
HostOnce’s Linux VPS lets you easily customize your hosting while offering strong performance, solid security, and stable uptime
Step 1: Update Ubuntu Repository
First, refresh the list of available software packages from the Ubuntu repositories.
sudo apt update
Step 2: Install vsftpd
To get started, open your terminal and use the command below to install the vsftpd package on your Ubuntu system.
sudo apt install vsftpd
After installation, the FTP service will automatically start. You can verify its status by using the command below.
sudo systemctl status vsftpd
Step 3: Configure vsftpd
The configuration settings are stored in the /etc/vsftpd.conf. Therefore, you need to open and edit the file with an editor like Nano.
sudo nano /etc/vsftpd.conf
3.1: Disable Anonymous Access
Find the anonymous_enable and set it to NO. This setting prevents the user from gaining access to a resource or service without providing authentication credentials.
anonymous_enable=NO
3.2: Enable Local User Access
To let local users log in to the FTP server, find the local_enable setting in the configuration file and change its value to YES.
local_enable=YES
3.3: Enable File Uploads
Also, you need to find and uncomment this line to allow users to upload files.
write_enable=YES
3.4: Chroot Local Users
To restrict local users to their own home directories, locate the chroot_local_user setting in the config file and remove the # at the beginning to enable it.
chroot_local_user=YES
By default, vsftpd doesn’t allow file uploads to directories that have write permissions enabled. To fix this, create a separate FTP folder inside the user’s home directory.
mkdir -p /home/$USER/ftp/upload
Change the owner of the directory /home/$USER/ftp from the user nobody, to the group nogroup.
sudo chown nobody:nogroup /home/$USER/ftp
Remove write permissions for all users, including the owner, from the directory /home/$USER/ftp.
sudo chmod a-w /home/$USER/ftp
Next, give the current user ownership of the /home/$USER/ftp/upload folder by assigning both the user and their group to it.
sudo chown $USER:$USER /home/$USER/ftp/upload
Finally, copy the following lines into the vsftpd.conf:
user_sub_token=$USER
local_root=/home/$USER/ftp
Note: You can also enable the allow_writeable_chroot directive by adding the following line to the configuration file.
allow_writeable_chroot=YES
After applying the required changes, restart the vsftpd service to make sure the new settings take effect.
sudo systemctl restart vsftpd
Set Firewall Settings for Ftp Server
You will need to allow FTP if the user has a firewall activated.
sudo ufw allow 20/tcp
Use UFW to enable incoming network traffic on port 21 over the TCP protocol.
sudo ufw allow 21/tcp
Next, update the firewall rules using the following command to allow incoming connections on port 990, which is commonly used for secure FTP (FTPS).
sudo ufw allow 990/tcp
Allow UFW to accept incoming network traffic from TCP ports 40000 to 50000 on a Linux System.
sudo ufw allow 40000:50000/tcp
Update the firewall using the following command once you have made changes to the rules.
sudo ufw reload
Test the FTP Server
Test the FTP server. Connect to the server using the IP address or localhost.
ftp localhost
Optional: Enable SSL/TLS
For secure file transfers, you can enable SSL/TLS. For this purpose, create an SSL certificate first:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.key -out /etc/ssl/certs/vsftpd.crt
Input the following lines in the vsftpd Configuration file.
ssl_enable=YES
rsa_cert_file=/etc/ssl/certs/vsftpd.crt
rsa_private_key_file=/etc/ssl/private/vsftpd.key
After this, use the following command refresh the vsftpd service to apply the change.
sudo systemctl restart vsftpd
Finally, you now have a working FTP server set up on Ubuntu using vsftpd, ready to handle file transfers.
ftp localhost
This sums up the FTP server installation on Ubuntu.
Boost your Linux skills with step-by-step tutorials from our Knowledge Base.
Conclusion
Installing and enabling vsftpd is ideal for remote access, file backups, and secure file management. Its user management features allow creating multiple accounts with specific permissions, making it an efficient and secure file transfer tool. In this guide, we explained how to use vsftpd to install ftp on Ubuntu.
FAQs
Who can benefit from using an FTP server?
Anyone who needs to manage or transfer large files, including web developers and system administrators, can benefit from an FTP server.
What security features does Vsftpd provide?
Vsftpd comes with a number of robust security features, including SSL/TLS, which encrypts data between client and server.
How to set up an FTP server on Ubuntu for remote access?
An FTP server lets users connect over the internet to access, download, or manage files from anywhere, making remote file handling simple and efficient. This is ideal for companies with remote employees or for individuals who want to access files on the road.
Is it possible to use an FTP server for creating backups?
Yes, you can use an FTP server as a backup solution. It's a reliable way to store and access backup files remotely over the internet. Users can upload important files regularly to the server, protecting them from local data loss.
How do I manage multiple user accounts on vsftpd?
Vsftpd supports the creation of multiple accounts, each with its own permissions and controls. This makes it an extremely versatile and secure tool for managing and moving files.
How to disable anonymous access on vsftpd?
Open the /etc/vsftpd.conf file and disable anonymous access.