{"id":99,"date":"2025-07-03T13:09:23","date_gmt":"2025-07-03T13:09:23","guid":{"rendered":"https:\/\/vicservers.com\/blog\/?p=99"},"modified":"2025-07-03T13:09:23","modified_gmt":"2025-07-03T13:09:23","slug":"setting-up-a-firewall-for-your-linux-server-ufw-tutorial","status":"publish","type":"post","link":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/","title":{"rendered":"Setting Up a Firewall for Your Linux Server (UFW Tutorial)"},"content":{"rendered":"<h2 style=\"text-align: center\">Setting Up a Firewall for Your Linux Server (UFW Tutorial)<\/h2>\n<h2>Introduction<\/h2>\n<p>When it comes to server security, a firewall is your <strong>first line of defense<\/strong>. Whether you\u2019re running a personal blog or managing multiple cloud servers, an unprotected server is an open invitation to cyber threats.<\/p>\n<p>In this tutorial, we\u2019ll walk you through everything you need to know about <strong>setting up and configuring a firewall on Linux using UFW (Uncomplicated Firewall)<\/strong>. UFW is one of the easiest tools to use for managing firewall rules on Ubuntu and other Debian-based distributions.<\/p>\n<p>By the end of this guide, you\u2019ll be able to:<\/p>\n<ul>\n<li>Understand how UFW works<\/li>\n<li>Configure basic and advanced firewall rules<\/li>\n<li>Secure SSH access<\/li>\n<li>Open\/close specific ports<\/li>\n<li>Create reusable profiles<\/li>\n<li>Set up logging and monitoring<\/li>\n<\/ul>\n<p>Let\u2019s get started.<\/p>\n<h2>What Is a Firewall?<\/h2>\n<p>A <strong>firewall<\/strong> is a system that filters incoming and outgoing traffic to or from your server based on a defined set of rules. It allows <strong>trusted traffic<\/strong> (like your website or SSH access) and blocks potentially <strong>malicious or unauthorized connections<\/strong>.<\/p>\n<p>In Linux, tools like <strong>iptables<\/strong> and <strong>nftables<\/strong> offer powerful control, but they can be complex. That\u2019s why <strong>UFW<\/strong> exists\u2014to make managing firewall rules more accessible and human-readable.<\/p>\n<h2>\u00a0Why Use UFW?<\/h2>\n<p>UFW stands for <strong>Uncomplicated Firewall<\/strong>, and it\u2019s designed to simplify firewall management. Here\u2019s why it\u2019s a great choice:<\/p>\n<ul>\n<li><strong>Pre-installed<\/strong> on Ubuntu and many Debian-based systems<\/li>\n<li><strong>Simple syntax<\/strong> for adding\/removing rules<\/li>\n<li><strong>IPv4 and IPv6 support<\/strong><\/li>\n<li>Integrates with <strong>app profiles<\/strong> (like OpenSSH, NGINX, Apache)<\/li>\n<li>Works well on VPS and cloud servers from Vicservers<\/li>\n<\/ul>\n<h2>\u00a0Prerequisites<\/h2>\n<p>Before proceeding, ensure:<\/p>\n<p>\u2705 You\u2019re running a Linux server (Ubuntu\/Debian)<br \/>\n\u2705 You have <strong>sudo\/root access<\/strong><br \/>\n\u2705 You\u2019re connected via <strong>SSH<\/strong><\/p>\n<p>If you\u2019re using a <strong><a href=\"https:\/\/www.vicservers.com\" target=\"_blank\" rel=\"noopener\">Vicservers<\/a> VPS<\/strong>, you&#8217;re already equipped with these essentials.<\/p>\n<h2>Step 1:\u00a0 Check if UFW Is Installed<\/h2>\n<p>Most Ubuntu systems come with UFW pre-installed. To check:<\/p>\n<pre><code class=\"language-bash\">sudo ufw status\r\n<\/code><\/pre>\n<p>If it\u2019s not installed:<\/p>\n<pre><code class=\"language-bash\">sudo apt install ufw\r\n<\/code><\/pre>\n<h2>Step 2:\u00a0 Enable UFW (Safely)<\/h2>\n<p><strong>\u00a0Warning:<\/strong> If you\u2019re connected via SSH, you must allow SSH before enabling UFW, or you\u2019ll lock yourself out.<\/p>\n<h3>Allow SSH:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw allow ssh\r\n<\/code><\/pre>\n<p>This automatically allows traffic on port <strong>22<\/strong>.<\/p>\n<h3>Then enable the firewall:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw enable\r\n<\/code><\/pre>\n<p>You\u2019ll see:<\/p>\n<pre><code>Command may disrupt existing ssh connections. Proceed with operation (y|n)? y\r\nFirewall is active and enabled on system startup\r\n<\/code><\/pre>\n<p>Congratulations\u2014your firewall is now active!<\/p>\n<h2>Step 3:\u00a0 Understanding UFW Rules<\/h2>\n<h3>View current rules:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw status numbered\r\n<\/code><\/pre>\n<h3>Allow traffic on a specific port:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw allow 80\r\n<\/code><\/pre>\n<p>(For HTTP traffic)<\/p>\n<h3>Allow a service by name:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw allow \"Nginx Full\"\r\n<\/code><\/pre>\n<p>This opens both ports <strong>80 (HTTP)<\/strong> and <strong>443 (HTTPS)<\/strong>.<\/p>\n<h3>Deny traffic on a port:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw deny 23\r\n<\/code><\/pre>\n<p>(This blocks Telnet)<\/p>\n<h2>Step 4:\u00a0 Basic Configuration Examples<\/h2>\n<h3>Common Services<\/h3>\n<table>\n<thead>\n<tr>\n<th>Service<\/th>\n<th>Command<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>SSH<\/td>\n<td><code>sudo ufw allow ssh<\/code><\/td>\n<\/tr>\n<tr>\n<td>HTTP<\/td>\n<td><code>sudo ufw allow http<\/code><\/td>\n<\/tr>\n<tr>\n<td>HTTPS<\/td>\n<td><code>sudo ufw allow https<\/code><\/td>\n<\/tr>\n<tr>\n<td>NGINX<\/td>\n<td><code>sudo ufw allow 'Nginx Full'<\/code><\/td>\n<\/tr>\n<tr>\n<td>Apache<\/td>\n<td><code>sudo ufw allow 'Apache Full'<\/code><\/td>\n<\/tr>\n<tr>\n<td>MySQL<\/td>\n<td><code>sudo ufw allow 3306<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Step 5:\u00a0 Restricting SSH Access (Optional)<\/h2>\n<p>By default, SSH runs on port 22 and is open to all IPs. For tighter security:<\/p>\n<h3>Option 1: Allow from a specific IP only<\/h3>\n<pre><code class=\"language-bash\">sudo ufw allow from 203.0.113.4 to any port 22\r\n<\/code><\/pre>\n<h3>Option 2: Use a custom SSH port<\/h3>\n<p>If you\u2019ve changed your SSH port (e.g., to 2222), allow that instead:<\/p>\n<pre><code class=\"language-bash\">sudo ufw allow 2222\/tcp\r\n<\/code><\/pre>\n<p>And disable port 22 if no longer used:<\/p>\n<pre><code class=\"language-bash\">sudo ufw delete allow 22\r\n<\/code><\/pre>\n<h2>Step 6:\u00a0 Resetting and Reconfiguring UFW<\/h2>\n<p>To reset all firewall rules:<\/p>\n<pre><code class=\"language-bash\">sudo ufw reset\r\n<\/code><\/pre>\n<p>Then re-allow essential services (like SSH) before re-enabling:<\/p>\n<pre><code class=\"language-bash\">sudo ufw allow ssh\r\nsudo ufw enable\r\n<\/code><\/pre>\n<h2>Step 7:\u00a0 Logging and Monitoring<\/h2>\n<p>UFW offers basic logging to help you track connections.<\/p>\n<h3>Enable logging:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw logging on\r\n<\/code><\/pre>\n<p>To check logs:<\/p>\n<pre><code class=\"language-bash\">sudo less \/var\/log\/ufw.log\r\n<\/code><\/pre>\n<p>Look for dropped or denied packets to identify suspicious activity.<\/p>\n<h2>Step 8:\u00a0 Checking Application Profiles<\/h2>\n<p>UFW supports <strong>predefined app profiles<\/strong>, which simplify rule management.<\/p>\n<h3>List available profiles:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw app list\r\n<\/code><\/pre>\n<p>Example output:<\/p>\n<pre><code>Available applications:\r\n  OpenSSH\r\n  Apache\r\n  Nginx Full\r\n<\/code><\/pre>\n<h3>Show details of a profile:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw app info \"Nginx Full\"\r\n<\/code><\/pre>\n<p>This reveals which ports the profile includes.<\/p>\n<h2>Step 9:\u00a0 Advanced Rules<\/h2>\n<h3>Allow specific IP on a specific port:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw allow from 192.168.1.10 to any port 22\r\n<\/code><\/pre>\n<h3>Allow subnet range:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw allow from 192.168.0.0\/24\r\n<\/code><\/pre>\n<h3>Rate-limit SSH to prevent brute-force attacks:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw limit ssh\r\n<\/code><\/pre>\n<p>This rate-limits connections to port 22 (SSH) after a threshold of attempts.<\/p>\n<h2>Step 10:\u00a0 Protecting Common Web Services<\/h2>\n<h3>For NGINX:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw allow 'Nginx Full'\r\n<\/code><\/pre>\n<h3>For Apache:<\/h3>\n<pre><code class=\"language-bash\">sudo ufw allow 'Apache Full'\r\n<\/code><\/pre>\n<h3>For HTTPS only (API servers):<\/h3>\n<pre><code class=\"language-bash\">sudo ufw allow 443\r\n<\/code><\/pre>\n<p>Add rules only for the ports\/services your application actually needs.<\/p>\n<h2>Step 11:\u00a0 Disabling or Deleting Rules<\/h2>\n<h3>Disable UFW completely (not recommended):<\/h3>\n<pre><code class=\"language-bash\">sudo ufw disable\r\n<\/code><\/pre>\n<h3>Delete a specific rule:<\/h3>\n<p>Find the rule number:<\/p>\n<pre><code class=\"language-bash\">sudo ufw status numbered\r\n<\/code><\/pre>\n<p>Then delete:<\/p>\n<pre><code class=\"language-bash\">sudo ufw delete [number]\r\n<\/code><\/pre>\n<h2>Test Your Configuration<\/h2>\n<p>After setting everything up, test open ports from another server:<\/p>\n<pre><code class=\"language-bash\">nc -zv your_server_ip 80\r\n<\/code><\/pre>\n<p>Or use an external tool like https:\/\/www.yougetsignal.com\/tools\/open-ports\/<\/p>\n<h2>\u2705 Best Practices for UFW on Production Servers<\/h2>\n<ul>\n<li>Always <strong>allow SSH first<\/strong> before enabling UFW<\/li>\n<li>Limit access to non-essential ports<\/li>\n<li>Enable <strong>rate limiting<\/strong> for login services<\/li>\n<li>Use <strong>logging<\/strong> to monitor unusual access patterns<\/li>\n<li>Combine UFW with <strong>Fail2Ban<\/strong> for added brute-force protection<\/li>\n<li>Backup your firewall rules regularly<\/li>\n<\/ul>\n<h2>Final Thoughts<\/h2>\n<p>A properly configured firewall is one of the <strong>most important steps<\/strong> you can take to protect your Linux server from unauthorized access, brute-force attacks, and vulnerabilities. Thankfully, <strong>UFW makes this process simple, powerful, and flexible<\/strong>.<\/p>\n<p>With Vicservers, you get full root access and the ability to customize firewall rules from day one\u2014whether you\u2019re deploying a simple website or managing a fleet of VPS instances.<\/p>\n<h2>\u00a0Ready to Get Started?<\/h2>\n<p><a href=\"https:\/\/www.vicservers.com\/\">Launch your secure VPS at VicServers.com<\/a><br \/>\nFully customizable firewall settings<br \/>\nFree SSL, DDoS protection, and more included<br \/>\nNeed help setting up UFW? Contact our 24\/7 support<\/p>\n<p><strong>By Vicservers \u2013 Your Partner in Secure, High-Performance Hosting<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting Up a Firewall for Your Linux Server (UFW Tutorial) Introduction When it comes to server security, a firewall is your first line of defense. Whether you\u2019re running a personal blog or managing multiple cloud servers, an unprotected server is an open invitation to cyber threats. In this tutorial, we\u2019ll walk you through everything you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":100,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server-management"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Setting Up a Firewall for Your Linux Server (UFW Tutorial) - Vicservers<\/title>\n<meta name=\"description\" content=\"When it comes to server security, a firewall is your first line of defense. Whether you\u2019re running a personal blog or managing multiple cloud\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting Up a Firewall for Your Linux Server (UFW Tutorial) - Vicservers\" \/>\n<meta property=\"og:description\" content=\"When it comes to server security, a firewall is your first line of defense. Whether you\u2019re running a personal blog or managing multiple cloud\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Vicservers\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/web.facebook.com\/vicservershq\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-03T13:09:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vicservers.com\/blog\/wp-content\/uploads\/2025\/07\/Blog-Flyer-3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kenechukwu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@VicserversHQ\" \/>\n<meta name=\"twitter:site\" content=\"@VicserversHQ\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kenechukwu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/\"},\"author\":{\"name\":\"Kenechukwu\",\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/#\\\/schema\\\/person\\\/ebfb9711cfc796f625747417ea1da989\"},\"headline\":\"Setting Up a Firewall for Your Linux Server (UFW Tutorial)\",\"datePublished\":\"2025-07-03T13:09:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/\"},\"wordCount\":805,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/Blog-Flyer-3.jpg\",\"articleSection\":[\"Server Management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/\",\"url\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/\",\"name\":\"Setting Up a Firewall for Your Linux Server (UFW Tutorial) - Vicservers\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/Blog-Flyer-3.jpg\",\"datePublished\":\"2025-07-03T13:09:23+00:00\",\"description\":\"When it comes to server security, a firewall is your first line of defense. Whether you\u2019re running a personal blog or managing multiple cloud\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/Blog-Flyer-3.jpg\",\"contentUrl\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/Blog-Flyer-3.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting Up a Firewall for Your Linux Server (UFW Tutorial)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/\",\"name\":\"Vicservers\",\"description\":\"Vicservers | Web Hosting Company in Nigeria\",\"publisher\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/#organization\",\"name\":\"Vicservers\",\"url\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Vicservers-blog-logo.png\",\"contentUrl\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Vicservers-blog-logo.png\",\"width\":316,\"height\":64,\"caption\":\"Vicservers\"},\"image\":{\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/web.facebook.com\\\/vicservershq\",\"https:\\\/\\\/x.com\\\/VicserversHQ\",\"https:\\\/\\\/www.instagram.com\\\/vicservershq\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/#\\\/schema\\\/person\\\/ebfb9711cfc796f625747417ea1da989\",\"name\":\"Kenechukwu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c483f0fa02ad0326b6c2d87905584ba0f568a5b6a397b49b7ffe2180bd8316f3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c483f0fa02ad0326b6c2d87905584ba0f568a5b6a397b49b7ffe2180bd8316f3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c483f0fa02ad0326b6c2d87905584ba0f568a5b6a397b49b7ffe2180bd8316f3?s=96&d=mm&r=g\",\"caption\":\"Kenechukwu\"},\"url\":\"https:\\\/\\\/vicservers.com\\\/blog\\\/author\\\/kingknows\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting Up a Firewall for Your Linux Server (UFW Tutorial) - Vicservers","description":"When it comes to server security, a firewall is your first line of defense. Whether you\u2019re running a personal blog or managing multiple cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Setting Up a Firewall for Your Linux Server (UFW Tutorial) - Vicservers","og_description":"When it comes to server security, a firewall is your first line of defense. Whether you\u2019re running a personal blog or managing multiple cloud","og_url":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/","og_site_name":"Vicservers","article_publisher":"https:\/\/web.facebook.com\/vicservershq","article_published_time":"2025-07-03T13:09:23+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/vicservers.com\/blog\/wp-content\/uploads\/2025\/07\/Blog-Flyer-3.jpg","type":"image\/jpeg"}],"author":"Kenechukwu","twitter_card":"summary_large_image","twitter_creator":"@VicserversHQ","twitter_site":"@VicserversHQ","twitter_misc":{"Written by":"Kenechukwu","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/#article","isPartOf":{"@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/"},"author":{"name":"Kenechukwu","@id":"https:\/\/vicservers.com\/blog\/#\/schema\/person\/ebfb9711cfc796f625747417ea1da989"},"headline":"Setting Up a Firewall for Your Linux Server (UFW Tutorial)","datePublished":"2025-07-03T13:09:23+00:00","mainEntityOfPage":{"@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/"},"wordCount":805,"commentCount":0,"publisher":{"@id":"https:\/\/vicservers.com\/blog\/#organization"},"image":{"@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/vicservers.com\/blog\/wp-content\/uploads\/2025\/07\/Blog-Flyer-3.jpg","articleSection":["Server Management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/","url":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/","name":"Setting Up a Firewall for Your Linux Server (UFW Tutorial) - Vicservers","isPartOf":{"@id":"https:\/\/vicservers.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/vicservers.com\/blog\/wp-content\/uploads\/2025\/07\/Blog-Flyer-3.jpg","datePublished":"2025-07-03T13:09:23+00:00","description":"When it comes to server security, a firewall is your first line of defense. Whether you\u2019re running a personal blog or managing multiple cloud","breadcrumb":{"@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/#primaryimage","url":"https:\/\/vicservers.com\/blog\/wp-content\/uploads\/2025\/07\/Blog-Flyer-3.jpg","contentUrl":"https:\/\/vicservers.com\/blog\/wp-content\/uploads\/2025\/07\/Blog-Flyer-3.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/vicservers.com\/blog\/setting-up-a-firewall-for-your-linux-server-ufw-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vicservers.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Setting Up a Firewall for Your Linux Server (UFW Tutorial)"}]},{"@type":"WebSite","@id":"https:\/\/vicservers.com\/blog\/#website","url":"https:\/\/vicservers.com\/blog\/","name":"Vicservers","description":"Vicservers | Web Hosting Company in Nigeria","publisher":{"@id":"https:\/\/vicservers.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vicservers.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/vicservers.com\/blog\/#organization","name":"Vicservers","url":"https:\/\/vicservers.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vicservers.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/vicservers.com\/blog\/wp-content\/uploads\/2025\/05\/Vicservers-blog-logo.png","contentUrl":"https:\/\/vicservers.com\/blog\/wp-content\/uploads\/2025\/05\/Vicservers-blog-logo.png","width":316,"height":64,"caption":"Vicservers"},"image":{"@id":"https:\/\/vicservers.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/web.facebook.com\/vicservershq","https:\/\/x.com\/VicserversHQ","https:\/\/www.instagram.com\/vicservershq"]},{"@type":"Person","@id":"https:\/\/vicservers.com\/blog\/#\/schema\/person\/ebfb9711cfc796f625747417ea1da989","name":"Kenechukwu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c483f0fa02ad0326b6c2d87905584ba0f568a5b6a397b49b7ffe2180bd8316f3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c483f0fa02ad0326b6c2d87905584ba0f568a5b6a397b49b7ffe2180bd8316f3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c483f0fa02ad0326b6c2d87905584ba0f568a5b6a397b49b7ffe2180bd8316f3?s=96&d=mm&r=g","caption":"Kenechukwu"},"url":"https:\/\/vicservers.com\/blog\/author\/kingknows\/"}]}},"_links":{"self":[{"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":0,"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/media\/100"}],"wp:attachment":[{"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vicservers.com\/blog\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}