File Transfer Protocol (FTP) is a standard network protocol used for transferring files between a client and a server on a computer network. In an FTP exchange, one machine operates as the server, running FTP server software, while the other acts as a client, running FTP client software. Clients can upload or download files to and from the server, depending on the permissions set. While FTP typically requires users to log in with a username and password, it can also be configured to allow anonymous access.

This guide details how to set up an FTP server on an Ubuntu system using vsftpd (Very Secure FTP Daemon), a popular and secure FTP server solution.

Installing vsftpd on Ubuntu

vsftpd is a widely used FTP server in Ubuntu due to its robustness and security. It is available in the default Ubuntu repositories. To install vsftpd on your system, open a terminal and run the following command:

sudo apt install vsftpd

Note: If you're using Ubuntu versions earlier than 14.04, use apt-get instead of apt.

Once the installation is complete, the vsftpd daemon should start automatically. To verify that it's running correctly, execute:

service vsftpd status

If the service status isn't listed as Active, it means the FTP server isn't running yet. To start the vsftpd service, run:

sudo service vsftpd start

After starting the service, check its status again to ensure it's active and running.

Configuring vsftpd

The primary configuration file for vsftpd is located at /etc/vsftpd.conf. This file contains numerous options that allow you to customize the FTP server's behavior. Two common configurations involve enabling anonymous access and allowing users to upload files to the server.

To modify the configuration, open the file with your preferred text editor. For example, to use vim, enter:

sudo vim /etc/vsftpd.conf

To allow anonymous users to access the FTP server, locate the line anonymous_enable=NO and change it to anonymous_enable=YES. This change permits users to connect without providing a username and password.

When anonymous access is enabled, the server uses a special system user named ftp. The default directory accessible to anonymous users is /srv/ftp, which is the home directory of the ftp user. To share files with anonymous users, place the files in this directory.

If you want to change the directory that anonymous users access, you need to modify the home directory of the ftp user. For example, to set the anonymous FTP directory to /srv/files/ftp, run:

sudo usermod -d /srv/files/ftp ftp

To allow authenticated users to upload files to the FTP server, you need to enable write permissions. In the /etc/vsftpd.conf file, find the line #write_enable=YES and uncomment it by removing the # symbol at the beginning of the line. The line should now read:

This change allows users with valid credentials to upload files to the server.

Save and close the configuration file. If you're using vim, press Esc to enter command mode, type :wq, and press Enter to save and exit.

For the changes to take effect, restart the vsftpd service by running:

sudo service vsftpd restart

Testing the FTP Server

After configuring the FTP server, it's essential to test its functionality. You can perform both download and upload tests to ensure the server operates as expected.

Download Test

Most modern web browsers support FTP protocol for downloading files. However, they typically don't allow file uploads. To test downloading files from your FTP server, open your preferred web browser and enter the following in the address bar:

ftp://127.0.0.1

This address directs the browser to connect to the FTP server running on the local machine (localhost). If you're testing from a different machine on the same network, replace 127.0.0.1 with the FTP server's IP address.

Since anonymous access is enabled, you should see a directory listing of the anonymous FTP directory, such as /srv/ftp or the directory you specified earlier.

To test the server with authentication, you can disable anonymous access. Edit the /etc/vsftpd.conf file again:

sudo vim /etc/vsftpd.conf

Change the line anonymous_enable=YES back to anonymous_enable=NO to disable anonymous logins.

Save the file and restart the FTP service:

sudo service vsftpd restart

When you access the FTP server in your browser now, you'll be prompted to enter a username and password.

Enter your system's username and password to log in. After logging in, you should see a directory listing of your user's home directory.

You can now download files from your home directory via the FTP server.

Upload Test

To test uploading files to the FTP server, you'll need to use an FTP client that supports file transfers. On Ubuntu, the default file manager, Nautilus, can function as an FTP client.

Step 1: Open Nautilus by clicking on the file manager icon in the dock or searching for "Files" in the applications menu.

Step 2: In the Nautilus sidebar, click on "Other Locations" at the bottom.

Step 3: At the bottom of the window, you'll see a "Connect to Server" field. Enter your FTP server address (e.g., ftp://127.0.0.1) and click "Connect."

Step 4: A prompt will appear asking for your login credentials. Select "Registered User," enter your username and password, and choose whether to remember the password. Click "Connect" to proceed.

Step 5: Once connected, you'll see the contents of your home directory on the FTP server. You can now upload files by dragging and dropping them into this window or by copying and pasting.

Note: While it's possible to enable write permissions for anonymous users, doing so poses significant security risks and is strongly discouraged. Always require authentication for users uploading files to your FTP server.


By following these steps, you can successfully set up and configure an FTP server on Ubuntu using vsftpd. Testing both download and upload functionalities ensures your server is operating correctly. For additional security, consider using FTP over SSL/TLS (FTPS) or SSH File Transfer Protocol (SFTP) to encrypt file transfers. Remember to replace 127.0.0.1 with your server's actual IP address when accessing the FTP server from other machines on your network.