---
title: "How do I install a FTP server on Ubuntu?"
url: "https://ploi.io/documentation/server/how-do-i-install-a-ftp-server-on-ubuntu"
published: "2021-01-08"
last_updated: "2021-04-09"
---

# How do I install a FTP server on Ubuntu?

While we do recommend [to use SFTP](https://ploi.io/documentation/server/how-can-i-use-sftp) instead of FTP, there might be use-cases you want to install a FTP server yourself.

When you do want to install a FTP server, we recommend to use the [VSFTPD software](https://en.wikipedia.org/wiki/Vsftpd).

Make sure when you start with this guide, you are [logged in as a root user](https://ploi.io/documentation/ssh/how-do-i-login-as-root-user).

Run these commands:

```
apt update
apt -y install vsftpd
systemctl start vsftp
systemctl enable vsftpd
mv /etc/vsftpd.conf /etc/vsftpd.conf.orig
```

Next edit **/etc/vsftpd.conf**

```
nano /etc/vsftpd.conf
```

And put these contents:

```
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
pasv_enable=Yes
pasv_min_port=4242
pasv_max_port=4243
allow_writeable_chroot=YES
```

After that, we'll have to configure the firewall to allow the FTP protocol and directory listing.

Allow these ports:

- 21 TCP
- 4242:4243 TCP

Now this is all done, restart the FTP server for the last time and try it out.

```
service vsftpd restart
```