{"id":593,"date":"2024-09-14T10:49:47","date_gmt":"2024-09-14T10:49:47","guid":{"rendered":"https:\/\/fatreseller.in\/blog\/?p=593"},"modified":"2024-09-14T10:50:16","modified_gmt":"2024-09-14T10:50:16","slug":"enable-or-disable-ufw-firewall-on-ubuntu","status":"publish","type":"post","link":"https:\/\/fatreseller.in\/blog\/enable-or-disable-ufw-firewall-on-ubuntu\/","title":{"rendered":"How to Enable or Disable UFW Firewall on Ubuntu ?"},"content":{"rendered":"\n<p>Enable or disable UFW Firewall on <a href=\"https:\/\/fatreseller.in\/vps-hosting.html\">Ubuntu<\/a>, UFW (Uncomplicated Firewall) is a user-friendly front-end for managing iptables firewall rules in Ubuntu and other Linux distributions. It simplifies the process of setting up a firewall to control network traffic, allowing users to configure which services can be accessed and from where.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"604\" src=\"https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/ubuntu-firewall-ufw-configuration-1024x604.png\" alt=\"\" class=\"wp-image-596\" style=\"width:197px;height:auto\" srcset=\"https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/ubuntu-firewall-ufw-configuration-1024x604.png 1024w, https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/ubuntu-firewall-ufw-configuration-300x177.png 300w, https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/ubuntu-firewall-ufw-configuration-768x453.png 768w, https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/ubuntu-firewall-ufw-configuration.png 1220w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>By enabling UFW, you add a layer of security to your <a href=\"https:\/\/www.squarebrothers.com\/windows-vps-hosting-india\/\" rel=\"nofollow noopener\" target=\"_blank\">server <\/a>by blocking unwanted or malicious connections, while still allowing access to essential services like SSH, HTTP, and HTTPS. Disabling UFW, on the other hand, stops the firewall, which may be necessary in some troubleshooting scenarios <\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>You can follow these steps:<\/h2><nav><ul><li class=\"\"><a href=\"#1-check-ufw-status-to-enable-or-disable-ufw-firewall-on-ubuntu\">1. Check UFW Status to Enable or Disable UFW Firewall on Ubuntu<\/a><\/li><li class=\"\"><a href=\"#2-enable-ufw\">2. Enable UFW<\/a><\/li><li class=\"\"><a href=\"#3-disable-ufw\">3. Disable UFW<\/a><\/li><li class=\"\"><a href=\"#4-allow-specific-ports-optional\">4. Allow Specific Ports (Optional)<\/a><\/li><li class=\"\"><a href=\"#5-reload-ufw-rules-optional\">5. Reload UFW Rules (Optional)<\/a><ul><li class=\"\"><a href=\"#\"> <\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-check-ufw-status-to-enable-or-disable-ufw-firewall-on-ubuntu\">1. <strong>Check UFW Status<\/strong> to Enable or Disable UFW Firewall on Ubuntu<\/h3>\n\n\n\n<p>Before enabling or disabling UFW, it&#8217;s good to check if it&#8217;s currently active.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">   sudo ufw status<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Active<\/strong>: UFW is enabled and running.<\/li>\n\n\n\n<li><strong>Inactive<\/strong>: UFW is disabled.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-enable-ufw\">2. <strong>Enable UFW<\/strong><\/h3>\n\n\n\n<p>To enable the firewall and start blocking or allowing rules:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">   sudo ufw enable<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/1642682023539-1024x640.jpg\" alt=\"\" class=\"wp-image-597\" style=\"width:135px;height:auto\" srcset=\"https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/1642682023539-1024x640.jpg 1024w, https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/1642682023539-300x188.jpg 300w, https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/1642682023539-768x480.jpg 768w, https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/1642682023539.jpg 1152w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You will get a confirmation that UFW is enabled. It will start enforcing any configured rules.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-disable-ufw\">3. <strong>Disable UFW<\/strong><\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"980\" height=\"735\" src=\"https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/Ubuntu-980x735-optimized.png\" alt=\"Enable or Disable UFW Firewall on Ubuntu\" class=\"wp-image-594\" style=\"width:112px;height:auto\" srcset=\"https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/Ubuntu-980x735-optimized.png 980w, https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/Ubuntu-980x735-optimized-300x225.png 300w, https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/Ubuntu-980x735-optimized-768x576.png 768w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><\/figure><\/div>\n\n\n<p>To turn off the firewall:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">   sudo ufw disable<\/pre>\n\n\n\n<p>UFW will stop, and it will no longer enforce any firewall rules.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-allow-specific-ports-optional\">4. <strong>Allow Specific Ports (Optional)<\/strong><\/h3>\n\n\n\n<p>When enabling the firewall, ensure you allow necessary ports. For example, to allow SSH (port 22):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">   sudo ufw allow ssh<\/pre>\n\n\n\n<p>You can also allow other services by specifying their port numbers:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">   sudo ufw allow 80    # Allow HTTP\n   sudo ufw allow 443   # Allow HTTPS<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"5-reload-ufw-rules-optional\">5. <strong>Reload UFW Rules (Optional)<\/strong><\/h3>\n\n\n\n<p>After making changes, you can reload the firewall rules:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">   sudo ufw reload<\/pre>\n\n\n\n<p>This is how you can Enable or Disable UFW Firewall on Ubuntu and manage basic firewall settings on Ubuntu.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"353\" height=\"143\" src=\"https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/images.png\" alt=\"\" class=\"wp-image-595\" style=\"width:118px;height:auto\" srcset=\"https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/images.png 353w, https:\/\/fatreseller.in\/blog\/wp-content\/uploads\/2024\/09\/images-300x122.png 300w\" sizes=\"(max-width: 353px) 100vw, 353px\" \/><\/figure><\/div>\n\n\n<h6 class=\"wp-block-heading\"> <\/h6>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Enable or disable UFW Firewall on Ubuntu, UFW (Uncomplicated Firewall) is a user-friendly front-end for managing iptables firewall rules in Ubuntu and other Linux distributions. It simplifies the process of setting up a firewall to control network traffic, allowing users to configure which services can be accessed and from where. By enabling UFW, you add [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":598,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[66],"class_list":["post-593","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-enable-or-disable-ufw-firewall-on-ubuntu"],"_links":{"self":[{"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/posts\/593"}],"collection":[{"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/comments?post=593"}],"version-history":[{"count":1,"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/posts\/593\/revisions"}],"predecessor-version":[{"id":599,"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/posts\/593\/revisions\/599"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/media\/598"}],"wp:attachment":[{"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/media?parent=593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/categories?post=593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatreseller.in\/blog\/wp-json\/wp\/v2\/tags?post=593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}