Close Menu
    Facebook X (Twitter) Instagram Pinterest YouTube
    Trending
    • Disable SSH Password Login on Raspberry Pi
    • Elecrow Meteor IPS Touchscreen with RGB LEDs
    • Pi Pico Pinout Display on the Command Line
    • How to Add a Raspberry Pi Pico Reset Button
    • Pi Pico Onboard LED
    • Pi Pico W Pinout and Power Pins
    • CrowPi L Raspberry Pi Laptop and Learning Platform
    • Pi Pico W Launched
    Mastodon YouTube Facebook Instagram Pinterest RSS
    Raspberry Pi SpyRaspberry Pi Spy
    • Home
    • Categories
      • General
      • Hardware
      • Programming
      • Python
      • Software
      • Tutorials & Help
    • BerryClip
      • BerryClip Instructions
      • BerryClip Plus Instructions
      • Videos & Reviews
    • Buy
      • Buy Pi
      • Buy Pi Accessories
      • Buy Books
    • Tools
      • Ultimate Raspberry Pi Alexa Skill
      • Pi Power Estimator App
      • Pi-Lite 14×9 LED Matrix Sprite Editor
      • RPiREF Pin-out Reference App
      • Simple Ohm’s Law Calculator
      • Web Sites & Links
    • Tutorials & Help
        Featured
        November 9, 20200

        Raspberry Pi Temperature Monitoring

        Recent
        February 16, 2024

        Disable SSH Password Login on Raspberry Pi

        December 23, 2022

        How to Add a Raspberry Pi Pico Reset Button

        November 20, 2022

        Pi Pico Onboard LED

      1. Contact Us
      2. Site Map
      Raspberry Pi SpyRaspberry Pi Spy
      You are at:Home»Tutorials & Help»Creating a Simple FTP Server with a Raspberry Pi
      Raspberry Pi FTP Server

      Creating a Simple FTP Server with a Raspberry Pi

      3
      By Matt on May 13, 2018 Tutorials & Help

      Although FTP (File Transfer Protocol) is an old technology it is still used by lots of systems and hardware devices. Some IP cameras allow you to save photos to an FTP server and you can create one using a Raspberry Pi. If you’ve got the choice you would be better using SFTP but if your device only supports FTP then this guide will help you create an FTP server.

      We will use vsftpd as it is a popular Linux appication that is secure, stable and extremely fast.

      Initial Setup

      You will need :

      • A Raspberry Pi
      • SD card with latest Raspbian image
      • Power supply
      • Keyboard and Monitor (optional)

      Start off with a fresh SD card containing the latest Raspbian image. The How to Create a New SD Card for Raspberry Pi on Windows guide will explain how to do this on Windows. Setup your Pi and get it connected to your network using Ethernet or WiFi. If you want to do the FTP setup remotely then follow this guide to enable SSH.

      Obtain the network IP address using :

      ifconfig

      It will most probably be of the form 192.168.###.###.

      Step 1 – Install vsftpd

      Use the following command to update your repositories and install the vsftpd software :

      sudo apt-get update
      sudo apt-get install vsftpd

      Step 2 – Update Configuration File

      Once installed you can now edit the vsftpd configuration file using :

      sudo nano /etc/vsftpd.conf

      In this file find the following lines and un-comment them by deleting the # character :

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

      Add the following lines to the end of the file :

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

      Save and exit using CTRL-X, Y and ENTER.

      Step 3 – Create FTP Directory for Pi User

      To allow you to connect to the FTP server using the default Pi user we need to create a few directories :

      mkdir /home/pi/ftp
      mkdir /home/pi/ftp/files

      Change the permissions on the ftp directory using :

      chmod a-w /home/pi/ftp

      Step 4 – Create New User (optional)

      If you want to log into the server with another user name we can create a new user. In this example we’ll create a new user called “camera” :

      sudo adduser camera

      You will be prompted for a password. Make sure it is a good one!

      The other details can be left blank or populated as you see fit.

      You should see something like this on your screen :

      Create new user

      This new user will also need a set of FTP directories :

      mkdir /home/camera/ftp
      mkdir /home/camera/ftp/files

      Once created change the permissions using :

      chmod a-w /home/camera/ftp

      This isn’t required for basic file transfer but the new user can be given the same ability to use “sudo” by running the command :

      sudo adduser camera sudo

      Step 5 – Restart FTP Server

      Finally restart the vsftpd service so that our changes take effect :

      sudo service vsftpd restart

      Step 6 – Test FTP Server

      All that remains is to check you can connect to the server and transfer files.

      Get your Pi’s IP address using :

      ifconfig

      Run your preferred FTP client on your PC/laptop. Windows users can use WinSCP. Windows, Mac or Linux users can use FileZilla. If you have been connecting to the command line via SSH you maybe able to use the same client for FTP.

      To connect in your client you provide the host name (IP address) of your Pi, the user name (e.g. pi or camera) and the password. Ensure it is set to use the FTP protocol and port 21.

      Here is the WinSCP site manager :

      Pi FTP Server Connect

      Here is a screenshot of WinSCP connected to my Pi using the “camera” user name.

      WinSCP FTP Client

      Navigate into the “files” directory and you should be able to transfer files into it. If this works your FTP server is ready for whatever devices you wish to connect.

      FTP Session Logs

      You can check the vsftpd session logs to see a history of connections made to your FTP server.

      cat /var/log/vsftpd.log

      Further Reading

      There is a full list of vsftpd configuration file options here:
      https://security.appspot.com/vsftpd/vsftpd_conf.html

      File Transfer Protocol (Wiki) :
      https://en.wikipedia.org/wiki/File_Transfer_Protocol

      Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
      Previous ArticleA Look at the RasPad Raspberry Pi Tablet
      Next Article CrowPi Portable Raspberry Pi Projects Kit

      Related Posts

      Disable SSH Password Login on Raspberry Pi

      How to Add a Raspberry Pi Pico Reset Button

      Pi Pico Onboard LED

      3 Comments

      1. Dick on May 6, 2019 3:11 pm

        Give error:
        Need to add in the conf file

        allow_writeable_chroot=YES

        Reply
      2. wrbrower on August 20, 2020 4:32 am

        Appreciate the write-up. Thanks

        Reply
      3. Finley Hunter on April 21, 2021 6:28 am

        Thanks for sharing this great article creating a simple ftp server with a raspberry pi with us.

        Reply
      Leave A Reply Cancel Reply

      This site uses Akismet to reduce spam. Learn how your comment data is processed.

      Recent Posts
      February 16, 2024

      Disable SSH Password Login on Raspberry Pi

      March 13, 2023

      Elecrow Meteor IPS Touchscreen with RGB LEDs

      December 26, 2022

      Pi Pico Pinout Display on the Command Line

      December 23, 2022

      How to Add a Raspberry Pi Pico Reset Button

      November 20, 2022

      Pi Pico Onboard LED

      Categories
      • 1-wire
      • 3D Printing
      • Add-ons
      • BBC Micro:bit
      • BerryClip
      • Books
      • Camera Module
      • Cases
      • Events
      • General
      • Hardware
      • I2C
      • Infographics
      • Interfaces
      • Minecraft
      • Model A+
      • Model B+
      • News
      • Pi Models
      • Pi Pico
      • Pi Zero
      • Power
      • Programming
      • Python
      • Raspberry Pi OS
      • Raspbian
      • RetroGaming
      • Robotics
      • Sensors
      • Software
      • SPI
      • Tutorials & Help
      Tags
      Arduino audio battery berryclip Birthday bluetooth cambridge camera CamJam DigiMakers display games GPIO I2C interface Kickstarter Kodi LCD LED Linux media Minecraft Model A motionEyeOS PCB photography photos Pi-Lite Pi Pico power python Raspberry Jam Raspberry Pi Bootcamp raspbian Retrogaming retroPie screen SD card security sensor SPI SSH temperature ultrasonic video
      Raspberry PI Related
      • Adafruit Blog
      • Average Maker
      • Official RaspBerry Pi Site
      • Raspberry Pi Pod
      • RasPi.tv
      • RaspTut
      • Stuff About Code
      Tech Resources
      • MattsBits – Pi Resources
      • Microbit Spy
      • Technology Spy
      Archives

      Entries RSS | Comments RSS

      This site is not associated with the official Raspberrypi.org site or the Raspberry Pi Foundation. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

      Copyright © 2025 - All Rights Reserved - Matt Hawkins

      About

      Unofficial site devoted to the Raspberry Pi credit card sized computer offering tutorials, guides, resources,scripts and downloads. We hope to help everyone get the most out of their Pi by providing clear, simple articles on configuring, programming and operating it.

      Popular Posts
      September 19, 2014

      Top 5 Reasons The Raspberry Pi Sucks

      July 27, 2012

      16×2 LCD Module Control Using Python

      October 20, 2013

      Analogue Sensors On The Raspberry Pi Using An MCP3008

      Latest Posts
      February 16, 2024

      Disable SSH Password Login on Raspberry Pi

      March 13, 2023

      Elecrow Meteor IPS Touchscreen with RGB LEDs

      December 26, 2022

      Pi Pico Pinout Display on the Command Line

      Mastodon YouTube Instagram Facebook Pinterest RSS

      Entries RSS | Comments RSS

      This site is not associated with the official Raspberrypi.org site or the Raspberry Pi Foundation. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

      Copyright © 2025 - All Rights Reserved - Matt Hawkins

      mastodon.social@RPiSpy

      Type above and press Enter to search. Press Esc to cancel.