This article was co-authored by wikiHow staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for wikiHow. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher.
The wikiHow Tech Team also followed the article's instructions and verified that they work.
This article has been viewed 1,017,259 times.
Learn more...
This wikiHow article will show you how to set up and connect to an FTP server from your Ubuntu Linux computer. FTP servers are useful for storing files from your computer and allowing others to browse them. In order to set up an FTP server from your computer, you'll need to have an FTP server host to which you can connect. It's also recommended that you update your Ubuntu software to the latest available version.
Steps
Installing the Software
-
1Make 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]
- Open Terminal
- Type in sudo apt-get upgrade and press ↵ Enter.
- Type in your password and press ↵ Enter.
- Type in y when prompted, then press ↵ Enter.
- Wait for the upgrades to finish installing, then restart your computer if prompted.
-
2Open Terminal. Click the Applications menu ⋮⋮⋮, scroll down, and click the black-and-white Terminal icon to do so.
- You can also just press Alt+Ctrl+T to open Terminal.
Advertisement -
3Enter the VSFTPD install command. Type sudo apt-get install vsftpd into Terminal, then press ↵ Enter.
-
4Enter your password. Type in the password that you use to log into your computer, then press ↵ Enter.
-
5Wait 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.
-
6Install FileZilla. This is the program that you'll use to access and upload to your server. To install it:
- Type in sudo apt-get install filezilla
- Enter your password again if prompted.
- Wait for the installation to complete.
Configuring the Server
-
1Open 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.
-
2Allow 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 thelocal_enable=YES
line below it.[2]- 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.
- Skip this step if the
local_enable=YES
line is already white.
-
3Allow FTP write commands. Scroll down to the
# Uncomment this to enable any form of FTP write command.
heading, then remove the "#" from thewrite_enable=YES
line below it.- Skip this step if
write_enable=YES
is already white.
- Skip this step if
-
4Disable 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:ascii_upload_enable=YES
ascii_download_enable=YES
-
5Change the "chroot" settings. Scroll down to the
# chroot)
heading, then add the following lines:user_sub_token=$USER
chroot_local_user=YES
chroot_list_enable=YES
- If any of these lines already exist, simply remove the "#" before each existing line.
-
6Change the default "chroot" settings. Scroll down to the
(default follows)
heading, then add the following lines:chroot_list_file=/etc/vsftpd.chroot_list
local_root=/home/$USER/Public_html
allow_writeable_chroot=YES
- If any of these lines already exist, simply remove the "#" before each existing line.
-
7Enable the "ls recurse" option. Scroll down to the
# You may activate the "-R" option...
heading, then remove the "#" from thels_recurse_enable=YES
line below it. -
8Save and exit the text editor. To do so:
- Press Ctrl+X
- Type y
- Press ↵ Enter
Adding Users
-
1Open the "chroot" text file. Type in sudo nano /etc/vsftpd.chroot_list and press ↵ Enter.
- You can skip to the last step in this part if you don't want to specify people who can access your FTP server.
-
2Enter your password. Type in the password that you use to log into Ubuntu and press ↵ Enter. This will open the "chroot" text file.
- Skip this step if not asked for your password.
-
3Add 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.
-
4Save your list. Press Ctrl+X, type in y, and press ↵ Enter. Your list will be saved.
-
5Restart 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]
Connecting and Transferring Files
-
1Determine 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]
- 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.
- If "ifconfig" isn't installed, you can install it by entering sudo apt-get install net-tools in Terminal.
- 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.
-
2Forward 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).
- Port forwarding varies from router to router, so be sure to check the linked article or your router's documentation for instructions.
-
3Open Filezilla. Type filezilla into Terminal and press ↵ Enter. After a moment, FileZilla will open.
- 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.
-
4Click File. It's in the top-left corner of the FileZilla window. Doing so prompts a drop-down menu.
-
5Click Site Manager…. You'll find this option in the drop-down menu. The Site Manager window will open.
-
6Click 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.
-
7Enter 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]
-
8Add the forwarded port number. Type 21 into the "Port:" text field.
-
9Click 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.
-
10Move 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.
Community Q&A
-
QuestionHow do I access the server?Community AnswerInstall FileZilla and enter the IP address of your new FTP server in the Host. Then, put your username and password in and hit "Quick Connect." If you receive a message saying your connection was refused, make sure you have list=YES set in the vsftpd.conf file.
-
QuestionHow do I restrict the FTP so only select users can log into the service?Community AnswerFollow the directions in the vsftp.conf file. It will tell you exactly what to do. Anonymous access is disabled by default.
-
QuestionIt keeps asking me for a password, but I don't have one. What should I do?Community AnswerUse the same credentials you use to log into the computer, assuming you specified yourself as one of the users who can access the site.
Warnings
- FTP servers aren't always secure, especially if you're hosting one yourself. As such, refrain from uploading sensitive or personal information to an FTP server.⧼thumbs_response⧽
References
- ↑ https://www.linux.com/learn/linux-101-updating-your-system
- ↑ https://websiteforstudents.com/setup-vsftpd-ubuntu-17-04-17-10/
- ↑ https://help.ubuntu.com/lts/serverguide/ftp-server.html
- ↑ https://www.overclock.net/threads/finding-ip-address-of-ftp-server.639765/
- ↑ https://my.bluehost.com/hosting/help/264
About This Article
1. Open a terminal in Ubuntu.
2. Use apt-get to install VSFTPD.
3. Open /etc/vsftpd.conf in a text editor.
4. Remove the hash mark in front of "local_enable=YES."
5. Remove the hash mark in front of "write_enable=YES."
6. Remove the hash marks from the two "ascii" entries.
7. Change the chroot settings.
8. Remove the hash mark from "ls_recurse_enable=YES."
9. Save and exit.
10. Add usernames to the chroot list.