Ubuntu 16.04 LTS – How to Install and Configure vsFTPd on Ubuntu

FTP is used to transfer files from one host to another over TCP network. This article explains how to setup FTP server on ubuntu 16.04. There are 3 popular FTP server packages available PureFTPd, VsFTPD and ProFTPd. Here i’ve used VsFTPD which is most secure. I’ll be logged in as root.

Setup vsFTPd server on Ubuntu 16.04

Step 1 – Update repositories.

root@mail:/# apt-get update
root@mail:/# apt-get upgrade

Step 2 – Install VsFTPD

root@mail:/# apt-get install vsftpd

Step 3 – Backup config file

root@mail:/# cp /etc/vsftpd.conf /etc/vsftpd.conf.backup

Step 4 – Open config file with follow command.

root@mail:/# nano /etc/vsftpd.conf

Step 5 – Configration of vsFTPd file – Open /etc/vsftpd.conf file and search with Ctrl+W and make changes as it is shown below. Remove commends if they exist or add missing line.


Step 6 – Configration of vsFTPd file – Allow access only for certain users.


Step 7 – Create /etc/vsftpd.allowed_users

touch /etc/vsftpd.allowed_users

Step 8 – Include users who should have access in /etc/vsftpd.allowed_users


Step 9 – If you want, you can make Advanced Configuration

#Useful to not write over hidden files:

#Hide the info about the owner (user and group) of the files.

#Maximum number of clients:

#Connection limit for each IP:

#Chnage listen port from 21 to other

Step 10 – Add ftp user and change home directory for this user. This is very important because you will restrict the user to access to one directory. You can allow access to /var/www/ and the user will have access to all folders on your sites or choose to access to only one site. For example if you want to create ftp user and to allow him to access to only one site, write the following commands. And don’t forget to add new user in /etc/vsftpd.allowed_users

root@mail:/# adduser ftp
root@mail:/# usermod –home /var/www/YOURFOLDERSITE ftp

or open this file /etc/passwd and search user which you want to change home directory. Change /home/ftpuser with /vat/www.

root@mail:/# nano /etc/passwd
root@mail:/# ftpuser:x:1001:1001:FTP USER,,,:/var/www:/bin/bash

Step 11 – Restart vsFTPd – You must restart vsFTPd service for the changes to take effect. Now when user connect via ftp with filezilla he will see only one folder from your sites.

root@mail:/# systemctl restart vsftpd

If you want to see output from command you ca execute this command /etc/init.d/vsftpd restart

Step 12 – Show vsftpd status with systemctl status vsftpd

Step 13 – Configuration of permissions – If you want everybody to have a permission to write in this folder, you have to set full permission 777. If you want only the ftp group to have permission to write and everyone else to have permission only to read, you have to set a permission 775.

root@mail:/# chmod 777 -R /var/www/YOURFOLDERSITE
root@mail:/# chown ftp:ftp -R /var/www/YOURFOLDERSITE

6 ThemeHow to install and configure SSH on Ubuntu (Server) 14.04 LTS Step-by-Step

Leave a Reply

Your email address will not be published. Required fields are marked *