• First Steps
  • General
  • Projects
Facebook Twitter YouTube
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
  • Hardware & GPIO
  • Sensors & Components
  • Scale
  • Cases
  • Fingerprint
  • Gas Sensor
  • Heartbeat
  • German
  • French
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
Home»Software»Webserver»How to setup a Raspberry Pi FTP Server – Webserver Installation

How to setup a Raspberry Pi FTP Server – Webserver Installation

Facebook Twitter LinkedIn Tumblr Email Reddit
Raspberry Pi FTP Server Installation
Share
Facebook Twitter LinkedIn Email Tumblr Reddit Telegram WhatsApp

For uploading files on a Raspberry Pi you should install a FTP server. Such a server is very useful if you use your Pi as a web server or even if you want to have a network storage, which can also be accessed outside of your network if an DNS server is installed.

However this tutorial is not only for web server but can also be used for easy file transfer between Raspberry Pi and your PC.

 

Components

You will be able to access the whole sd card (US / UK). If you want to use the Pi as a network mass storage you should have enough empty space. Alternatively you can also use an external hdd (US / UK). All B/B+ models (including the Raspberry Pi Model 2B / 3) have a 100 Mbit ethernet port, which allows fast data transfer rates.

 

Installation

First of all you need to install the server package. You can use SSH or opening the terminal.

sudo apt-get install proftpd

While installing it will ask how ProFTP should be started. We choose “standalone” (see image).

standalone

Basically, here it would be already done, but with this configuration each user has access to his own home directory (for example /home/pi). Therefore we create a new virtual user with access to a specified path. For this purpose we first change once the directory.

cd /etc/proftpd/

Here, the virtual user will be created. In the following example I create the user “tutorials“ with home directory /var/www/. You can specify whatever directory you want (also the absolute root directory or a directory on a mounted external hdd).

sudo ftpasswd --passwd  --name tutorials --gid 33 --uid 33 --home /var/www/ --shell /bin/false

Now just enter the password and confirm. If the user’s password should be changed at a later date, simply switch back to this directory ( /etc/proftpd/ ) and run the same command again.

To further unlock the virtual users, we have to edit the configuration file:

sudo nano /etc/proftpd/proftpd.conf

Following code has to be inserted at the end of that file:

DefaultRoot ~
AuthOrder mod_auth_file.c  mod_auth_unix.c
AuthUserFile /etc/proftpd/ftpd.passwd
AuthPAM off
RequireValidShell off

By pressing CTRL + O and CTRL + X and we save and exit the editor.

 

Test

Last but not least, we restart the server and try it out.

sudo /etc/init.d/proftpd restart

No you can test it: Open your Browser and type in ftp://raspberrypi/ (If you have changed the host name of your Pi you have to take that. If it still doesn’t work insert the local IP address of your Raspberry Pi). For uploading files I strongly recommend the tool FileZilla.

ftp-rpi

 

Maybe you still can’t log in because rights are missing. The following commands will help to fix this problem.

chmod g+s /var/www
chmod 775 /var/www

(If another directory has been assigned to the user, it must be adapted accordingly)

FTP ftp server proftpd web server
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleHow to establish a Raspberry Pi Remote Desktop Connection
Next Article Raspberry Pi Bluetooth Datentransfer zum Smartphone

Related Posts

Control all GPIOs with the Raspberry Pi REST API via Python

Raspberry Pi Samba Server: Share Files in the Local Network

Raspberry Pi Home Automation: Install & Configure OpenHAB

Creating a Raspberry Pi SSL Certificate For Free With Let’s Encrypt

Leave A Reply Cancel Reply

8×8 LED Dot Matrix – Assembly and Installation (Raspberry Pi)

Raspberry Pi: Control Relay switch via GPIO

Wireless communication between Raspberry Pi’s via MQTT broker/client

Raspberry Pi Bluetooth Data Transfer to the Smartphone

Read Capacitive Soil Moisture Sensor DFROBOT Gravity on the Raspberry Pi

Use a Joystick on the Raspberry Pi (with MCP3008)

Subscribe to Blog
Subscribe to Raspberry Pi Tutorials and don't miss any new Tutorial!
Subscribe

Thank you!

We will contact you soon.

Tutorials for Raspberry Pi
Facebook Twitter YouTube
  • Contact & Disclaimer

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