How to Build a FTP Server on Raspberry Pi using VSFTPD

Photo by Negative Space on Pexels.com

Hello everyone, welcome to my Linux tutorial. Today we are going to learn about Raspberry Pi stuff. The following tutorial will guide you how to build a FTP Server on Raspberry Pi using VSFTPD. This article is based on Raspbian operating system. If you have different OS installed on your Raspberry Pi, this tutorial might not for you. Raspbian is a Debian based operating system build for Raspberry Pi device. It is a great OS which is stable and easy to use.

I am not going to cover how to install Raspbian on Raspberry Pi. You may googling for this article if you need it. There are many websites that explain in depth how to install Raspbian on Pi.

Article you might like:

Steps to Build FTP Server on Raspberry Pi

Step 1. Install Raspbian on Raspberry Pi

This step is well described on this article. Please refers to the article to install and configure your Raspbian.

Step 2. Install VSFTPD

We need to install vsftpd package on Raspbian. Execute this command to update and install vsftpd

apt update
apt install vsfptd

Step 3. Update vsftpd configuration

Now, lets change some settings.

nano /etc/vsftpd.conf

Now find the following lines and uncomment it by removing the # next to it.

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
chroot_local_user=YES

Now add the following lines to the end of the vsftpd.conf file.

user_sub_token=$USER
local_root=/home/$USER/ftp

Restart vsftpd

systemctl restart vsftpd

Step 3. Create New User

useradd fitri

Step 4. Create FTP directory for fitri user

Please change fitri with your new FTP user

mkdir /home/fitri/ftp
mkdir /home/fitri/ftp/files
chmod a-w /home/fitri/ftp
adduser fitri sudo

Step 5. Change FTP port (optional)

Optionally, you can change the ftp port. Simply add the following line to vsftpd.conf file

listen_port=2021

This line will change the ftp listening port to 2021.

Step 6. Test the FTP Server

Now let’s test our new server from other computer. I use Rush FTP client from Windows machine

ftp server raspbian

That’s it. Now we can connect to our FTP Server on Raspberry Pi. Thank you for reading and stay classy.

Be the first to comment

Leave a Reply