In this article, we will have explained the necessary steps to install FTP Server on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
FTP is a client server protocol that allows two communication channels between client and server. Using a FTP client we will be able to upload, download, and delete the files on the server. Initially, the client needs to authenticate the FTP server. The FTP session will work on both passive and active modes. Active is the default mode for FTP. In active mode connection, when the client starts to make the initial connection, the server initiates the second connection and enables data transferring to the client. In passive connection, the client connects and sends the PASV command to the server. Then the server sends the port number to the client.
Install FTP Server on Ubuntu
Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.
sudo apt update sudo apt upgrade
Step 2. Installing FTP Server on Ubuntu 18.04 LTS.
The VSFTP daemon is found in the standard repositories, so installation can be pulled off with a single command. Open a terminal window and issue the following:
sudo apt install vsftpd
After installing VSFTPD, the commands below can be used to stop, start and enable the server service to always start up when the server boots:
sudo systemctl stop vsftpd.service sudo systemctl start vsftpd.service sudo systemctl enable vsftpd.service
Step 3. Configuring vsftpd.
We’re going to create a brand new configuration file. Before we do that, let’s rename the original with the command:
sudo mv /etc/vsftpd.conf /etc/vsftpd.conf.orig
Create the new file with the command:
listen=NO listen_ipv6=YES anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES use_localtime=YES xferlog_enable=YES connect_from_port_20=YES chroot_local_user=YES secure_chroot_dir=/var/run/vsftpd/empty pam_service_name=vsftpd rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key ssl_enable=NO pasv_enable=Yes pasv_min_port=30000 pasv_max_port=30100 allow_writeable_chroot=YES
That’s all you need to do to install FTP Server on Ubuntu 18.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.