How to install FTP Server in Ubuntu 22.04

How to install FTP Server in Ubuntu 22.04

To set up an FTP server on Ubuntu 22.04, you can use the vsftpd (Very Secure FTP daemon) package, which is a popular and secure FTP server software. Here’s a step-by-step guide to help you set it up:

  1. Update the system:
    sudo apt update
  2. Install vsftpd:
    sudo apt install vsftpd
  3. After the installation is complete, the vsftpd service will start automatically. However, you may want to adjust some configuration settings. Open the configuration file using a text editor (e.g., nano):
    sudo nano /etc/vsftpd.conf
  4. Inside the configuration file, you can make the following changes:
    • To allow local users to log in, ensure the following line is uncommented or added:
      local_enable=YES
    • To enable write access, uncomment or add the following line:
      write_enable=YES
    • To specify the directory where the FTP users will have access, you can set the following line to the desired directory (e.g., /home/ftp):
      local_root=/home/ftp
    • To disable anonymous FTP, make sure the following line is uncommented or added:
      anonymous_enable=NO
    • If you want to limit FTP users to their home directories, uncomment or add the following line:
      chroot_local_user=YES
    • To allow FTP users to upload files, uncomment or add the following line:
      allow_writeable_chroot=YES
    • Save the changes and exit the text editor.
  5. Restart the vsftpd service to apply the configuration changes:
    sudo service vsftpd restart
  6. Ensure that the FTP server is running and listening on the default FTP port (port 21). You can check the status of the service using the following command:
    sudo service vsftpd status

At this point, you should have a functioning FTP server on your Ubuntu 22.04 system. You can now connect to it using an FTP client software like FileZilla or use the command-line FTP client to transfer files to and from the server.