Ugacomp

Step-by-Step Guide to Installing FTP on Ubuntu Server

Where necessary, you may need to have access to a VPS server so you can follow how to implement the steps in this article.  You can get a cheaper VPS Server from Contabo with 4vCPU cores, 8GM RAM, and 32TB Bandwidth for less than $5.50 per month. Get this deal here now

Table of Contents

Cloud VPS S

$5.50 Monthly
  • 4 vCPU Cores | 8GB RAM

CLOUD VPS M

$15.50 Monthly
  • 6 vCPU Cores | 16GB RAM

CLOUD VPS L

$17.50 Monthly
  • 8 vCPU Cores | 24GB RAM

FTP (File Transfer Protocol) is a popular method of transferring files between computers over a network. It is a reliable and secure way to transfer files between computers and is widely used by webmasters and system administrators. In this guide, we will show you how to install and configure FTP on an Ubuntu Server. Please follow the steps below:

Step 1: Update the System

Before we begin, it is important to make sure that our system is up to date. To do this, open a terminal window and run the following command:

sudo apt-get update

This will update the list of available packages and their versions.

RECOMMENDED READING: A Beginner’s Guide to Understanding SSH | Learn from A-Z

Step 2: Install vsftpd

The next step is to install the vsftpd package. This is the FTP server script that we will be using. To install it, run the following command:

sudo apt-get install vsftpd

All the necessary files and dependencies will be installed by executing the above command.

You can check if the vsftpd service is running using the following command:

sudo systemctl status vsftpd 

If it’s running, you should be able to see something like this on your terminal:

Step 3: Add FTP user

FTP users typically have a username and password that they use to authenticate themselves to the FTP server. Once authenticated, they can navigate the server’s directory structure, upload files from their local machine to the server (put), download files from the server to their local machine (get), delete files, and perform other file management operations.

RECOMMENDED READING: How to Easily Create and Add Users in Linux

After the vsftpd package is installed, you will need to create a new user for the FTP server. To do this, type the following command into the terminal window and press enter:

sudo adduser ftpuser

Change ftpuser to your preferred username you would want to use for FTP

Next, you will need to set a password for the new user. To do this, type the following command into the terminal window and press enter:

sudo passwd ftpuser

RECOMMENDED READING: How to use Alibaba Cloud Free credit to Set up an Ubuntu server

Step 4: Configure vsftpd

The main configuration file for vsftpd is usually named vsftpd.conf. This file contains various settings that control the behavior of the vsftpd server. The typical location for the vsftpd configuration file is in the /etc directory, so the full path might be /etc/vsftpd.conf. However, the exact location can vary depending on the Linux distribution and how it is configured.

Back up the vsftpd configuration file

To avoid facing problems if we mess up, it’s important that we first back up the vsftpd configuration. This means that we need to replicate it with a backup copy. So, our back version, in this case, will be vsftpd.backedup. On your SSH terminal, you can run the following command to execute the backup:

sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.backedup

Backing up the vsftpd file will enable you to restore to the default configurations if anything goes wrong when you edit it.

Edit the vsftp configuration file

You can use a text editor to open and edit the vsftpd configuration file. Here’s an example using the nano text editor:

sudo nano /etc/vsftpd.conf

In the configuration file, you will need to set the following parameters:

anonymous_enable=NO

local_enable=YES

write_enable=YES

chroot_local_user=YES

allowed_writeable_chroot=YES

#Enable Passive FTP

pasv_min_port=35000
pasv_max_port=40000

# Allow only authorized users to log in to the FTP server.

userlist_enable=YES

# Add the user to the vsftpd.userlist to allow a specific user 
# to use the system login account to access your FTP service.
userlist_file=/etc/vsftpd.userlist

# NO - anyone can log in with an anonymous account.
# YES - the user will be denied to login when their name exists in this file. 

userlist_deny=NO

Once you have set the parameters, save the file and exit the editor.

Step 5: Restart vsftpd

Once the configuration is complete, we need to restart the vsftpd service. To do this, run the following command:

sudo systemctl restart vsftpd

This will restart the service and apply the new configuration.

Step 6: Configure ufw firewall to allow FTP

UFW, or Uncomplicated Firewall, is a user-friendly frontend for managing iptables on Ubuntu systems. It provides an easy way to configure a firewall and allows users to set up rules to control incoming and outgoing traffic. This guide will walk you through the steps of setting up UFW to allow all FTP ports on Ubuntu.

RECOMMENDED READING: How to open Ant Media Ports through the Firewall?

Install UFW.

Before you can begin setting up UFW, you must first install it. To do this, open a terminal window and enter the following command:

sudo apt-get install ufw

Enable UFW.

Once UFW is installed, you must enable it. To do this, enter the following command:

sudo ufw enable

Allow FTP ports.

To allow all FTP ports, enter the following command:

sudo ufw allow ftp

Check the status of UFW.

To check the status of UFW, enter the following command:

sudo ufw status

This will display a list of all the rules that have been set up. You should see the rule that you just added to allow FTP ports.

Reload UFW.

To apply the changes that you have made, you must reload UFW. To do this, enter the following command:

sudo ufw reload

RECOMMENDED READING: How to deploy WordPress on a Ubuntu LAMP Server

Step 7: Connect to FTP

There are several ways to connect to your FTP server. But the most common way is to use an FTP client software like FileZilla, WinSCP, and more

Connect using FileZilla

Connecting to an FTP server using FileZilla Client is a simple process that can be completed in a few steps.:

  • Download and install FileZilla Client. FileZilla Client is a free, open-source FTP client that can be downloaded from the FileZilla website. Once the download is complete, run the installer to install the program.

  • Launch FileZilla Client. Once the program is installed, launch FileZilla Client.

  • Enter the FTP server information. In the “Host” field, enter the address of the FTP server you wish to connect to. In the “Username” and “Password” fields, enter the credentials for the FTP server.

  • Connect to the FTP server. Once the information is entered, click the “Quickconnect” button to connect to the FTP server.

  • Transfer files. Once connected, you can transfer files to and from the FTP server by dragging and dropping them into the appropriate folders.

And that’s it! You have now successfully installed and configured FTP on your Ubuntu Server.

More related articles to explore

Hire us to handle what you want

Hire us through our Fiverr Profile and leave all the complicated & technical stuff to us. Here are some of the things we can do for you:

  • Website migration, troubleshooting, and maintenance.
  • Server & application deployment, scaling, troubleshooting, and maintenance
  • Deployment of Kubernetes, Docker, Cloudron, Ant Media, Apache, Nginx,  OpenVPN, cPanel, WHMCS, WordPress, and more
  • Everything you need on AWS, IBM Cloud, GCP, Azure, Oracle Cloud, Alibaba Cloud, Linode, Contabo, DigitalOcean, Ionos, Vultr, GoDaddy, HostGator, Namecheap, DreamHost, and more.
 

We will design, configure, deploy, or troubleshoot anything you want. Starting from $10, we will get your job done in the shortest time possible. Your payment is safe with Fiverr as we will only be paid once your project is completed.