Use FTP on a Linux server to easily transfer files between your local machine and remote servers. FTP, or File Transfer Protocol, is a standard network protocol that allows uploading, downloading, and managing files across computers via a network.

This guide will walk you through how to use FTP on a Linux server—including installing an FTP server, configuring users, setting up security, and connecting with FTP clients.
Prerequisites
- A Linux server running Ubuntu, Debian, CentOS, Red Hat, or similar distributions.
- Root or sudo privileges are required to install and configure the FTP server.
- Terminal access to run commands on your Linux server.
- A basic understanding of networking and the Linux command line is helpful.
Use FTP on the Linux Server
Using FTP (File Transfer Protocol) on a Linux server allows you to transfer files between systems securely and efficiently. It is commonly used for website file management, server maintenance, and remote backups. Linux supports various FTP server and client applications, such as vsftpd, ProFTPD, and FileZilla, making it easy to set up and manage FTP access for users with varying levels of control and security. Whether you’re a sysadmin or developer, FTP provides a reliable solution for handling file operations remotely.
Install FTP Server (vsftpd)
The most popular and secure FTP server for Linux is vsftpd (Very Secure FTP Daemon). Start by installing it using your package manager.
- On Ubuntu/Debian:
sudo apt update sudo apt install vsftpd
- On CentOS/Red Hat:
sudo yum update sudo yum install vsftpd
Once installed, check the vsftpd service status:
sudo systemctl status vsftpd
If it’s not running, start and enable it:
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
Configure FTP Server
Before modifying, back up the default configuration file:
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf_backup
Open the config file for editing:
sudo nano /etc/vsftpd.conf
Here are common settings to check or add:
- Allow local users to log in:
local_enable=YES
- Enable file uploads:
write_enable=YES
- Chroot local users to their home directories (for security):
chroot_local_user=YES
- Optional: Enable passive mode (helps with firewall traversal):
pasv_enable=YES pasv_min_port=10000 pasv_max_port=10100
Save and close the file. Then restart vsftpd to apply changes:
sudo systemctl restart vsftpd
Create FTP User
If you want a dedicated FTP user, create one and set a password:
sudo useradd -m ftpuser
sudo passwd ftpuser
The user’s home directory will be the FTP root folder. You can adjust ownership or permissions as needed.
Configure the Firewall to Allow FTP Traffic
FTP uses ports 20 and 21 for connections, plus a range for passive mode.
- On Ubuntu/Debian with UFW firewall:
sudo ufw allow 20/tcp sudo ufw allow 21/tcp sudo ufw allow 10000:10100/tcp sudo ufw reload
- On CentOS/Red Hat with firewalld:
sudo firewall-cmd --permanent --add-port=20/tcp
sudo firewall-cmd --permanent --add-port=21/tcp
sudo firewall-cmd --permanent --add-port=10000-10100/tcp
sudo firewall-cmd --reload
Connect to Your FTP Server
You can now connect to your FTP server using an FTP client.
- From a Linux terminal:
ftp your_server_ip
Enter the username and password when prompted.
- Using graphical clients like FileZilla, enter your server IP, username, and password into the client to connect and transfer files securely.
Basic FTP Commands
Once connected via FTP command line, common commands include:
Command | Description |
---|---|
ls | List files and directories |
cd | Change directory |
get filename | Download a file |
put filename | Upload a file |
pwd | Print working directory |
bye | Disconnect from FTP server |
Conclusion
To use FTP on a Linux server, install a secure FTP server like vsftpd, set up user access and permissions, configure your firewall to allow FTP traffic, and connect using your preferred FTP client. While FTP is convenient for file transfers, note that it is not encrypted; for sensitive data, consider SFTP or FTPS, which offer encrypted alternatives. Using FTP on Linux remains a simple and effective solution for many file-sharing needs within trusted environments.