# How to install and configure an Ubuntu FTP server

The FTP protocol remains one of the most popular solutions for uploading and downloading files. That’s why, in this guide, we’ll show you how to set up your own Ubuntu FTP server — and highlight the key points you need to keep in mind throughout the process.

## How to install an Ubuntu FTP server

Before you can start setting up your own FTP server, the first step is to choose the right software. Ubuntu systems like Ubuntu 22.04 already include a built-in option in the package manager: [vsftpd](https://security.appspot.com/vsftpd.html "GPL-licensed FTP server for Unix-like systems"). To install the application, simply open the terminal and enter the following command:

```bash
sudo apt-get install vsftpd
```

[![Image: Ubuntu 22.04: vsftpd installation in the terminal](https://www.ionos.com/digitalguide/fileadmin/_processed_/0/5/csm_vsftpd-installation-ubuntu-2204_90633f9b4b.webp "Ubuntu 22.04: vsftpd installation in the terminal")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2024/vsftpd-installation-ubuntu-2204.png) Root or administrator privileges (`sudo`) are required to install vsftpd.  Tip Looking to store or transfer data? Lay the foundation for secure file transfers and [rent your secure FTP Server](https://www.ionos.com/hosting/ftp-hosting "Secure FTP hosting from IONOS") from IONOS — with SSH, SSL/[TLS](https://www.ionos.com/digitalguide/server/security/tls-transport-layer-security/), and daily backups included.

## The right hardware for your Ubuntu FTP server

The hardware requirements for an FTP server running on Ubuntu 22.04 vary depending on your use case. To ensure optimal internet connectivity and performance, we recommend hosting your server with a professional provider like IONOS. With [VPS (virtual private servers)](https://www.ionos.com/servers/vps "Rent affordable VPS from IONOS") and [dedicated servers](https://www.ionos.com/servers/dedicated-servers "Dedicated servers from IONOS"), you have two powerful options for **running a high-performance FTP**

The table below outlines three possible scenarios for your Ubuntu FTP server and the most suitable IONOS hosting plan for each.

<table>
  <thead>
    <tr>
      <th>Ubuntu FTP Server Scenario</th>
      <th>Recommended IONOS Plan</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Basic FTP server; occasional data transfers</td>
      <td>VPS Linux M</td>
    </tr>
    <tr>
      <td>Large FTP server for internal company use; regular transfers</td>
      <td>VPS Linux XL</td>
    </tr>
    <tr>
      <td>Public FTP server; continuous data transfers</td>
      <td>Dedicated Server AR6-32 SSD</td>
    </tr>
  </tbody>
</table>

## How do you set up and configure an FTP server on Ubuntu? Tutorial

After finishing the short installation, you can close the terminal again and start configuring the Ubuntu FTP server. To do this, open the `vsftpd.conf` configuration file, which is located by default in the `etc` directory.

[![Image: Snippet of available documents in the etc directory](https://www.ionos.com/digitalguide/fileadmin/_processed_/1/b/csm_etc-folder-vsftpd-conf_580205b5d1.webp "Snippet of available documents in the etc directory")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2024/etc-folder-vsftpd-conf.png) The `etc` directory contains various configuration and information files, such as `vsftpd.conf`. To open and edit the configuration file of your Ubuntu FTP server, you’ll need a basic text editor. Ubuntu comes with **gedit** (the GNOME editor) preinstalled for this purpose.

The contents of the file can generally be divided into two sections:

- Lines that begin with a hash symbol (`#`) are **commented out** and therefore ignored by the vsftpd server. These lines may include comments explaining various configuration options, or they may represent disabled features.
- Lines that do not begin with a hash symbol contain the actual configuration settings that will be interpreted and used by the server.

[![Image: Snippet of the vsftpd.conf file](https://www.ionos.com/digitalguide/fileadmin/_processed_/3/a/csm_vsftpd-conf-gedit_45c5d273e0.webp "Snippet of the vsftpd.conf file")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2024/vsftpd-conf-gedit.png) Hash symbols are not just signals for the vsftpd server — they also improve readability and help users better understand the configuration. There are no general requirements for additional setup of the FTP server, since it depends on what you personally need and what demands you place on your server. Here it’s important that you consider the various options first. In the following sections of this Ubuntu FTP server guide, you’ll find information about the **various settings** and their functions.

Note To save changes to the `vsftpd.conf` file, you need root privileges. Otherwise, you’ll only be able to view the configuration file without making edits.

### Allow anonymous access

By default, vsftpd is configured so that users can only log in to the FTP server with a specific account. However, the [File Transfer Protocol](https://www.ionos.com/digitalguide/server/know-how/file-transfer-protocol/) also supports an anonymous login option that allows users to access the server without providing personal information. To **enable this access type**, look for the entry `anonymous_enable=NO` in the configuration file and change the parameter from `NO` to `YES`:

```txt
anonymous_enable=YES
```

[![Image: vsftpd.conf: Anonymous FTP access configuration](https://www.ionos.com/digitalguide/fileadmin/_processed_/c/3/csm_ubuntu-ftp-server-anonymous-login_d4dd7e57f4.webp "vsftpd.conf: Anonymous FTP access configuration")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2024/ubuntu-ftp-server-anonymous-login.png) Once you enter the line “anonymous\_enable=YES”, anonymous login will be enabled on your Ubuntu FTP server. ### Extend anonymous user rights

By default, access rights are heavily restricted when users log in anonymously to an Ubuntu FTP server. For example, users can only download files that are readable by everyone (`anon_world_readable_only=YES`). If you change this setting to `NO`, **downloads of other files** will also be permitted.

Note If your FTP server is connected to the internet, it is **not recommended** to expand permissions for anonymous sessions. Otherwise, you risk unauthorized third parties misusing your server!

Additional **available options** for expanding the permissions of anonymous users include:

- `anon_mkdir_write_enable`: Allows anonymous users to create new directories if you set this to `YES` or remove the leading `#`. This requires that `write_enable` is also enabled.
- `anon_other_write_enable=YES`: If you add this line, anonymous users will be able to rename and delete files and directories on the FTP server.
- `anon_upload_enable=YES`: This enables anonymous file uploads. To use it, you must also activate `write_enable` and create a separate upload directory, since anonymous users cannot write directly to the home directory.

## Restrict local user access to the home directory

If you want to grant local users access only to their own home directory (`/home/username`), you can configure this in the `vsftpd.conf` file. The relevant configuration parameter is `chroot_local_user`. In Ubuntu 22.04, this line is commented out by default. To restrict local accounts from accessing any other directories, simply remove the `#` at the beginning of the line:

```txt
chroot_local_user=YES
```

### Enable or disable local user login

To allow local users to access the FTP server, the setting `local_enable=YES` must be enabled — which is the default configuration. If you want to prevent local users from accessing your Ubuntu FTP server, simply **comment out** the corresponding line by adding a hash symbol (`#`) at the beginning:

```txt
#local_enable=YES
```

[![Image: Ubuntu FTP server: Configuration of local user rights](https://www.ionos.com/digitalguide/fileadmin/_processed_/e/2/csm_local-ftp-user-allowed_5740df46aa.webp "Ubuntu FTP server: Configuration of local user rights")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2024/local-ftp-user-allowed.png) By default, login for local user accounts is allowed in the `vsftpd.conf` file. ### Enable global write access

In Ubuntu 22.04, the default configuration does not allow either local or anonymous accounts to use FTP write commands. The relevant line for global write access, `write_enable=YES`, is commented out by default. To allow logged-in users to **modify the file system on the vsftpd server**, you’ll need to remove the leading hash symbol (`#`) from this line:

```txt
write_enable=YES
```

### Restrict FTP access to specific accounts

In some situations, it may be useful to block certain users from accessing the Ubuntu FTP server or to clearly define which users are allowed to log in.

To **deny access to specific users**, add the following lines at the end of the configuration file:

```txt
userlist_deny=YES
userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
```

Users listed in the external file `vsftpd.user_list` will be denied access in this setup. All other users will still be able to log in as usual.

If you want to **allow access only to specific users**, you need to set the `userlist_deny` parameter to `NO`. As a result, only the user accounts listed in the `vsftpd.user_list` file will be able to log in.

```txt
userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
```

Note In both cases, you’ll need to manually create the external text file `vsftpd.user_list` in the `/etc/` directory. Each user account should be listed on a separate line in the file.

### Additional options at a glance

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Default Value</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>`download_enable`</td>
      <td>–</td>
      <td>Enable (`YES`) or disable (`NO`) downloads</td>
    </tr>
    <tr>
      <td>`ssl_enable`</td>
      <td>`NO`</td>
      <td>Enable SSL encryption for FTP access</td>
    </tr>
    <tr>
      <td>`force_anon_logins_ssl`</td>
      <td>`NO`</td>
      <td>Require SSL connections for anonymous users (`YES`)</td>
    </tr>
    <tr>
      <td>`force_local_logins_ssl`</td>
      <td>`NO`</td>
      <td>Require SSL connections for local users (`YES`)</td>
    </tr>
    <tr>
      <td>`anon_max_rate`</td>
      <td>`0`</td>
      <td>Max download speed (in bytes/second) for anonymous users; `0` means unlimited</td>
    </tr>
    <tr>
      <td>`local_max_rate`</td>
      <td>`0`</td>
      <td>Max download speed (in bytes/second) for local users; `0` means unlimited</td>
    </tr>
    <tr>
      <td>`max_clients`</td>
      <td>`0`</td>
      <td>Max number of clients allowed at the same time; `0` means no limit</td>
    </tr>
    <tr>
      <td>`max_per_ip`</td>
      <td>`0`</td>
      <td>Max number of connections allowed per IP address; `0` means no limit</td>
    </tr>
    <tr>
      <td>`anon_root`</td>
      <td>`/home/ftp`</td>
      <td>Default directory for anonymous users</td>
    </tr>
  </tbody>
</table>

By the way, you can view a complete list of all available options by running the following command in the terminal:

```bash
man vsftpd.conf
```

[![Image: Manual page of the vsftpd configuration file](https://www.ionos.com/digitalguide/fileadmin/_processed_/5/0/csm_vsftpd-conf-manuals_ced84c321a.webp "Manual page of the vsftpd configuration file")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2024/vsftpd-conf-manuals.png) In the manual of the Ubuntu FTP server application, you can find detailed descriptions of all available options. ## How to use the FTP server under Ubuntu 22.04

After you’ve set the configuration file to your desired specifications, don’t forget to save it. For the server application to accept all changes, a **restart** is required, which you initiate with the following command:

```bash
sudo systemctl restart vsftpd
```

If you haven’t started the FTP server yet, do this with the terminal command:

```bash
sudo systemctl start vsftpd
```

Tip If you want to stop the Ubuntu FTP server, simply replace the `start` parameter in the previous command with `stop`.

### Create an FTP user account

Now that you’ve set up and started your Ubuntu FTP server, you’ll need a **user account** to log in. In this example, we’ll create a user named “ftpuser” with the password “test123”.

```bash
sudo useradd -m user -s/usr/sbin/nologin
sudo passwd user
```

Next, **allow login access for the NoLogin shell** by adding the following line to the end of the `/etc/shells` file:

```txt
/usr/sbin/nologin
```

### Connect to the FTP server

You can now use the user account you created to **connect to the vsftpd server** using the FTP client of your choice. A popular solution, which is included in Ubuntu’s default package repositories, is the cross-platform open-source application [FileZilla](https://www.ionos.com/digitalguide/server/configuration/filezilla-tutorial-for-the-ftp-client-program/). You can install it the traditional way via the terminal:

```bash
sudo apt-get install filezilla
```

Open FileZilla and add a new connection using the appropriate details: In the Host field, enter the IP address of your Ubuntu FTP server — unless you’ve changed the default settings, it will be listening on port 21. Select the “File Transfer Protocol”, and if possible, choose “SFTP (Secure FTP)” or “FTP over TLS”, as a plain FTP connection over port 21 poses a significant security risk. For the **Logon Type**, select “Normal”. Enter the previously created username and password in the **User** and **Password** fields. Click “Connect” to establish the connection to your server.

[![Image: FileZilla Site Manager](https://www.ionos.com/digitalguide/fileadmin/_processed_/b/e/csm_filezilla-site-manager_b93e88813c.webp "FileZilla Site Manager")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2024/filezilla-site-manager.png) The FileZilla client offers detailed configuration options for connecting to an FTP server. ### 500 OOPS: Security feature causing issues

If you’ve set up an Ubuntu FTP server and certain settings aren’t working, there could be several reasons: You may have forgotten to restart the FTP server or save the configuration file, or there may be a syntax error in the `vsftpd.conf` — for example, a misplaced space character. One common error message with a completely different root cause is the following:

`500 OOPS: vsftpd: refusing to run with writable root inside chroot ()`

This message, which may appear during connection attempts, is not actually an error in the traditional sense — it’s a security feature. The background is a potential vulnerability in the **glibc library** (Ubuntu’s default C programming language library), which users with write access to their own root directory could exploit. To bypass this security restriction, there are two possible solutions:

1. **Remove write permissions from the user’s root directory**: This method revokes write access to the user’s own root directory, limiting write operations to subdirectories only. This restriction resolves the “500 OOPS” issue, but it can be inconvenient if files are required to be written directly to the root directory. Use the following terminal command to apply this fix:

```bash
chmod a-w */home/user*
```

2. **Allow write permissions to the root directory in `vsftpd.conf`**: If you have no security concerns about potential misuse of write access, you can explicitly allow this behavior by configuring the Ubuntu FTP server accordingly. To do this, simply add the following line to the configuration file:

```txt
allow_writeable_chroot=YES
```


This is a markdown version of: [https://www.ionos.com/digitalguide/server/configuration/ubuntu-ftp-server-installation-and-configuration/](https://www.ionos.com/digitalguide/server/configuration/ubuntu-ftp-server-installation-and-configuration/) for AI/LLM consumption.