{"id":2979,"date":"2022-06-08T07:22:25","date_gmt":"2024-06-29T23:50:53","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-setup-ftp-server-with-vsftpd-and-tls-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-setup-ftp-server-with-vsftpd-and-tls-on-ubuntu-22-04\/","title":{"rendered":"How to Setup FTP Server with vSFTPd and TLS on Ubuntu 22.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>FTP (File Transfer Protocol) is a standard protocol for transferring files between a client and a server. For secure file transfer, you can configure FTP to work with TLS (Transport Layer Security) using the vSFTPd server. In this guide, we will walk you through setting up an FTP server with vSFTPd and enabling TLS on Ubuntu 22.04. Whether you\u2019re setting up a server locally or using a , this guide will help you securely transfer files.<\/p>\n<section>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before starting, ensure that your Ubuntu system is up to date. Run the following commands to update the package lists and install any available upgrades:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<p>Keeping your system updated ensures that you have the latest security patches, which is crucial when managing an FTP server, especially when using platforms like <a href=\"https:\/\/ie.netcloud24.com\">VPS Windows VPS Servers<\/a>.<\/p>\n<\/section>\n<section>\n<h2>Step 2: Install vSFTPd<\/h2>\n<p>The vSFTPd (Very Secure FTP Daemon) is a fast and secure FTP server for Unix-based systems. Install it using the following command:<\/p>\n<pre><code>sudo apt install vsftpd -y<\/code><\/pre>\n<p>After installation, start and enable the vSFTPd service:<\/p>\n<pre><code>sudo systemctl start vsftpd\r\nsudo systemctl enable vsftpd<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 3: Configure vSFTPd<\/h2>\n<p>Now, let&#8217;s configure vSFTPd for secure connections. Open the vSFTPd configuration file:<\/p>\n<pre><code>sudo nano \/etc\/vsftpd.conf<\/code><\/pre>\n<p>Add or modify the following lines to configure the FTP server:<\/p>\n<pre><code># Enable write permissions for users\r\nwrite_enable=YES\r\n\r\n# Restrict users to their home directory\r\nchroot_local_user=YES\r\n\r\n# Enable passive mode\r\npasv_enable=YES\r\npasv_min_port=10000\r\npasv_max_port=10100\r\n\r\n# Disable anonymous login\r\nanonymous_enable=NO\r\n\r\n# Allow local users to login\r\nlocal_enable=YES\r\n\r\n# Enable TLS\r\nssl_enable=YES\r\nallow_anon_ssl=NO\r\nforce_local_data_ssl=YES\r\nforce_local_logins_ssl=YES\r\nssl_tlsv1=YES\r\nssl_sslv2=NO\r\nssl_sslv3=NO\r\nrsa_cert_file=\/etc\/ssl\/certs\/vsftpd.pem<\/code><\/pre>\n<p>Save and close the file.<\/p>\n<\/section>\n<section>\n<h2>Step 4: Create SSL\/TLS Certificates<\/h2>\n<p>To secure FTP connections with TLS, you need to create an SSL certificate. You can create a self-signed certificate using OpenSSL:<\/p>\n<pre><code>sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/vsftpd.pem -out \/etc\/ssl\/certs\/vsftpd.pem<\/code><\/pre>\n<p>Follow the prompts to provide certificate details. Once the certificate is created, make sure the permissions are set correctly:<\/p>\n<pre><code>sudo chmod 600 \/etc\/ssl\/private\/vsftpd.pem \/etc\/ssl\/certs\/vsftpd.pem<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 5: Configure the Firewall<\/h2>\n<p>If you have a firewall enabled on your Ubuntu server, you need to allow FTP and the passive port range through the firewall. Use the following commands to allow the necessary ports:<\/p>\n<pre><code>sudo ufw allow 20\/tcp\r\nsudo ufw allow 21\/tcp\r\nsudo ufw allow 10000:10100\/tcp<\/code><\/pre>\n<p>Reload the firewall to apply the changes:<\/p>\n<pre><code>sudo ufw reload<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 6: Restart vSFTPd<\/h2>\n<p>After configuring vSFTPd and creating the SSL certificate, restart the vSFTPd service to apply the changes:<\/p>\n<pre><code>sudo systemctl restart vsftpd<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 7: Test FTP Server<\/h2>\n<p>You can now test your FTP server using an FTP client like FileZilla. Ensure that you connect using FTP over TLS. Use your server&#8217;s IP address, FTP username, and password to connect securely. If you are hosting the server on a <a href=\"https:\/\/ie.netcloud24.com\">UK Windows VPS<\/a>, make sure to use the correct external IP address provided by your VPS provider.<\/p>\n<\/section>\n<footer>\n<p>You have successfully set up an FTP server with vSFTPd and TLS on Ubuntu 22.04. This setup ensures that your file transfers are secure, making it ideal for both personal and business use. For reliable hosting solutions, consider using . They offer a range of hosting options, including <strong>windows virtual private servers<\/strong>, <strong>vps windows hosting<\/strong>, and <strong>windows virtual dedicated server hosting<\/strong>. Whether you need <strong>windows vps italy<\/strong> or <strong>uk vps windows<\/strong> hosting, their services provide the performance and security needed for managing your FTP server.<\/p>\n<\/footer>\n<\/article>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 FTP (File Transfer Protocol) is a standard protocol for transferring files between a client and a server. For secure file transfer, you can configure FTP to\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2979","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2979","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2979"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2979\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}