Skip to content

Enabling FTP on Ubuntu 22.04 LTS

ftp

Install the FTP server. For this example, we'll use vsftpd, a popular and secure FTP server.

Set Up an FTP Server

Bash
# Update package lists
sudo apt update

# Install the FTP server
sudo apt install vsftpd

# Start and enable the FTP service
sudo systemctl start vsftpd
sudo systemctl enable vsftpd

Configure the FTP Server

Edit the vsftpd configuration file:

Bash
sudo vim /etc/vsftpd.conf #(:i)

Adjust the following settings:

Text Only
# Disable Anonymous Access
anonymous_enable=NO

# Allow Local Users to Log In
local_enable=YES

# Enable File Uploads
write_enable=YES

# Restrict Users to Their Home Directories
chroot_local_user=YES

Save the file and exit (:wq).

Restart the FTP Service

Apply the changes by restarting the service:

Bash
sudo systemctl restart vsftpd

Configure the Firewall (if applicable)

Allow FTP traffic through the firewall:

Bash
sudo ufw status
sudo ufw allow 21/tcp

Test the FTP Connection

Use an FTP client or the command-line tool to test the connection:

Bash
ftp <server_ip_address>

Replace <server_ip_address> with your server’s IP address.

Or using the FTP client: FileZilla Client