Raspberry Pi – Set up FTP

To set up FTP on the raspberry pi so that we can upload files for the website in www

First, we need to have permission to access the www folder

sudo chown -R pi /var/www

Next, we install FTP

sudo apt-get install vsftpd

Then edit the configuration file for vsftpd

sudo nano /etc/vsftpd.conf

Make the following changes to the configuration file

anonymous_enable=YES -> anonymous_enable=NO
#local_enable=YES -> local_enable=YES
#write_enable=YES -> write_enable=YES
#local_unmask=022 -> local_unmask=777
#chown_uploads=YES -> chown_uploads=YES
#chown_username=pi -> chown_username=www-data

Add the following to the end of the file:


Then restart the service:

sudo service vsftpd restart

Create a shortcut so that the www folder appears in the FTP root:

ln -s /var/www/ ~/www