{"id":1060,"date":"2018-12-01T08:43:23","date_gmt":"2018-12-01T08:43:23","guid":{"rendered":"https:\/\/draculaservers.com\/tutorials\/?p=1060"},"modified":"2021-11-14T23:07:36","modified_gmt":"2021-11-14T23:07:36","slug":"configure-ufw-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/","title":{"rendered":"How to Configure a Firewall (UFW) on Ubuntu 18.04"},"content":{"rendered":"<p>UFW, also called Uncomplicated Firewall or sometimes Ubuntu Firewall, is an easy to use interface for <code>iptables<\/code>, that\u2019s great for filtering traffic and has good documentation. It\u2019s main purpose is to simplify managing <code>iptables<\/code>.<\/p>\n<p>In this tutorial you\u2019ll learn how to set up and use UFW on Ubuntu 18.04.<\/p>\n\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<ul>\n<li>A non-root sudo user. You can set one up by following our tutorial <a href=\"https:\/\/draculaservers.com\/tutorials\/create-sudo-user-ubuntu\/\"><strong>How to Create a Sudo User on Ubuntu<\/strong><\/a><\/li>\n<\/ul>\n<p>Ubuntu comes with UFW installed by default. Should it be uninstalled, for whatever reason, you can install it by running:<\/p>\n<pre><code>$ sudo apt install ufw<\/code><\/pre>\n<p>You can check the status of UFW by running:<\/p>\n<pre><code>$ sudo ufw status<\/code><\/pre>\n<p>You can check the list of available commands by running:<\/p>\n<pre><code>$ sudo ufw -h<\/code><\/pre>\n<h2 id=\"set-up-default-rules\">Set Up Default Rules<\/h2>\n<p>To set UFW default rules, run these commands:<\/p>\n<pre><code>$ sudo ufw default allow outgoing\n$ sudo ufw default deny incoming<\/code><\/pre>\n<h2 id=\"application-profiles\">Application Profiles<\/h2>\n<p>When you install an application using <code>apt<\/code>, it will add that application\u2019s <strong>profile<\/strong> to <code>\/etc\/ufw\/applications.d<\/code>. That profile contains some information about the server and settings for UFW.<\/p>\n<p>You can check the application profiles on your server by running:<\/p>\n<pre><code>$ sudo ufw app list<\/code><\/pre>\n<p>Here\u2019s my output:<\/p>\n<pre><code>Available applications:\n  Apache\n  Apache Full\n  Apache Secure\n  Nginx Full\n  Nginx HTTP\n  Nginx HTTPS\n  OpenSSH<\/code><\/pre>\n<p>If you\u2019re on a new server, your output may look like this:<\/p>\n<pre><code>Available applications:\n  OpenSSH<\/code><\/pre>\n<p>To view information about that application and included rules, then run:<\/p>\n<pre><code>$ sudo ufw app info OpenSSH<\/code><\/pre>\n<p>Output:<\/p>\n<pre><code>Profile: OpenSSH\nTitle: Secure shell server, an rshd replacement\nDescription: OpenSSH is a free implementation of the Secure Shell protocol.\n\nPort:\n  22\/tcp<\/code><\/pre>\n<p>As we can see, OpenSSH profile opens port <strong>22<\/strong>.<\/p>\n<p>Let\u2019s check another one, say <code>Apache Full<\/code>:<\/p>\n<pre><code>$ sudo ufw app info 'Apache Full' <\/code><\/pre>\n<p>Output:<\/p>\n<pre><code>Profile: Apache Full\nTitle: Web Server (HTTP,HTTPS)\nDescription: Apache v2 is the next generation of the omnipresent Apache web\nserver.\n\nPorts:\n  80,443\/tcp<\/code><\/pre>\n<p>The <code>Apache Full<\/code> profile opens ports <strong>80<\/strong> and <strong>443.<\/strong><\/p>\n<h2 id=\"allow-ssh-connections\">Allow SSH Connections<\/h2>\n<p>Before enabling UFW, we need to enable SSH connections. Given the fact that probably most of us are using our server via SSH, <strong>if we enable UFW without creating a rule to allow SSH, then we\u2019ll get locked out of the server<\/strong>, since the rule is not added by default.<\/p>\n<p>To configure UFW to allow SSH connections, run:<\/p>\n<pre><code>$ sudo ufw allow ssh<\/code><\/pre>\n<p>Output:<\/p>\n<pre><code>Rules updated\nRules updated (v6)<\/code><\/pre>\n<p>UFW knows to create firewall rules that will allow connections on port <strong>22<\/strong>, which is the port that the SSH service listens to by default. It knows this because SSH is listed as a service in the <code>\/etc\/services<\/code> file:<\/p>\n<pre><code>$ cat \/etc\/services | grep ssh\nssh                22\/tcp                                # SSH Remote Login Protocol<\/code><\/pre>\n<p>You can write the equivalent to this rule by specifying the <strong>port number<\/strong> you want to allow connections to, instead of using <strong>service name<\/strong>. Since SSH uses <strong>Port 22<\/strong>, the command would be:<\/p>\n<pre><code>$ sudo ufw allow 22<\/code><\/pre>\n<p>If you\u2019ve configured SSH to use a different port, other than <strong>22<\/strong>, then you can run the same command with the port you\u2019ve configured for SSH. Say your server is listening on port 45231 , the command would be:<\/p>\n<pre><code>$ sudo ufw allow 45231<\/code><\/pre>\n<h2 id=\"enable-ufw\">Enable UFW<\/h2>\n<p>Now that <strong>UFW is configured to allow incoming SSH connections<\/strong> and we have access to reconfigure it, should we make a mistake, we can enable it. To enable UFW, use this command:<\/p>\n<pre><code>$ sudo ufw enable<\/code><\/pre>\n<p>You\u2019ll receive a warning that says that enabling UFW may disrupt SSH connections. Since you\u2019ve already allowed connections on SSH, you can enter <code>y<\/code> and confirm:<\/p>\n<pre><code>Command may disrupt existing ssh connections. Proceed with operation (y|n)? y\nFirewall is active and enabled on system startup<\/code><\/pre>\n<h2 id=\"check-ufw-status-rules\">Check UFW Status &amp; Rules<\/h2>\n<p>Now the firewall is enabled and you can run <code>sudo ufw status<\/code> to check it\u2019s status and to see what rules are set:<\/p>\n<p>Here\u2019s my output right now, after allowing SSH:<\/p>\n<pre><code>Status: active\n\nTo                         Action      From\n--                         ------      ----\n22\/tcp                     ALLOW       Anywhere\n22\/tcp (v6)                ALLOW       Anywhere (v6)<\/code><\/pre>\n<p>To view a more detailed report, you can also add the parameter <code>verbose<\/code> :<\/p>\n<pre><code>$ sudo ufw status verbose<\/code><\/pre>\n<h2 id=\"allow-other-connections\">Allow Other Connections<\/h2>\n<p>You should also allow other connections that your server needs to respond to, depending on your needs. For example, web servers, like <strong>Apache<\/strong>, use port <code>80<\/code> for HTTP and port <code>443<\/code> for HTTPS<\/p>\n<p><strong>Allow Specific Ports<\/strong><\/p>\n<p>To allow access to port <code>80<\/code> for HTTP and <code>443<\/code> for HTTPS, we can write the rule to allow connections based on the <strong>port<\/strong> or <strong>service name<\/strong>, such as we did with SSH:<\/p>\n<pre><code>$ sudo ufw allow 80\n$ sudo ufw allow 443<\/code><\/pre>\n<p>OR<\/p>\n<pre><code>$ sudo ufw allow http\n$ sudo ufw allow https<\/code><\/pre>\n<p>Alternatively, since we have the <strong>application profile<\/strong> for <strong>Apache<\/strong>, we can use the <strong>application profile name<\/strong>, which opens up both ports <code>80<\/code> and <code>443<\/code>, as it shows when we run <code>sudo ufw app info 'Apache Full'<\/code>:<\/p>\n<pre><code>$ sudo ufw allow 'Apache Full'<\/code><\/pre>\n<p><strong>Allow Port Ranges<\/strong><\/p>\n<p>UFW also give us the option of allowing a range of ports. When allowing port ranges, however, you need to specify the protocol &#8211; <code>udp<\/code> or <code>tcp<\/code>:<\/p>\n<pre><code>$ sudo ufw allow 1000:2000\/tcp\n$ sudo ufw allow 1000:2000\/udp<\/code><\/pre>\n<p><strong>Allow Specific IP Addresses<\/strong><\/p>\n<p>If you want, for example, to whitelist an IP address and allow it access on all ports, you can add <code>from<\/code> followed by the IP address. Say my IP home\/work IP address is 196.148.222.123, then I\u2019d run:<\/p>\n<pre><code>$ sudo ufw allow from 196.148.222.123<\/code><\/pre>\n<p><strong>Allow Specific IP Addresses on Specific Ports<\/strong><\/p>\n<p>If you want to allow access to an IP address on a specific port, say <code>22<\/code> , and the IP I want to allow is 196.148.222.123, then I\u2019d run a command similar to when allowing an IP address on all ports, but specifying <code>to any<\/code> and followed by the port:<\/p>\n<pre><code>$ sudo ufw allow from 196.148.222.123 to any port 22 <\/code><\/pre>\n<p><strong>Allow Subnets<\/strong><\/p>\n<p>Allowing access to a subnet is similar to the one allowing access to a single IP address, but instead of the IP address you will have to use the <strong>CIDR notation<\/strong> to specify the netmask. Say I want to allow access to IPs ranging from 196.148.222.1 to 196.148.222.254, then I\u2019d run:<\/p>\n<pre><code>$ sudo ufw allow from 196.148.222.0\/24<\/code><\/pre>\n<p><strong>Allow Subnets on Specific Ports<\/strong><\/p>\n<p>To allow a subnet on a specific port, the command is similar to the previous example when allowing a single IP address on a specific port:<\/p>\n<pre><code>$ sudo ufw allow from 196.148.222.0\/24 to any port 22<\/code><\/pre>\n<p><strong>Allow Specific Network Interfaces<\/strong><\/p>\n<p>If you want to allow access only on specific network interfaces, then you can do this by using <code>allow in on<\/code> .<\/p>\n<p>We can check our network interfaces by running:<\/p>\n<pre><code>$ ip addr<\/code><\/pre>\n<p>Output:<\/p>\n<pre><code>1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\n...\n2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000\n...<\/code><\/pre>\n<p>The network interfaces are <code>lo<\/code> and <code>eth0<\/code>. Say I want to allow access on <code>eth0<\/code> for HTTP ( port <code>80<\/code> ). To do this I\u2019d run:<\/p>\n<pre><code>$ sudo ufw allow in on eth0 on any port 80<\/code><\/pre>\n<h2 id=\"deny-connections\">Deny Connections<\/h2>\n<p>The default policy for UFW is to deny all incoming connections, so unless you specify otherwise, UFW will deny all incoming connections.<\/p>\n<p>To write <strong>deny rules<\/strong>, you can use the <code>deny<\/code> subcommand similarly to how you use the <code>allow<\/code> subcommand. For example, if I want to deny all HTTP and HTTPS traffic I can run:<\/p>\n<pre><code>$ sudo ufw deny HTTP\n$ sudo ufw deny HTTPS<\/code><\/pre>\n<p>I can also deny HTTP and HTTPS by specifying the port numbers:<\/p>\n<pre><code>$ sudo ufw deny port 80\n$ sudo ufw deny port 443<\/code><\/pre>\n<p>If I\u2019m under attack from a certain IP address, then I can deny connections from that IP address:<\/p>\n<pre><code>$ sudo ufw deny from 196.148.222.123<\/code><\/pre>\n<p>Writing <code>deny<\/code> rules is the same as with <code>allow<\/code> rules. You just have to replace <code>allow<\/code> with <code>deny<\/code>.<\/p>\n<h2 id=\"delete-rules\">Delete Rules<\/h2>\n<p>There are two ways you can delete rules. You can either delete them by the <strong>rule number<\/strong> or by specifying the rule.<\/p>\n<p>To check the rules by their number you can run the following command:<\/p>\n<pre><code>$ sudo ufw status numbered<\/code><\/pre>\n<p>And you\u2019ll get an output like this:<\/p>\n<pre><code>Status: active\n\n     To                         Action      From\n     --                         ------      ----\n[ 1] 22\/tcp                     ALLOW IN    Anywhere                  \n[ 2] 80\/tcp                     ALLOW IN    Anywhere                  \n[ 3] 443\/tcp                    ALLOW IN    Anywhere                  \n[ 4] 22\/tcp (v6)                ALLOW IN    Anywhere (v6)             \n[ 5] 80\/tcp (v6)                ALLOW IN    Anywhere (v6)             \n[ 6] 443\/tcp (v6)               ALLOW IN    Anywhere (v6)<\/code><\/pre>\n<p>If you\u2019d like to delete rule number <strong>2<\/strong>, you can use the <code>delete<\/code> subcommand followed by the rule number:<\/p>\n<pre><code>$ sudo ufw delete 2<\/code><\/pre>\n<p>Alternatively, you can delete it by specifying the actual rule. For example if you created the rule using <code>sudo ufw allow 80\/tcp<\/code> you can run:<\/p>\n<pre><code>$ sudo ufw delete allow 80\/tcp<\/code><\/pre>\n<p>You can also delete by <strong>service name<\/strong>:<\/p>\n<pre><code>$ sudo ufw delete allow https<\/code><\/pre>\n<p>This will delete both IPv4 and IPv6 rules.<\/p>\n<h2 id=\"enabling-ipv6-support-optional\">Enabling IPv6 Support (Optional)<\/h2>\n<p>This tutorial is written with IPv4 in mind, however you may have noticed that I\u2019ve had IPv6 enabled. Should you not have IPv6 enabled you can configure UFW to support it by editing the UFW configuration file in your favorite editor:<\/p>\n<pre><code>$ sudo nano \/etc\/default\/ufw<\/code><\/pre>\n<p>And make sure that the value of <code>IPV6<\/code> is set to <code>yes<\/code>:<\/p>\n<pre><code>...\nIPV6=yes\n...<\/code><\/pre>\n<p>Save and close the file when you\u2019re finished.<\/p>\n<p>To apply the changes, restart UFW by disabling and re-enabling it:<\/p>\n<pre><code>$ sudo ufw disable\n$ sudo ufw enable<\/code><\/pre>\n<h2 id=\"disable-reload-restart-ufw\">Disable\/Reload\/Restart UFW<\/h2>\n<p>To disable UFW use the <code>disable<\/code> subcommand:<\/p>\n<pre><code>$ sudo ufw disable<\/code><\/pre>\n<p>If you need to reload ( reload rules ) use the <code>reload<\/code> subcommand:<\/p>\n<pre><code>$ sudo ufw reload<\/code><\/pre>\n<p>To restart UFW, you\u2019ll have to <code>disable<\/code> and <code>enable<\/code> it again:<\/p>\n<pre><code>$ sudo ufw disable\n$ sudo ufw enable<\/code><\/pre>\n<h2 id=\"reset-to-default-settings\">Reset to Default Settings<\/h2>\n<p>If you\u2019ve already configured UFW but need to reset it back to default settings then you can run the <code>reset<\/code> command:<\/p>\n<pre><code>$ sudo ufw reset<\/code><\/pre>\n<p>Output:<\/p>\n<pre><code>Resetting all rules to installed defaults. This may disrupt existing ssh\nconnections. Proceed with operation (y|n)?<\/code><\/pre>\n<p>This will <strong>disable UFW<\/strong> and delete any rules that you previously configured and give you a fresh start.<\/p>\n<p><strong>IMPORTANT:<\/strong> If you plan to enable it again, then remember to allow SSH connections again, or you won\u2019t be able to SSH into the server.<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Well done! You\u2019ve learned how to configure UFW Firewall and secure your Ubuntu 18.04 machine. If you plan to remotely connect then remember to allow SSH access, allow other connections that your server needs, and limit any unnecessary connections to keep your server secure.<\/p>\n<p>If you&#8217;re looking for a high-performance VPS at entry-level prices, then feel free to check out <a href=\"https:\/\/draculaservers.com\/kvm.php\">our KVM Plans<\/a>. Our plans start at <strong>1GB RAM + 10GB SSD for only $9.99\/mo<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UFW, also called Uncomplicated Firewall or sometimes Ubuntu Firewall, is an easy to use interface for iptables, that\u2019s great for filtering traffic and has good documentation. It\u2019s main purpose is to simplify managing iptables. In this tutorial you\u2019ll learn how to set up and use UFW on Ubuntu 18.04. Prerequisites A non-root sudo user. You [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1069,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2,22],"tags":[50,49,34,44],"class_list":["post-1060","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-getting-started","category-linux-basics","category-ubuntu","tag-firewall","tag-security","tag-ubuntu","tag-ubuntu-18-04"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"featured_image_urls_v2":{"full":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png",1024,512,false],"thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04-150x150.png",150,150,true],"medium":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04-300x150.png",300,150,true],"medium_large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04-768x384.png",768,384,true],"large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png",1024,512,false],"1536x1536":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png",1024,512,false],"2048x2048":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png",1024,512,false],"pk-small":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04-80x80.png",80,80,true],"pk-thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04-300x225.png",300,225,true]},"post_excerpt_stackable_v2":"<p>UFW, also called Uncomplicated Firewall or sometimes Ubuntu Firewall, is an easy to use interface for iptables, that\u2019s great for filtering traffic and has good documentation. It\u2019s main purpose is to simplify managing iptables. In this tutorial you\u2019ll learn how to set up and use UFW on Ubuntu 18.04. Prerequisites A non-root sudo user. You can set one up by following our tutorial How to Create a Sudo User on Ubuntu Ubuntu comes with UFW installed by default. Should it be uninstalled, for whatever reason, you can install it by running: $ sudo apt install ufw You can check the&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/draculaservers.com\/tutorials\/category\/getting-started\/\" rel=\"category tag\">Getting Started<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/linux-basics\/\" rel=\"category tag\">Linux Basics<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/ubuntu\/\" rel=\"category tag\">Ubuntu<\/a>","author_info_v2":{"name":"Vlad","url":"https:\/\/draculaservers.com\/tutorials\/author\/vlad\/"},"comments_num_v2":"0 comments","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Configure a Firewall (UFW) on Ubuntu 18.04 - Dracula Servers<\/title>\n<meta name=\"description\" content=\"UFW, also called Uncomplicated Firewall or sometimes Ubuntu Firewall, is an easy to use interface for iptables. In this tutorial you\u2019ll learn how to set up and use UFW on Ubuntu 18.04.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Configure a Firewall (UFW) on Ubuntu 18.04 - Dracula Servers\" \/>\n<meta property=\"og:description\" content=\"UFW, also called Uncomplicated Firewall or sometimes Ubuntu Firewall, is an easy to use interface for iptables. In this tutorial you\u2019ll learn how to set up and use UFW on Ubuntu 18.04.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Dracula Servers Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-01T08:43:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-14T23:07:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vlad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vlad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/\"},\"author\":{\"name\":\"Vlad\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\"},\"headline\":\"How to Configure a Firewall (UFW) on Ubuntu 18.04\",\"datePublished\":\"2018-12-01T08:43:23+00:00\",\"dateModified\":\"2021-11-14T23:07:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/\"},\"wordCount\":1309,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png\",\"keywords\":[\"Firewall\",\"Security\",\"Ubuntu\",\"Ubuntu 18.04\"],\"articleSection\":[\"Getting Started\",\"Linux Basics\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/\",\"name\":\"How to Configure a Firewall (UFW) on Ubuntu 18.04 - Dracula Servers\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png\",\"datePublished\":\"2018-12-01T08:43:23+00:00\",\"dateModified\":\"2021-11-14T23:07:36+00:00\",\"description\":\"UFW, also called Uncomplicated Firewall or sometimes Ubuntu Firewall, is an easy to use interface for iptables. In this tutorial you\u2019ll learn how to set up and use UFW on Ubuntu 18.04.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png\",\"width\":1024,\"height\":512,\"caption\":\"configure_ufw_firewall_ubuntu_18.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/configure-ufw-ubuntu-18-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Configure a Firewall (UFW) on Ubuntu 18.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"name\":\"Dracula Servers Tutorials\",\"description\":\"Dedicated Servers\",\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\",\"name\":\"Dracula Servers\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"width\":1625,\"height\":200,\"caption\":\"Dracula Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\",\"name\":\"Vlad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"caption\":\"Vlad\"},\"description\":\"Tech Support\",\"sameAs\":[\"https:\\\/\\\/draculaservers.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Configure a Firewall (UFW) on Ubuntu 18.04 - Dracula Servers","description":"UFW, also called Uncomplicated Firewall or sometimes Ubuntu Firewall, is an easy to use interface for iptables. In this tutorial you\u2019ll learn how to set up and use UFW on Ubuntu 18.04.","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:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Configure a Firewall (UFW) on Ubuntu 18.04 - Dracula Servers","og_description":"UFW, also called Uncomplicated Firewall or sometimes Ubuntu Firewall, is an easy to use interface for iptables. In this tutorial you\u2019ll learn how to set up and use UFW on Ubuntu 18.04.","og_url":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/","og_site_name":"Dracula Servers Tutorials","article_published_time":"2018-12-01T08:43:23+00:00","article_modified_time":"2021-11-14T23:07:36+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png","type":"image\/png"}],"author":"Vlad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vlad","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/#article","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/"},"author":{"name":"Vlad","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e"},"headline":"How to Configure a Firewall (UFW) on Ubuntu 18.04","datePublished":"2018-12-01T08:43:23+00:00","dateModified":"2021-11-14T23:07:36+00:00","mainEntityOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/"},"wordCount":1309,"commentCount":0,"publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png","keywords":["Firewall","Security","Ubuntu","Ubuntu 18.04"],"articleSection":["Getting Started","Linux Basics","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/","url":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/","name":"How to Configure a Firewall (UFW) on Ubuntu 18.04 - Dracula Servers","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/#primaryimage"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png","datePublished":"2018-12-01T08:43:23+00:00","dateModified":"2021-11-14T23:07:36+00:00","description":"UFW, also called Uncomplicated Firewall or sometimes Ubuntu Firewall, is an easy to use interface for iptables. In this tutorial you\u2019ll learn how to set up and use UFW on Ubuntu 18.04.","breadcrumb":{"@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/#primaryimage","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/12\/How-to-Configure-a-Firewall-UFW-on-Ubuntu-18.04.png","width":1024,"height":512,"caption":"configure_ufw_firewall_ubuntu_18.04"},{"@type":"BreadcrumbList","@id":"https:\/\/draculaservers.com\/tutorials\/configure-ufw-ubuntu-18-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/draculaservers.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to Configure a Firewall (UFW) on Ubuntu 18.04"}]},{"@type":"WebSite","@id":"https:\/\/draculaservers.com\/tutorials\/#website","url":"https:\/\/draculaservers.com\/tutorials\/","name":"Dracula Servers Tutorials","description":"Dedicated Servers","publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/draculaservers.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/draculaservers.com\/tutorials\/#organization","name":"Dracula Servers","url":"https:\/\/draculaservers.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","width":1625,"height":200,"caption":"Dracula Servers"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e","name":"Vlad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","caption":"Vlad"},"description":"Tech Support","sameAs":["https:\/\/draculaservers.com"]}]}},"_links":{"self":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/1060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/comments?post=1060"}],"version-history":[{"count":1,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/1060\/revisions"}],"predecessor-version":[{"id":2238,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/1060\/revisions\/2238"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media\/1069"}],"wp:attachment":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media?parent=1060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/categories?post=1060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/tags?post=1060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}