How to Set up an FTP Server in Ubuntu Linux

Part 1 of 4:

Installing the FTP Framework

  1. How to Set up an FTP Server in Ubuntu Linux Picture 1
    Make sure that Ubuntu is up-to-date. Ubuntu versions 17.10 and up have vastly different file paths than previous versions, so you'll need to upgrade to the latest version of Ubuntu if you haven't already done so:[1]
    1. Open Terminal
    2. Type in sudo apt-get upgrade and press Enter.
    3. Type in your password and press Enter.
    4. Type in y when prompted, then press Enter.
    5. Wait for the upgrades to finish installing, then restart your computer if prompted.
  2. How to Set up an FTP Server in Ubuntu Linux Picture 2
    Open Terminal. Click the Applications menu ⋮⋮⋮, scroll down, and click the black-and-white Terminal icon to do so.
    1. You can also just press Alt+Ctrl+T to open Terminal.
  3. How to Set up an FTP Server in Ubuntu Linux Picture 3
    Enter the VSFTPD install command. Type sudo apt-get install vsftpd into Terminal, then press Enter.
  4. How to Set up an FTP Server in Ubuntu Linux Picture 4
    Enter your password. Type in the password that you use to log into your computer, then press Enter.
  5. How to Set up an FTP Server in Ubuntu Linux Picture 5
    Wait for VSFTPD to install. This will take anywhere from 5 minutes to 20 minutes depending on your current FTP settings and your Internet connection, so be patient.
  6. How to Set up an FTP Server in Ubuntu Linux Picture 6
    Install FileZilla. This is the program that you'll use to access and upload to your server. To install it:
    1. Type in sudo apt-get install filezilla
    2. Enter your password again if prompted.
    3. Wait for the installation to complete.
Part 2 of 4:

Configuring the FTP Server

  1. How to Set up an FTP Server in Ubuntu Linux Picture 7
    Open the VSFTPD configuration file. Type in sudo nano /etc/vsftpd.conf and press Enter. You'll be editing this file to allow (or disable) certain VSFTPD features.
  2. How to Set up an FTP Server in Ubuntu Linux Picture 8
    Allow local users to log into your FTP server. Use the arrow keys to scroll down to the # Uncomment this to allow local users to log in. heading, then remove the "#" from the local_enable=YES line below it.[2]
    1. You can remove the "#" by using the arrow keys to select the letter in front of it (in this case, "l") and pressing the Backspace key.
    2. Skip this step if the local_enable=YES line is already white.
  3. How to Set up an FTP Server in Ubuntu Linux Picture 9
    Allow FTP write commands. Scroll down to the # Uncomment this to enable any form of FTP write command. heading, then remove the "#" from the write_enable=YES line below it.
    1. Skip this step if write_enable=YES is already white.
  4. How to Set up an FTP Server in Ubuntu Linux Picture 10
    Disable ASCII mangling. Scroll all the way down to the # ASCII mangling is a horrible feature of the protocol. heading, then remove the "#" from the following two lines:
    1. ascii_upload_enable=YES
    2. ascii_download_enable=YES
  5. How to Set up an FTP Server in Ubuntu Linux Picture 11
    Change the "chroot" settings. Scroll down to the # chroot) heading, then add the following lines:
    1. user_sub_token=$USER
    2. chroot_local_user=YES
    3. chroot_list_enable=YES
    4. If any of these lines already exist, simply remove the "#" before each existing line.
  6. How to Set up an FTP Server in Ubuntu Linux Picture 12
    Change the default "chroot" settings. Scroll down to the (default follows) heading, then add the following lines:
    1. chroot_list_file=/etc/vsftpd.chroot_list
    2. local_root=/home/$USER/Public_html
    3. allow_writeable_chroot=YES
    4. If any of these lines already exist, simply remove the "#" before each existing line.
  7. How to Set up an FTP Server in Ubuntu Linux Picture 13
    Enable the "ls recurse" option. Scroll down to the # You may activate the "-R" option... heading, then remove the "#" from the ls_recurse_enable=YES line below it.
  8. How to Set up an FTP Server in Ubuntu Linux Picture 14
    Save and exit the text editor. To do so:
    1. Press Ctrl+X
    2. Type y
    3. Press Enter
Part 3 of 4:

Adding Usernames to the CHROOT List

  1. How to Set up an FTP Server in Ubuntu Linux Picture 15
    Open the "chroot" text file. Type in sudo nano /etc/vsftpd.chroot_list and press Enter.
    1. You can skip to the last step in this part if you don't want to specify people who can access your FTP server.
  2. How to Set up an FTP Server in Ubuntu Linux Picture 16
    Enter your password. Type in the password that you use to log into Ubuntu and press Enter. This will open the "chroot" text file.
    1. Skip this step if not asked for your password.
  3. How to Set up an FTP Server in Ubuntu Linux Picture 17
    Add usernames to the list. Type in your own username, press Enter, and repeat with any other usernames of people whom you want to have access their Home directories from within your server.
  4. How to Set up an FTP Server in Ubuntu Linux Picture 18
    Save your list. Press Ctrl+X, type in y, and press Enter. Your list will be saved.
  5. How to Set up an FTP Server in Ubuntu Linux Picture 19
    Restart VSFTPD. Type in sudo systemctl restart vsftpd and press Enter. This will stop and restart VSFTPD, ensuring that your changes have been saved. You can now access your FTP server.[3]
Part 4 of 4:

Accessing Your Server

  1. How to Set up an FTP Server in Ubuntu Linux Picture 20
    Determine your server's address. If you're paying for an FTP server through a hosting service (e.g., Bluehost), you'll need to know the service's IP address or regular address in order to connect to it.[4]
    1. If you're hosting your own server from your computer, you'll use your computer's IP address, which you can figure out by entering ifconfig in Terminal and then reviewing the "inet addr" number.
      1. If "ifconfig" isn't installed, you can install it by entering sudo apt-get install net-tools in Terminal.
  2. How to Set up an FTP Server in Ubuntu Linux Picture 21
    Forward a port on your router. Once you know your server's IP address, you'll need to forward your router's port 21 slot to that address; make sure that the port uses TCP (not UDP or a mixture of the two).
    1. Port forwarding varies from router to router, so be sure to check the linked article or your router's documentation for instructions.
  3. How to Set up an FTP Server in Ubuntu Linux Picture 22
    Open Filezilla. Type filezilla into Terminal and press Enter. After a moment, FileZilla will open.
    1. If you want to connect via Terminal, you can try typing in ftp [address]. As long as your server is running and you have Internet access, this will attempt to connect to your FTP server; however, you may not be able to transfer files.
  4. How to Set up an FTP Server in Ubuntu Linux Picture 23
    Click File. It's in the top-left corner of the FileZilla window. Doing so prompts a drop-down menu.
  5. How to Set up an FTP Server in Ubuntu Linux Picture 24
    Click Site Manager…. You'll find this option in the drop-down menu. The Site Manager window will open.
  6. How to Set up an FTP Server in Ubuntu Linux Picture 25
    Click New Site. It's a white button in the lower-left side of the window. Doing so opens the New Site section of the Site Manager.
  7. How to Set up an FTP Server in Ubuntu Linux Picture 26
    Enter your server's address. In the "Host:" text field, type in the address (or IP address) of the FTP server to which you want to connect.[5]
  8. How to Set up an FTP Server in Ubuntu Linux Picture 27
    Add the forwarded port number. Type 21 into the "Port:" text field.
  9. How to Set up an FTP Server in Ubuntu Linux Picture 28
    Click Connect. It's a red button at the bottom of the page. Doing so will prompt FileZilla to connect your computer to your FTP server.
  10. How to Set up an FTP Server in Ubuntu Linux Picture 29
    Move files onto the server. You can click and drag folders from the left-hand window into the right-hand window to upload them to your FTP server page.
4.3 ★ | 3 Vote

May be interested

  • Is CentOS or Ubuntu the best web hosting server operating system?Is CentOS or Ubuntu the best web hosting server operating system?
    with so many available linux distributions, choosing a suitable distro for your home computer is not easy. choosing a linux distribution for the server is even more difficult.
  • Ubuntu Server Upgrade StepsUbuntu Server Upgrade Steps
    ubuntu also constantly updates itself with newer versions. if you're using the desktop, you'll be prompted when an update is available and receive instructions on the process. however, on the server, you may not have this privilege. so updating ubuntu server will involve running a few command lines.
  • 8 ways Ubuntu changes and improves Linux8 ways Ubuntu changes and improves Linux
    ubuntu is the most prominent linux distribution in the world. ubuntu and its developer, canonical, have been plagued by a lot of fuss over the years, but the linux world is getting much better thanks to both.
  • Tips and tricks after installing UbuntuTips and tricks after installing Ubuntu
    ubuntu is one of the completely free open source operating systems. this is a distribution (distro) of linux with the second highest amount of traffic after linux mint.
  • Is Arch Linux better than Ubuntu?Is Arch Linux better than Ubuntu?
    arch linux and ubuntu are two big names in the linux world. both have a huge fan base, with two completely opposite positions.
  • Distinguish Ubuntu and Linux MintDistinguish Ubuntu and Linux Mint
    linux is an open-source operating system and anyone can edit and customize to their liking, ubuntu and mint are the two operating systems born from that.
  • How to set up your own Git server on LinuxHow to set up your own Git server on Linux
    while you can count on globally renowned git hosting services like github, in some cases it is better to host a personal git server for enhanced privacy, customizability, and security.
  • Following many other Linux employees, Ubuntu stopped providing 32-bit ISO ImagesFollowing many other Linux employees, Ubuntu stopped providing 32-bit ISO Images
    ubuntu declares that it will stop providing the iso installer for os that the new version starting with ubuntu 17.0 (artful aardvark) will be released on october 19.
  • How to install fcgiwrap for Nginx on Ubuntu 20.04How to install fcgiwrap for Nginx on Ubuntu 20.04
    fcgiwrap is a simple server used to run cgi applications via fastcgi. we can use it to provide clean cgi support for nginx webserver. here's how to install fcgiwrap on ubuntu 20.04.
  • 7 best antivirus programs for Ubuntu7 best antivirus programs for Ubuntu
    viruses can still be spread, especially if you have a samba server (to share windows files on linux) or external devices often interact with both linux and windows.