In this tutorial, we will show you how to install FTP Server on AlmaLinux 8. For those of you who didn’t know, FTP which stands for File Transfer Protocol is an application layer protocol that is used in the exchange of data and information between computers on a private network or internet seamlessly by use of an FTP application. Makes use of TCP on the internet. With the use of FTP, one can upload and download data with ease.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of the FTP server on an AlmaLinux 8. You can follow the same instructions for Rocky Linux.
- A server running one of the following operating systems: AlmaLinux 8, CentOS, and Rocky Linux 8.
- It’s recommended that you use a fresh OS install to prevent any potential issues
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install FTP Server on AlmaLinux 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update sudo dnf install epel-release
Step 2. Installing FTP Server on AlmaLinux 8.
Run the command below to install FTP server to your system:
sudo dnf install vsftpd
After that, enable it to allow an auto-start on system boot:
sudo systemctl start vsftpd sudo systemctl enable vsftpd --now
Step 3. Configure the FTP server.
Now we open the configuration file in
/etc/vsftpd/vsftpd.confto start editing:
sudo nano /etc/vsftpd/vsftpd.conf
Edit the specific needs of your environment:
anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES listen=NO listen_ipv6=YES pam_service_name=vsftpd userlist_enable=YES
Save and close the file. Restart vsftpd services to allow changes to synchronize:
sudo systemctl restart vsftpd
Step 4. Configure Firewall.
Open FTP ports in Server Firewall so they can be connected:
sudo firewall-cmd --zone=public --add-service=ftp --permanent sudo firewall-cmd --reload
Step 5. Creating an FTP User.
With the vsftpd FTP server, you have the option to leave the FTP service authentication for only anonymous access or you can allow users, defined in
/etc/passwd or in the relevant access list, to log in.
Create FTP users:
sudo useradd -m ftpuser sudo passwd ftpuser
Next, create an FTP directory then grant necessary permissions and ownership effectively:
sudo mkdir -p /home/ftpuser/ftp_folder sudo chmod -R 750 /home/ftpuser/ftp_folder sudo chown ftpuser: /home/ftpuser/ftp_folder
Step 6. Connect to FTP server via CLI.
First, we install the FTP command-line utility with the following command:
sudo dnf install ftp
You should now be able to connect to your FTP server either by IP address or hostname:
Congratulations! You have successfully installed the FTP server. Thanks for using this tutorial for installing the FTP server on your AlmaLinux 8 system. For additional help or useful information, we recommend you check the official VSFTPD website.