Setting up FTP Server on Ubuntu – Amazon EC2

File Transfer Protocol (FTP) is a TCP protocol for uploading and downloading files between computers.

Amazon EC2 instance comes without FTP server installed. So you have to install it manually.

Amazon EC2: Unblock FTP port

FTP works on port 21 by default. By default this port is blocked by the AWS firewall. You must unblock this port (21) by changing the instance permissions prior to setting up FTP so that you can access FTP remotely. This can be done using the AWS Management Console.

Go to Security Groups, select the group associated with your instance.

Add TCP rule with port 21.


Install and Configure FTP server – vsftpd

vsftpd is an FTP daemon available in Ubuntu. It is easy to install and set up it. To install vsftpd run the following command:

sudo apt-get install vsftpd


Edit vsftp configuration file (usually located at /etc/vsftpd.conf).


Disable anonymous access:


Enable local access:

By default, local system users are not allowed to login to FTP server. To change this setting, you should uncomment the following line:


Enable writing:

By default, users are allowed to download files from FTP server. They are not allowed to upload files to FTP server. To change this setting, you should uncomment the following line:



Chown user:


chown_username=your user name (! not root)


After you finish configuring FTP server you need to restart it:

sudo service vsftpd restart





8 thoughts on “Setting up FTP Server on Ubuntu – Amazon EC2”

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>