How to Install vsftpd FTP Server on Ubuntu 22.04

To install vsftpd (Very Secure FTP Daemon) on Ubuntu 22.04, you can follow these steps:

Step 1 : Update the package lists for upgrades and new installations by running the following command:

Step 2 : Install vsftpd by running the following command:

Step 3 : Once the installation is complete, the vsftpd service will start automatically. You can verify the status of the service by running:

If the service is active and running, you will see an output indicating that it is active.

Step 4 : To disable anonymous FTP access and restrict FTP users to their home directories, open the vsftpd configuration file using a text editor such as nano:

Locate the following lines in the file and make the corresponding changes:

Save the changes and exit the text editor.

Step 5 : Restart the vsftpd service for the changes to take effect:

Step 6 : Create a new FTP user by running the following command:

Replace "ftpuser" with the desired username for your FTP user. You will be prompted to set a password and provide additional information for the user.

The command will create a new home directory for the user under /home/ftpuser and assign the appropriate permissions.

Step 7 : You may need to configure your firewall to allow FTP connections. If you are using UFW (Uncomplicated Firewall), you can allow FTP traffic by running the following command:

These commands allow FTP control connections on ports 20 and 21.

Step 8 : Test the vsftpd FTP Server using FileZilla

- Open FileZilla and go to "File" > "Site Manager" to open the Site Manager window.

- Click on the "New Site" button to create a new FTP site.

- In the "Host" field, enter the IP address or domain name of your Ubuntu 22.04 server where vsftpd is installed.

- Choose "FTP - File Transfer Protocol" as the protocol.

- Select "Use explicit FTP over TLS if available" for the encryption.

- In the "Logon Type" field, choose "Normal" and enter the credentials of the FTP user you created earlier (e.g., "ftpuser" and the corresponding password).

Step 15 : Click on "Connect" to establish a connection to the vsftpd FTP server.

If the connection is successful, you will see the remote file system of your Ubuntu server on the right-hand side of the FileZilla interface.

You can now transfer files between your local machine and the Ubuntu server by dragging and dropping files/folders between the local and remote file systems.

You have successfully installed and configured vsftpd on Ubuntu 22.04. You can now connect to the FTP server using an FTP client by specifying the server's IP address or domain name, along with the appropriate credentials (either anonymous or system user credentials).