Home Linux FiX: Install FTP On Ubuntu

FiX: Install FTP On Ubuntu

How to install FTP Server on Ubuntu??

In this article, I will show you step by step how to install, configure, and secure FTP server. Step by step commands are given below:

RECOMMENDED: How to install FTP server on CentOS 7

Install FTP on UbuntuInstall FTP on Ubuntu

STEP 1: Install FTP Package

# sudo apt-get install vsftpd
Install FTP package on UbuntuInstall FTP package on Ubuntu


By default Ubuntu firewall i.e. UFW is inactive. If it is activated then allow the FTP traffic through it.

# sudo ufw allow 20/tcp 
# sudo ufw allow 21/tcp
# sudo ufw status

Step 3:

Backup the original configuration file of FTP server to restore in stuck situation.

cp /etc/vsftpd.conf /etc/vsftpd.orig.conf

Step 4 :

Disable the anonymous login for the security reasons. And allow the local users to log in to their home directory.


Edit the vsftpd.conf fileEdit the vsftpd.conf file

Next step is to start the vsftpd service.


# service vsftpd start
# service vsftpd status


Now, Jail the FTP user into the home directory. For this uncomment the following line under /etc/vsftpd.conf. Also, add the line allow_writeable_chroot=YES, allow the Jailed user to write into their directory.

chroot_local_user=YES [uncomment this line]
allow_writeable_chroot=YES [Add this line]

Step 7:

If want to create FTP user with custom home directory, run the following commands.

# sudo useradd -m -d /var/ftp/pub -s /usr/sbin/nologin arun
# sudo passwd arun

Now, when FTP user arun will login to FTP he would be landed in /var/ftp/pub directory.

Step 8:

Final step is to browse the ftp server. Open the browser and just type ftp://server-ip.

FTP loginFTP login

From Command Line:

# ftp

FTP login from command lineFTP login from command line



Please enter your comment!
Please enter your name here