---
title: "How to Set up a Raspberry Pi FTP Server"
description: "Learn how to set up a Raspberry Pi FTP server with this step-by-step guide, whether you’re a beginner or an expert!"
canonical: "https://adamtheautomator.com/raspberry-pi-ftp-server/"
---

# How to Set up a Raspberry Pi FTP Server

> Learn how to set up a Raspberry Pi FTP server with this step-by-step guide, whether you’re a beginner or an expert!

Source: https://adamtheautomator.com/raspberry-pi-ftp-server/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Set up a Raspberry Pi FTP Server](https://adamtheautomator.com/wp-content/uploads/2023/03/raspberry-pi-ftp-server.jpg)

# How to Set up a Raspberry Pi FTP Server

[![](https://secure.gravatar.com/avatar/2788bb1a3f735603f81eca51d68daec56a9d97e805a10268fb2c20afcc76b81b?s=192&d=mm&r=g)Nicholas Xuan Nguyen](https://adamtheautomator.com/author/nicholas-xuan-nguyen/)10 April 20237 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Raspberry Pi](/tag/raspberry-pi/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing the Raspberry Pi FTP Server (vsftpd) Package](#installing-the-raspberry-pi-ftp-server-vsftpd-package)
*   [Configuring the vsftpd Server](#configuring-the-vsftpd-server)
*   [Creating a New FTP User and Setting Permissions](#creating-a-new-ftp-user-and-setting-permissions)
*   [Connecting to the FTP Server and Transferring Files](#connecting-to-the-ftp-server-and-transferring-files)
*   [Conclusion](#conclusion)

Are you tired of having your essential files scattered across multiple devices and platforms? Worry not! Setting up a Raspberry Pi FTP server effectively keeps all your files in one place.

In this tutorial, you will learn how to set up your Raspberry Pi FTP server for secure file transfer and management. Whether sharing files with friends and family or accessing your files remotely, a Raspberry Pi FTP server will be handy.

Read on and never lose track of your files!

## Prerequisites

This tutorial will be a hands-on demonstration. To follow along, be sure you have the following in place:

*   A Raspberry Pi with Raspbian OS installed – This tutorial uses Raspberry Pi 4 with Raspbian Bullseye 64-bit.
*   A monitor, keyboard, and mouse to connect to your Raspberry Pi.
*   A stable internet connection and a network connection for your Raspberry Pi.
*   A local machine to serve as an FTP client – This tutorial uses a Windows 10 machine with [FileZilla](https://filezilla-project.org/download.php?platform=win64) installed (FTP client).

Related:[How to Install & Download Filezilla for Windows](https://adamtheautomator.com/download-filezilla-for-windows/)

## Installing the Raspberry Pi FTP Server (vsftpd) Package

Very Secure FTP Daemon (vsftpd) is a popular and widely used FTP server software designed for Unix-based systems, including the Raspberry Pi. The vsftpd package provides various security features such as [SSL encryption](https://www.cloudflare.com/learning/ssl/what-is-ssl/) and [chroot j](https://phoenixnap.com/kb/chroot-jail)[a](https://phoenixnap.com/kb/chroot-jail)[il](https://phoenixnap.com/kb/chroot-jail) to ensure the privacy and security of your data.

Related:[How to Set Up End-to-End CloudFlare SSL Encryption](https://adamtheautomator.com/cloudflare-ssl/)

Installing the vsftpd package allows you to set up a secure and reliable FTP server for quick file transfers over the internet or local network.

Open a terminal, and run the following [`apt update`](https://linuxize.com/post/how-to-use-apt-command/#updating-package-index-apt-update) command to update the list of available packages on your Raspberry Pi. This command ensures your Raspberry Pi has the latest and most up-to-date package information.

Related:[Learning Ubuntu Apt Get Through Examples](https://adamtheautomator.com/ubuntu-apt-get/)

```powershell
sudo apt update
```

![Updating the list of available packages](https://adamtheautomator.com/wp-content/uploads/2023/03/image-267.png)

Updating the list of available packages

Once updated, run the [`apt install`](https://linuxize.com/post/how-to-use-apt-command/#installing-packages-apt-install) command below to install the `vsftpd` package and any necessary dependencies.

```powershell
sudo apt install vsftpd
```

![Installing the vsftpd package](https://adamtheautomator.com/wp-content/uploads/2023/03/image-268.png)

Installing the vsftpd package

## Configuring the vsftpd Server

After installing the vsftpd package, the default configuration file is _/etc/vsftpd.conf_. But the default configuration may not always meet your needs, such as disabling anonymous FTP access or setting up user authentication.

As a solution, you must configure the vsftpd server, an essential step in setting up a functional and secure FTP server on your Raspberry Pi. By modifying the configuration file, you can ensure that the vsftpd server operates efficiently and securely and provides the necessary features for file transfers.

To configure the vsftpd server, follow these steps:

1\. Open the `/etc/vsftpd.conf` file in your favorite text editor.

```powershell
sudo nano /etc/vsftpd.conf
```

> _Perhaps you prefer a GUI-based text editor. If so, why not try [Gedit](https://adamtheautomator.com/gedit-linux/) or [Subl](https://adamtheautomator.com/sublime-text-on-ubuntu/)[i](https://adamtheautomator.com/sublime-text-on-ubuntu/)[me Text](https://adamtheautomator.com/sublime-text-on-ubuntu/) on Ubuntu?_

Related:[How to Edit Files with a Real PowerShell Text Editor](https://adamtheautomator.com/powershell-text-editor/)

2\. Next, configure the following parameters per your requirements to ensure the vsftpd server operates securely and efficiently. Proper configurations allow local users to access and transfer files to and from the server with the necessary permissions.

*   **anonymous\_enable=NO** – This parameter specifies whether anonymous FTP access is allowed or not. Setting it to **NO** disables anonymous access, which is recommended for security reasons.

![Disabling anonymous FTP access](https://adamtheautomator.com/wp-content/uploads/2023/03/image-269.png)

Disabling anonymous FTP access

*   **local\_enable=YES** – This parameter determines whether local users can access your FTP server. Setting it to **YES** allows local users to access the FTP server. This parameter can be handy in a home or office environment where multiple users need access to a central file repository.

![Enabling local user's access](https://adamtheautomator.com/wp-content/uploads/2023/03/image-270.png)

Enabling local user’s access

*   **write\_enable=YES** – This parameter allows for write permissions for the local users accessing the FTP server. Setting it to **YES** enables local users to upload, create, modify, or delete files on the server.

![Enabling write permissions for the local users](https://adamtheautomator.com/wp-content/uploads/2023/03/image-271.png)

Enabling write permissions for the local users

*   **local\_umask=022** – This parameter sets the default file permissions for uploaded files. The default value is **022**, which sets the file permissions to 644 for files and 755 for directories, as follows:

| Content | Permissions | Details |
| --- | --- | --- |
| Files | 664 | Files created by local users will have read-and-write permissions for the owner and read-only permissions for others. |
| Directories | 755 | Directories created by local users will have read, write, and execute permissions for the owner and read and execute permissions for others. |

![](https://adamtheautomator.com/wp-content/uploads/2023/03/image-272.png)

Related:[Manage Directory and File Permissions with chmod Recursive](https://adamtheautomator.com/chmod-recursive/)

*   **chroot\_local\_user=YES** – This parameter specifies whether local users should be restricted to their home directories. Setting it to **YES** restricts users to their home directories, which adds an extra layer of security to the server. Chrooting users to their home directories helps prevent unauthorized access to other users’ files on the server.

![Restricting users to their home directories](https://adamtheautomator.com/wp-content/uploads/2023/03/image-273.png)

Restricting users to their home directories

3\. Append the following configurations to the end of the configuration file, save the changes, and close the file.

These configurations ensure that each user logging in is chrooted to their own FTP directory and can access only their files.

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

![Ensuring the user logging in is chrooted to their own FTP directory](https://adamtheautomator.com/wp-content/uploads/2023/03/image-274.png)

Ensuring the user logging in is chrooted to their own FTP directory

4\. Now, run the following command to `restart` the `vsftpd` `service` to apply the changes.

This command does not produce output, but you will check the service status in the following step.

```powershell
sudo service vsftpd restart
```

5\. Lastly, run the below `systemctl` command to check the `status` of the `vsftpd` service to verify it is running correctly.

```powershell
sudo systemctl status vsftpds
```

Related:[Correct Way of Using Ubuntu systemctl to Control Systemd](https://adamtheautomator.com/ubuntu-systemctl/)

You will see the following output:

![Checking the status of the vsftpd service](https://adamtheautomator.com/wp-content/uploads/2023/03/image-275.png)

Checking the status of the vsftpd service

## Creating a New FTP User and Setting Permissions

So far, you have a vsftpd server installed and configured on your Raspberry Pi. But you must create a dedicated FTP user account before anyone can access your FTP server.

An FTP user account provides a layer of security by allowing only authorized users to access the FTP server. Each user account has a unique username and password to authenticate the user’s identity when connecting to the FTP server.

To create an FTP user with the necessary permissions:

1\. Run the below command to create a new FTP user. Feel free to replace `ftpu` with the username of your choice. But this tutorial’s choice for the username is `ftpu`.

```powershell
sudo adduser ftpu
```

Configure the new FTP user with the following:

*   Provide and retype a strong password for the user.
    
*   Fill out the remaining user details.
    
*   Input **Y** and hit Enter to finish creating the FTP user account.
    

![Creating a new FTP user](https://adamtheautomator.com/wp-content/uploads/2023/03/image-276.png)

Creating a new FTP user

2\. Next, run each `mkdir` command below, which does not produce output but creates two directories for the FTP user to store and access files on the FTP server.

> _Note that when creating directories for an FTP user, avoiding using directory names that contain spaces or special characters is strongly recommended. Some FTP clients may have difficulty interpreting spaces or special characters in directory names. This difficulty may cause issues when accessing files via the FTP server._

```powershell
# Create the root directory for the FTP user.
sudo mkdir -p /home/ftpu/ftp
# Create a directory that stores files the FTP user can access and manage.
sudo mkdir -p /home/ftpu/ftp/files
```

3\. Lastly, run the following `adduser` command to add the FTP user (`ftpu`) to the `sudo` group. Doing so gives the user access to run commands with administrative privileges using the `sudo` command.

```powershell
sudo adduser ftpu sudo
```

![Adding the FTP user to the sudo group](https://adamtheautomator.com/wp-content/uploads/2023/03/image-277.png)

Adding the FTP user to the sudo group

## Connecting to the FTP Server and Transferring Files

With an FTP user created, you can now connect to your FTP server. Any FTP client application works, but this tutorial uses the FileZilla FTP client to connect to the server and transfer files. But first, you must know your Raspberry PI’s IP address.

To connect to the FTP server using FileZilla, follow these steps:

1\. Run the below [`hostname`](https://www.geeksforgeeks.org/hostname-command-in-linux-with-examples/) command to retrieve all IP addresses (`-I`) associated with your Raspberry Pi.

```powershell
hostname -I
```

Note down the IPv4 address of your Raspberry Pi for later use.

![Retrieving the host IP address ](https://adamtheautomator.com/wp-content/uploads/2023/03/image-278.png)

Retrieving the host IP address

> _Note that your IP address may change over time, primarily if it is assigned by a [Dynamic Host Configuration Protocol (DHCP) server](https://learn.microsoft.com/en-us/windows-server/networking/technologies/dhcp/dhcp-top) on your network. DHCP server may reassign the IP address to another device on the network if your Raspberry Pi is offline or if the IP address lease expires_

2\. Next, open the FileZilla client on your local computer and configure the FTP connection with the following:

*   **Host** – Input the IP address of your Raspberry Pi you noted in step one.
*   **Username** and **Password** – Provide your FTP user’s username (**ftpu**) and password.
*   **Port** – Input Port **22** for [Secure File Transfer Protocol (SFTP)](https://www.ssh.com/academy/ssh/sftp-ssh-file-transfer-protocol).

![Connecting to the FTP server](https://adamtheautomator.com/wp-content/uploads/2023/03/image-279.png)

Connecting to the FTP server

3\. When prompted, tick the checkbox, as shown below, which adds a key to the client’s key cache, and click **OK**.

This prompt asking you to trust the Raspberry Pi’s host key only appears when connecting to a Raspberry Pi for the first time.

![Confirming establishing a connection to the FTP server ](https://adamtheautomator.com/wp-content/uploads/2023/03/image-280.png)

Confirming establishing a connection to the FTP server

Once connected, you will see a success message on the Status pane, as shown below. The success message indicates you can now access and manage files on the FTP server using the FileZilla client.

![ Verifying successful FTP server connection](https://adamtheautomator.com/wp-content/uploads/2023/03/image-281.png)

Verifying successful FTP server connection

4\. Now, transfer (drag and drop) a file or folder from your local machine (left pane) to the FTP server (right pane), as shown below.

![Transferring files from the local machine to the FTP server](https://adamtheautomator.com/wp-content/uploads/2023/03/image-2.gif)

Transferring files from the local machine to the FTP server

5\. Finally, run the below command to list (`ls`) all (`-a`) contents (files and folders) of your FTP server’s `/home/ftpu/ftp/files` directory.

```powershell
ls -a /home/ftpu/ftp/files
```

The output below shows the folder (_**MyFolder**_) you transferred to your FTP server, which confirms the transfer is a success.

![Confirming the successful transfer](https://adamtheautomator.com/wp-content/uploads/2023/03/image-282.png)

Confirming the successful transfer

## Conclusion

Through this tutorial, you have learned how to set up your Raspberry Pi FTP server. You have also performed a secure transfer from your local machine to your FTP server.

With the correct permissions configured, you can connect to the FTP server and manage and store files securely via an FTP client of your choice.

Now, why not [secure your vsFTPd server with SSL/TLS encryption](https://www.vultr.com/docs/how-to-secure-vsftpd-with-ssl-tls/) for an extra layer of security?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fraspberry-pi-ftp-server%2F&text=How%20to%20Set%20up%20a%20Raspberry%20Pi%20FTP%20Server)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fraspberry-pi-ftp-server%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fraspberry-pi-ftp-server%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2023/09/hoobs.jpg)

### [HOOBS & Raspberry Pi: The Perfect DIY Smart Home Combo](/hoobs/)

Learn how HOOBS works in concert with Raspberry PI to create a DIY smart home combo that works to extend what you can automate!

![](https://adamtheautomator.com/wp-content/uploads/2023/08/java-on-raspberry-pi.jpg)

### [Learn How to Install Java on Raspberry Pi](/java-on-raspberry-pi/)

Learn how to install and get started with the ins and outs of Java on Raspberry Pi in this ATA Learning tutorial!

![](https://adamtheautomator.com/wp-content/uploads/2023/06/remote-desktop-raspberry-pi.jpg)

### [How to Guide to Remote Desktop Raspberry Pi with AnyDesk](/remote-desktop-raspberry-pi/)

Learn how to connect through the remote desktop Raspberry Pi via the AnyDesk application in this ATA Learning tutorial!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
