This guide shows you how to install an FTP server on an Ubuntu server and connect to it securely using an FTP client. Learn how to configure and access your server using FTP for efficient file management and transfers.
25 min
Edited:15-09-2024
FTP (File Transfer Protocol) is a simple and widely-used protocol for transferring files between a client and a server. This guide will walk you through installing an FTP server on your Ubuntu server and connecting to it from your local machine. We'll be using vsftpd (Very Secure FTP Daemon), a popular FTP server known for its stability and security.
What you should have before we start
SSH connection
A user with sudo privileges
FTP client software on your local machine ( FileZilla or command-line FTP client)
You can check how to access the server with ssh following this guide
Before installing the FTP server, update your package list to ensure you're installing the latest versions of the packages:
1. sudo apt update
To install the vsftpd FTP server on your Ubuntu server, use the following command:
1. sudo apt install vsftpd
Below the commands will allow you to start the FTP service and enable it on startup:
1. sudo systemctl start vsftpd
2. sudo systemctl enable vsftpd
Verify the vsftpd installation with the command:
1. sudo systemctl status vsftpd
By default, vsftpd is configured to allow anonymous access, which is not recommended for production environments. You need to modify its configuration to ensure secure access.
Open the vsftpd configuration file for editing: with the command:
1. sudo nano /etc/vsftpd.conf
Disable anonymous access by finding and changing the following line:
1. anonymous_enable=NO
Enable local users to log in by ensuring this line is present:
1. local_enable=YES
Allow file uploads and modifications:
1. write_enable=YES
To secure the FTP connection with SSL, uncomment and set the following lines (if you have SSL certificates set up):
1. ssl_enable=YES
2. rsa_cert_file=/path-to-cert-file
3. rsa_private_key_file=/path-to-key-file
Once you've made the necessary changes, save and close the file (press Ctrl+X, then Y, then Enter).
Then you will need to restart the vsftpd service to apply the change, to do that run the command:
1. sudo systemctl restart vsftpd
If you have a firewall (like UFW) enabled, you’ll need to allow FTP traffic. Run the following commands to open the necessary ports:
1. sudo ufw allow 20/tcp
2. sudo ufw allow 21/tcp
Now that vsftpd is running, you can connect to the FTP server from an FTP client. Below are instructions for two common methods:
Using an FTP client like FileZilla
Connect via Command Line (Linux/macOS)
With FileZilla, Download and install FileZilla on your local machine
Open FileZilla and enter the following details Open FileZilla and enter the following details
Host: Your server’s IP address (or domain)
Username: Your server’s username (e.g., user1)
Password: The password for that user
Port: 21 (default FTP port)
Click Quickconnect to connect to the server.
Connect via Command Line (Linux/macOS), you can use the command below to connect to FTP:
1. ftp server_ip
The simple commands on FTP are to upload and download the files with the commands put (to upload) and get (to download):
1. put local_file_name
2. get remote_file_name
You’ve successfully installed an FTP server on your Ubuntu machine, configured it for secure access, and connected to it using an FTP client. With these steps, you can efficiently manage files on your server using FTP while ensuring security.
What's Next
14-10-2024
This article offers a detailed guide on installing and configuring IPTables on an Ubuntu VPS. IPTables is a powerful firewall tool that helps secure your server by controlling inbound and outbound traffic. Learn how to set up rules for traffic filtering, configure basic security policies, and apply custom rules to protect your VPS.
IPtables
security
12 min
This article offers a comprehensive guide on installing and configuring ModSecurity, a powerful web application firewall (WAF), on an Ubuntu VPS. Learn how to secure your server by filtering and monitoring HTTP requests, set up ModSecurity with Nginx or Apache, and apply rules to protect against common web attacks.
Modsecurity
security
10 min
14-10-2024
This article provides a comprehensive guide on installing and configuring PHP-FPM (FastCGI Process Manager) on an Ubuntu VPS. Learn how to optimize PHP performance for your web applications by configuring PHP-FPM with Nginx or Apache, managing pools, and fine-tuning settings for efficient processing of PHP scripts.
PHP-FPM
speed
optimise
12 min