Quick and easy FTP server install on a Raspberry Pi

For this setup, i’m using Ubuntu 16.04 running on a Raspberry Pi 3. The instructions should work correctly in Debian and Raspbian too – in fact, you will probably have luck using these instructions on any Linux operating system, Raspberry Pi or not.

Note: FTP is not a secure protocol, I would recommend using SFTP for production environments.

  1. Login to SSH with root or a user which has sudo permissions. The default Raspberry Pi pi user should be okay.
  2. Update packages:

    sudo apt-get update
  3. Create a new user, used only for FTP connections:

    sudo adduser ftp-user

    Enter a password of your choice.

  4. Create a folder in /root. This is where the USB HDD will be permanently mounted.

    sudo mkdir /usb-hdd-storage
  5. Mount the USB HDD to this folder, this assumes your USB HDD is formatted as NTFS. Firstly check to see the partitions available on the USB HDD drive:

    sudo blkid

    This should output the USB HDD’s label, keep a note of this.

  6. Check the boot name of the USB HDD’s partition:

    sudo fdisk -l
  7. Now we know where our drive is, we need to mount it to the /usb-hdd-storage folder we created previously:

    sudo mount /dev/sdaX /usb-hdd-storage

    You may need to replace X with your drive ID. This can be found from the ‘blkid’ command.

    You’ll also have to set permissions to ensure the drive can be accessed properly:

    sudo chmod 775 /usb-hdd-storage
  8. To make the USB HDD mount permanently, edit the ‘fstab’ file:

    sudo nano /etc/fstab

    Add this line to the bottom of the file:

    /dev/sdaX /usb-hdd-storage ntfs defaults 0 0

    As before, replace X with your drive ID.

    Note: If you need to unmount the drive, run:

    sudo umount /usb-hdd-storage
  9. Create a folder in the ‘ftp-user’ home directory, this will be used in the next step to ‘bind’ to the folder we created in /root/usb-hdd-storage:

    sudo mkdir /home/ftp-user/usb-hdd-storage
  10. Perform a bind to where the USB HDD is mounted. Edit the ‘fstab’ file so this bind is permanent:

    sudo nano /etc/fstab

    Add this line to the bottom of the file, it should be below the line which was added in the previous step:

    /usb-hdd-storage /home/ftp-user/usb-hdd-storage none bind 0 0
  11. Now change the ownership of this folder to the ‘ftp-user’ user:

    sudo chown ftp-user:ftp-user /home/ftp-user/usb-hdd-storage
  12. Install proFTPd:

    sudo apt install proftpd

    Choose to run proFTPd as standalone.

  13. Now edit the proFTPd configuration file:

    sudo nano /etc/proftpd/proftpd.conf

    Change the TimeoutIdle value to 60. This is 60 seconds.

    And uncomment DefaultRoot so users are ‘jailed’ to their home directories, they will still be able to access files on the USB HDD because of the ‘binded’ folder we created.

  14. Reload the proFTPd service to pick-up the changes made in the configuration file:

    sudo service proftpd reload
  15. You can now reboot the operating system and test the connection in a FTP program, such as FileZilla.

    sudo shutdown -r now

    Or to shutdown, run:

    sudo shutdown -h now


Joe G Rodriguez
  • October 24th, 2018


This is the First Raspberry Pi 3 FTP Server that loaded with no Errors. I really Appreciate the USB Hard Drive Load addition.
I just hope I can Figure out how to Send Data from a Security Camera to this Server???



Joe G Rodriguez
  • October 24th, 2018

I did everything as stated on this page. When I logged in FileZilla I Typed in My IP (I did not anything in front of the IP) FileZilla Put in (sftp:// User Name: Pi and my: Password. I left Port: Blank.
I get a listing but I can’t find the HDD???
All the Folders have ? marks in the Folders.
Can you help?

  • October 25th, 2018

Hi Joe, Did you change directory to the HDD mount point? In my case, the mountpoint was stored as ‘usb-hdd-storage’ within the ‘ftp-user’ home directory. Your setup might be different, but if you followed the tutorial exactly, you should be able to transfer files to the HDD in FileZilla by changing directory to this location: /home/ftp-user/usb-hdd-storage

Joe Rodriguez
  • October 29th, 2018

Ryan thanks for the reply. I’m going to start all over again with a new Raspbian System. I just had Surgery so I lost a few Days and I’m not supposed to sit at the Computer very Long. But, I just have to try again. I will follow everything exactly as you have it. You have my email. I wish I could get yours so I can get this right.
For your information I’m trying to set the Raspberry Pi 3 with 1tb Western Digital Ultra up as an FTP Server for Security Camera.

San Antonio, TX

Joe G Rodriguez
  • October 30th, 2018

I just reloaded everything as per your instructions. I’m using Filezilla on a Windows 10 64 Desktop. Everything looked like loaded right except for the New Version of ProFTPD does not ask for Standalone.
Now how do I login to Filezilla My address if do I need anything infront of the IP? What do login with FTP-user or Pi or what? I guess my password is the one I used?


Joe G Rodriguez
  • October 30th, 2018

Ryan – I logged in to Filezilla with my IP and My Password.
Status: Connecting to…
Status: Connection established, waiting for welcome message…
Status: Insecure server, it does not support FTP over TLS.
Status: Logged in
Status: Retrieving directory listing…
Status: Directory listing of “/” successful
Status: Retrieving directory listing of “/usb-hdd-storage”…
Command: CWD /usb-hdd-storage
Response: 550 /usb-hdd-storage: No such file or directory
Error: Failed to retrieve directory listing
Status: Retrieving directory listing of “/usb-hdd-storage”…
Command: CWD /usb-hdd-storage
Response: 550 /usb-hdd-storage: No such file or directory
Error: Failed to retrieve directory listing
Status: Connection closed by server
Can you email me so I can fix this. You have my Email. I have screen captures of everything I did.


  • October 30th, 2018

Hi Joe,

Looks like it is logging in properly, but seems the issue is with the USB HDD mountpoint. Have you created the ‘usb-hdd-storage’ in the root? If so, re-try the steps to mount your hard drive to this folder. If it’s still not working, then unfortunately i’m not sure. I tested this myself when I wrote the post on Raspberry Pi 3 and it worked perfectly.

Joe G Rodriguez
  • October 31st, 2018

I don’t know if this shows where the HD is mounted but let me know what to type to find out?
[email protected]:~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 30G 4.5G 24G 17% /
devtmpfs 460M 0 460M 0% /dev
tmpfs 464M 0 464M 0% /dev/shm
tmpfs 464M 13M 452M 3% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 464M 0 464M 0% /sys/fs/cgroup
/dev/mmcblk0p1 41M 22M 19M 54% /boot
/dev/sda1 932G 205M 932G 1% /usb-hdd-storage
tmpfs 93M 0 93M 0% /run/user/1000

  • November 3rd, 2018

Looks like your hard drive is mounted, I can see 900gb. Have you tried either the pi or FTP user for logins?

My Raspberry Pi – VIRTUAL DAN
  • February 14th, 2020

[…] the most difficult, as there are a couple FTP packages supported by Raspian.  But thanks to Ryan Fitton’s post I got it to […]

Douglas Luton
  • March 21st, 2020

I keep getting the ECONNREFUSED error in filezilla, I double checked, the port is set to the correct port in SFTPD.conf, I can’t seem to figure out why it’s denying me.

  • March 21st, 2020

Hi Douglas,

Are you getting this error when trying to connect from inside your network to the Pi’s IP address? Or is this happening when connecting externally via your WAN address?

Sometimes Internet providers will block ports even if you have opened them on your router.

  • March 21st, 2020

inside I could connect, then I tried again from outside this morning and I was able to get in, I’m guessing Gremlins………

Thank you for the response.

  • April 16th, 2020

How would I substitute SFTP for FTP?

  • April 16th, 2020

Hi Doug, This post is based on using FTP. If you want to use SFTP instead, you should be able to setup a new user, then connect to the server via it’s SSH port.

For more info on how to setup SFTP, checkout this article: https://www.techrepublic.com/article/how-to-set-up-an-sftp-server-on-linux/

  • June 10th, 2020

Hi, how can i activate FTPS?

  • June 10th, 2020

Hello, This tutorial doesn’t go into those details. May I suggest to try this tutorial instead: https://www.tecmint.com/secure-ftp-server-using-ssl-tls-on-ubuntu/amp/

  • June 10th, 2020

thnx for your fast answer but the procedure than you give me don’t work for raspberrypi 🙁

  • June 10th, 2020

Ah, i’m not sure then. Maybe best for you to see if your question has already been covered in the official RPi forum: https://www.raspberrypi.org/forums/ – they’re a friendly bunch 🙂

  • August 18th, 2020

If I want to mount 2 usb drives both to my ftp, is it as simple as adding a repeat of this line /dev/sdaX /usb-hdd-storage ntfs defaults 0 0 to fstab?

  • August 18th, 2020

Hi Matt, I was testing this last week with my own setup. Yes pretty much, however you would want to mount the disk as a child directory, e.g. /usb-hdd-storage/disk-01 and /usb-hdd-storage/disk-02

Then share /usb-hdd-storage/ in the vsftpd config file, and also make this the home directory of your user.

Dayverton dos Santos Marques
  • July 10th, 2021

Goodnight !
I managed to perform all the steps and access the EXTERNAL HD directory, the problem is that I don’t have write permission. Can anybody help me?

  • July 12th, 2021

Hello, you should be able to fix your permissions by setting the user and folder permissions with ‘chown’, e.g. sudo chown ftp-user:ftp-user /your_directory_path_here/

Dayverton Marques
  • July 19th, 2021

Ryan, thank you very much managed to resolve here.
Your tutorial was the best I found so far.

I used this tutorial to create an ftp server where captured images of a work are being stored to create a timelapse. The project went well thanks to the knowledge that was passed on by you.

Simply, thank you very much!

Post a Comment