{"id":95,"date":"2020-02-08T02:15:23","date_gmt":"2020-02-08T02:15:23","guid":{"rendered":"https:\/\/webhostingnoida.in\/blog\/?p=95"},"modified":"2021-06-28T03:10:42","modified_gmt":"2021-06-28T03:10:42","slug":"how-to-install-an-ftp-server-on-ubuntu-with-vsftpd","status":"publish","type":"post","link":"https:\/\/webhostingnoida.in\/blog\/how-to-install-an-ftp-server-on-ubuntu-with-vsftpd\/","title":{"rendered":"How To Install an FTP Server On Ubuntu with vsftpd"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-install-an-ftp-server-on-ubuntu-with-vsftpd\/#Introduction\" >Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-install-an-ftp-server-on-ubuntu-with-vsftpd\/#Step_1_Update_System_Packages\" >Step 1: Update System Packages<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-install-an-ftp-server-on-ubuntu-with-vsftpd\/#Step_2_Install_vsftpd_Server_on_Ubuntu\" >Step 2: Install vsftpd Server on Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-install-an-ftp-server-on-ubuntu-with-vsftpd\/#Step_3_Backup_Configuration_Files\" >Step 3: Backup Configuration Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-install-an-ftp-server-on-ubuntu-with-vsftpd\/#Step_4_Create_FTP_User\" >Step 4: Create FTP User<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-install-an-ftp-server-on-ubuntu-with-vsftpd\/#Step_5_Configure_Firewall_to_Allow_FTP_Traffic\" >Step 5: Configure Firewall to Allow FTP Traffic<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-install-an-ftp-server-on-ubuntu-with-vsftpd\/#Configuring_Ubuntu_vsftpd_Server\" >Configuring Ubuntu vsftpd Server<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/webhostingnoida.in\/blog\/how-to-install-an-ftp-server-on-ubuntu-with-vsftpd\/#Change_Default_Directory\" >Change Default Directory<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Introduction\"><\/span><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">Introduction<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">FTP stands for File Transfer Protocol. It is similar to HTTP (HyperText Transfer Protocol), in that it specifies a language for transferring data over a network. FTP is unencrypted by default, so by itself, it is not a good choice for secure transmission of data.<\/span><\/p>\n<h3 id=\"ftoc-heading-1\" class=\"ftwp-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Update_System_Packages\"><\/span>Step 1: Update System Packages<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n<h3 id=\"ftoc-heading-2\" class=\"ftwp-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Install_vsftpd_Server_on_Ubuntu\"><\/span>Step 2: Install vsftpd Server on Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">A common open-source FTP utility used in Ubuntu is <strong>vsftpd<\/strong>. It is recommended for its ease of use.<\/span><\/p>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">1. To install <strong>vsftpd<\/strong>, enter the command:<\/span><\/p>\n<pre class=\"wp-block-code\"><code>sudo apt install vsftpd<\/code><\/pre>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">2. To launch the service and enable it at startup, run the commands:<\/span><\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl start vsftpd\r\n\r\nsudo systemctl enable vsftpd<\/code><\/pre>\n<h3 id=\"ftoc-heading-3\" class=\"ftwp-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Backup_Configuration_Files\"><\/span>Step 3: Backup Configuration Files<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">Before making any changes, make sure to back up your configuration files.<\/span><\/p>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">1. Create a backup copy of the default configuration file by entering the following:<\/span><\/p>\n<pre class=\"wp-block-code\"><code>sudo cp \/etc\/vsftpd.conf  \/etc\/vsftpd.conf_default<\/code><\/pre>\n<h3 id=\"ftoc-heading-4\" class=\"ftwp-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Create_FTP_User\"><\/span>Step 4: Create FTP User<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">Create a new FTP user with the following commands:<\/span><\/p>\n<pre class=\"wp-block-code\"><code>sudo useradd -m testuser\r\n\r\nsudo passwd testuser<\/code><\/pre>\n<h3 id=\"ftoc-heading-5\" class=\"ftwp-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Configure_Firewall_to_Allow_FTP_Traffic\"><\/span>Step 5: Configure Firewall to Allow FTP Traffic<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">If you are using UFW that comes standard with Ubuntu, it will block FTP traffic by default. Enter the following commands to open <strong>Ports 20<\/strong> and <strong>21<\/strong> for FTP traffic:<\/span><\/p>\n<pre class=\"wp-block-code\"><code>sudo ufw allow 20\/tcp\r\n\r\nsudo ufw allow 21\/tcp<\/code><\/pre>\n<h2 class=\"ftwp-heading\"><span class=\"ez-toc-section\" id=\"Configuring_Ubuntu_vsftpd_Server\"><\/span>Configuring Ubuntu vsftpd Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3 id=\"ftoc-heading-8\" class=\"ftwp-heading\"><span class=\"ez-toc-section\" id=\"Change_Default_Directory\"><\/span>Change Default Directory<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>By default, the FTP server uses the <strong>\/srv\/ftp<\/strong> directory as the default directory. You can change this by creating a new directory and changing the FTP user home directory.<\/p>\n<p>To change the FTP home directory, enter the following:<\/p>\n<pre class=\"wp-block-code\"><code>sudo mkdir \/srv\/ftp\/new_location\r\n\r\nsudo usermod -d \/srv\/ftp\/new_location ftp<\/code><\/pre>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">Restart the <strong>vsftpd<\/strong> service to apply the changes:<\/span><\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl restart vsftpd.service<\/code><\/pre>\n<p><span id=\"span-87-157\" class=\"ct-span oxy-stock-content-styles\">Now, you can put any files you want to share via FTP into the <strong>\/srv\/ftp<\/strong> folder (if you left it as the default), or the <strong>\/srv\/ftp\/<em>new_location<\/em>\/<\/strong> directory (if you changed it).<\/span><\/p>\n<p>Hope this blog will be helpful for you.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction FTP stands for File Transfer Protocol. It is similar to HTTP (HyperText Transfer Protocol), in that it specifies a language for transferring data over a network. FTP is unencrypted by default, so by itself, it is not a good choice for secure transmission of data. Step 1: Update System Packages sudo apt update Step<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[8],"tags":[],"class_list":["post-95","post","type-post","status-publish","format-standard","hentry","category-ftp-in-linux"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/posts\/95","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/comments?post=95"}],"version-history":[{"count":1,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/posts\/95\/revisions\/96"}],"wp:attachment":[{"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/media?parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/categories?post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostingnoida.in\/blog\/wp-json\/wp\/v2\/tags?post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}