{"id":5230,"date":"2024-09-01T22:10:17","date_gmt":"2024-09-01T16:40:17","guid":{"rendered":"https:\/\/www.veeble.org\/kb\/?p=5230"},"modified":"2025-03-14T11:37:06","modified_gmt":"2025-03-14T06:07:06","slug":"how-to-open-a-specific-port-on-linux","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/how-to-open-a-specific-port-on-linux\/","title":{"rendered":"How to Open a Specific Port on Linux"},"content":{"rendered":"\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/Opening-Specific-Ports-on-Linux.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"332\" data-id=\"5234\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/Opening-Specific-Ports-on-Linux.jpg\" alt=\"How to Open a Specific Port on Linux\" class=\"wp-image-5234\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/Opening-Specific-Ports-on-Linux.jpg 1200w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/Opening-Specific-Ports-on-Linux-300x83.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/Opening-Specific-Ports-on-Linux-1024x283.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/Opening-Specific-Ports-on-Linux-768x212.jpg 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p>On a Linux system, opening a specific port is essential for allowing network traffic, running specific services, or enabling applications to communicate with other devices. This short tutorial will walk you through opening a port using <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/xenial\/man8\/ufw.8.html\" target=\"_blank\" rel=\"noopener\">UFW (Uncomplicated Firewall)<\/a>, <a href=\"https:\/\/man7.org\/linux\/man-pages\/man8\/iptables.8.html\" target=\"_blank\" rel=\"noopener\">IPtables<\/a>, <a href=\"https:\/\/manpages.debian.org\/testing\/firewalld\/firewall-cmd.1.en.html\" target=\"_blank\" rel=\"noopener\">FirewallD<\/a>, or starting a service. If you are looking for a tutorial to open a port in Linux, please check our tutorial: <a href=\"https:\/\/www.veeble.org\/kb\/how-to-close-a-specific-port-on-linux\/\" target=\"_blank\" rel=\"noopener\">How to Close a Specific Port on Linux<\/a><\/p>\n\n\n\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-2e8023ae      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tTable Of Contents\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#how-to-check-open-ports-on-linux\" class=\"uagb-toc-link__trigger\">How to Check Open Ports on Linux<\/a><li class=\"uagb-toc__list\"><a href=\"#how-to-open-a-port-using-ufw-uncomplicated-firewall\" class=\"uagb-toc-link__trigger\">How to Open a Port Using UFW (Uncomplicated Firewall)<\/a><li class=\"uagb-toc__list\"><a href=\"#how-to-open-a-port-using-iptables\" class=\"uagb-toc-link__trigger\">How to Open a Port Using IPtables<\/a><li class=\"uagb-toc__list\"><a href=\"#how-to-open-a-port-using-firewalld\" class=\"uagb-toc-link__trigger\">How to Open a Port Using Firewalld<\/a><li class=\"uagb-toc__list\"><a href=\"#how-to-start-a-service-to-open-a-port\" class=\"uagb-toc-link__trigger\">How to Start a Service to Open a Port<\/a><li class=\"uagb-toc__list\"><a href=\"#simple-powerful-windows-vps-hosting\" class=\"uagb-toc-link__trigger\">Simple, Powerful Windows VPS Hosting<\/a><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-check-open-ports-on-linux\">How to Check Open Ports on Linux<\/h3>\n\n\n<p>Before opening a port, it is a good idea to see which ports are already open. You can use one of these commands:<\/p>\n\n\n\n<p><strong>Using netstat:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo netstat -tuln<\/pre>\n\n\n\n<p>This command lists all the currently open ports. Below is a sample output where the open ports are underlined in red (e.g., 22 and 53).<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/netstat-tuln-output.webp\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"862\" height=\"165\" data-id=\"5237\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/netstat-tuln-output.webp\" alt=\"sample output of netstat command to check open ports\" class=\"wp-image-5237\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/netstat-tuln-output.webp 862w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/netstat-tuln-output-300x57.webp 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/netstat-tuln-output-768x147.webp 768w\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Using ss:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ss -tuln<\/pre>\n\n\n\n<p>This command provides similar information to <code>netstat<\/code> and is often preferred for its additional options and efficiency.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/ss-tuln-output.webp\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"881\" height=\"146\" data-id=\"5238\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/ss-tuln-output.webp\" alt=\"sample output of ss command to check open ports\" class=\"wp-image-5238\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/ss-tuln-output.webp 881w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/ss-tuln-output-300x50.webp 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/ss-tuln-output-768x127.webp 768w\" sizes=\"auto, (max-width: 881px) 100vw, 881px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Using lsof:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-verse\">The <code>lsof<\/code> command is mostly not preinstalled on Linux systems. You need to manually install this command to use. If you are using a Debian-based system like Ubuntu, use the command: <code>sudo apt-get install lsof<\/code> to install. For Centos\/Redhat: <code>sudo yum install lsof<\/code> and for Fedora: <code>sudo dnf install lsof<\/code><\/pre>\n\n\n\n<p>After installing, run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo lsof -i -P -n<\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/lsof-i-P-n-output.webp\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1101\" height=\"143\" data-id=\"5240\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/lsof-i-P-n-output.webp\" alt=\"sample output of lsof command to check open ports\" class=\"wp-image-5240\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/lsof-i-P-n-output.webp 1101w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/lsof-i-P-n-output-300x39.webp 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/lsof-i-P-n-output-1024x133.webp 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/lsof-i-P-n-output-768x100.webp 768w\" sizes=\"auto, (max-width: 1101px) 100vw, 1101px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p>These commands will list all the open ports on your system, allowing you to verify whether the port you want to open is already open.<\/p>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-open-a-port-using-ufw-uncomplicated-firewall\">How to Open a Port Using UFW (Uncomplicated Firewall)<\/h3>\n\n\n<p>For Ubuntu and other Debian-based systems, UFW is a straightforward firewall management application.<\/p>\n\n\n\n<p><strong>Install UFW (if it\u2019s not installed):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install ufw<br>sudo ufw enable<\/pre>\n\n\n\n<p><strong>Open the Port:<\/strong><\/p>\n\n\n\n<p>Replace <code>&lt;port_number&gt;<\/code> with the port number you want to open.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ufw allow &lt;port_number&gt;<\/pre>\n\n\n\n<p>This command will open the specified port. For example, to open port 80:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ufw allow 80<\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/sudo-ufw-allow-22.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"812\" height=\"83\" data-id=\"5243\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/sudo-ufw-allow-22.png\" alt=\"open specific port using ufw on linux\" class=\"wp-image-5243\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-ufw-allow-22.png 812w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-ufw-allow-22-300x31.png 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-ufw-allow-22-768x79.png 768w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><strong>Check UFW Status:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ufw status<\/pre>\n\n\n\n<p>This command will show the current status of UFW, including which ports are allowed.<\/p>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-open-a-port-using-iptables\">How to Open a Port Using IPtables<\/h3>\n\n\n<p>IPtables is a powerful tool for controlling firewall rules on Linux.<\/p>\n\n\n\n<p><strong>Install IPtables (if not installed):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install iptables<\/pre>\n\n\n\n<p><strong>Allow the Port:<\/strong><\/p>\n\n\n\n<p>Replace <code>&lt;port_number&gt;<\/code> with the port number you want to open.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo iptables -A INPUT -p tcp --dport &lt;port_number&gt; -j ACCEPT<br>sudo iptables -A INPUT -p udp --dport &lt;port_number&gt; -j ACCEPT<\/pre>\n\n\n\n<p>This command will open the specified port for both TCP and UDP protocols. For example, to open port 80:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT<br>sudo iptables -A INPUT -p udp --dport 80 -j ACCEPT<\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/sudo-iptables-A-INPUT-p-tcp-dport-80-j-ACCEPT.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"771\" height=\"67\" data-id=\"5245\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/sudo-iptables-A-INPUT-p-tcp-dport-80-j-ACCEPT.png\" alt=\"Open specific port using IPtables on Linux\" class=\"wp-image-5245\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-iptables-A-INPUT-p-tcp-dport-80-j-ACCEPT.png 771w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-iptables-A-INPUT-p-tcp-dport-80-j-ACCEPT-300x26.png 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-iptables-A-INPUT-p-tcp-dport-80-j-ACCEPT-768x67.png 768w\" sizes=\"auto, (max-width: 771px) 100vw, 771px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Save IPtables Rules:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On Debian-based systems: <code>sudo sh -c \"iptables-save &gt; \/etc\/iptables\/rules.v4\"<\/code><\/li>\n\n\n\n<li>On Red Hat-based systems: <code>sudo service iptables save<\/code><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-open-a-port-using-firewalld\">How to Open a Port Using Firewalld<\/h3>\n\n\n<p>Firewalld is the default firewall management tool for CentOS and Fedora.<\/p>\n\n\n\n<p><strong>Install Firewalld (if not installed):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo yum install firewalld<\/pre>\n\n\n\n<p><strong>Open the Port:<\/strong><\/p>\n\n\n\n<p>Replace <code>&lt;port_number&gt;<\/code> with the port number you want to open.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --permanent --add-port=&lt;port_number&gt;\/tcp<br>sudo firewall-cmd --permanent --add-port=&lt;port_number&gt;\/udp<\/pre>\n\n\n\n<p>For example, to open port 80:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --permanent --add-port=80\/tcp<br>sudo firewall-cmd --permanent --add-port=80\/udp<\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-7 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/sudo-firewall-cmd-permanent-add-port80-tcp.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"78\" data-id=\"5247\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/sudo-firewall-cmd-permanent-add-port80-tcp.png\" alt=\"Open specific port using FirewallD on Linux\" class=\"wp-image-5247\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-firewall-cmd-permanent-add-port80-tcp.png 770w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-firewall-cmd-permanent-add-port80-tcp-300x30.png 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-firewall-cmd-permanent-add-port80-tcp-768x78.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Reload Firewalld:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --reload<\/pre>\n\n\n\n<p><strong>Check Firewalld Status:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --list-all<\/pre>\n\n\n\n<p>This command lists all the current configurations, including open ports.<\/p>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-start-a-service-to-open-a-port\">How to Start a Service to Open a Port<\/h3>\n\n\n<p>Sometimes, a port is closed because a service is not running. Starting the service will open the associated port.<\/p>\n\n\n\n<p><strong>Identify the Service:<\/strong><\/p>\n\n\n\n<p>Use <strong>netstat<\/strong>, <strong>ss<\/strong>, or <strong>lsof<\/strong> to find which service is associated with the port.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo netstat -tuln | grep &lt;port_number&gt;<\/pre>\n\n\n\n<p>OR<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ss -tuln | grep &lt;port_number&gt;<\/pre>\n\n\n\n<p>OR<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo lsof -i :&lt;port_number&gt;<\/pre>\n\n\n\n<p>Replace <code>&lt;port_number&gt;<\/code> with the actual port number.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-8 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/sudo-lsof-i.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1255\" height=\"172\" data-id=\"5249\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/sudo-lsof-i.png\" alt=\"checking service name with port associated with it on Linux\" class=\"wp-image-5249\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-lsof-i.png 1255w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-lsof-i-300x41.png 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-lsof-i-1024x140.png 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/sudo-lsof-i-768x105.png 768w\" sizes=\"auto, (max-width: 1255px) 100vw, 1255px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Start the Service:<\/strong><\/p>\n\n\n\n<p>Replace <code>&lt;service_name&gt;<\/code> with the name of the service.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl start &lt;service_name&gt;<\/pre>\n\n\n\n<p>For example, to start the Apache web server:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl start httpd<\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-9 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/starting-a-service-in-linux.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"71\" data-id=\"5251\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/09\/starting-a-service-in-linux.png\" alt=\"Starting a service in Linux\" class=\"wp-image-5251\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/starting-a-service-in-linux.png 816w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/starting-a-service-in-linux-300x26.png 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/starting-a-service-in-linux-768x67.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Enable the Service (if needed):<\/strong><\/p>\n\n\n\n<p>This command ensures the service starts at boot.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl enable &lt;service_name&gt;<\/pre>\n\n\n\n<div class=\"wp-block-uagb-separator uagb-block-2cfec2a6\"><div class=\"wp-block-uagb-separator__inner\" style=\"--my-background-image:\"><\/div><\/div>\n\n\n\n<p>On Linux, there are multiple methods to open a port: UFW, IPtables, Firewalld, or starting a service. Choose the method that best suits your needs. UFW is simple and effective for Debian-based distributions, IPtables offers more control, and Firewalld is ideal for Red Hat-based distributions. Starting a service directly is effective when dealing with a specific application. Ensure you correctly identify the service and port before making changes.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>If you&#8217;re looking to get those ports opened up in Windows, you&#8217;re in luck! We\u2019ve got a fantastic blog post that dives into all the details you need. Check it out: <a href=\"https:\/\/www.veeble.com\/kb\/how-to-open-ports-windows-firewall-easily-safely\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.veeble.com\/kb\/how-to-open-ports-windows-firewall-easily-safely\/<\/a><\/p>\n<\/blockquote>\n\n\n\n<div style=\"height:45px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-5b3744de wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Simple, Powerful Windows VPS Hosting<\/h3><p class=\"uagb-cta__desc\">Get started quickly and easily with our intuitive Windows VPS platform. Focus on your business, not server management.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/in\/windows-vps\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">Get Your VPS Now<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n\n\n\n<div style=\"height:45px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Related Blogs:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-veeble-hosting wp-block-embed-veeble-hosting\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"D8pnYyxnGa\"><a href=\"https:\/\/www.veeble.com\/kb\/how-to-find-the-process-which-uses-the-port-in-linux-and-windows\/\">How to find the process using port in Linux and Windows?<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;How to find the process using port in Linux and Windows?&#8221; &#8212; Veeble Hosting\" src=\"https:\/\/www.veeble.com\/kb\/how-to-find-the-process-which-uses-the-port-in-linux-and-windows\/embed\/#?secret=dc3jPYX8ip#?secret=D8pnYyxnGa\" data-secret=\"D8pnYyxnGa\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-veeble-hosting wp-block-embed-veeble-hosting\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"WZbFsduGOk\"><a href=\"https:\/\/www.veeble.com\/kb\/how-to-close-a-specific-port-on-linux\/\">How to Close a Specific Port on Linux<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;How to Close a Specific Port on Linux&#8221; &#8212; Veeble Hosting\" src=\"https:\/\/www.veeble.com\/kb\/how-to-close-a-specific-port-on-linux\/embed\/#?secret=HN4LFSoxcZ#?secret=WZbFsduGOk\" data-secret=\"WZbFsduGOk\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to open a specific port on Linux using UFW, IPtables, Firewalld, or by stopping services with this step-by-step tutorial.<\/p>\n","protected":false},"author":7,"featured_media":8071,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[5],"tags":[],"class_list":["post-5230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/How-to-Open-a-Specific-Port-on-Linux.jpg",1366,768,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/How-to-Open-a-Specific-Port-on-Linux-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/How-to-Open-a-Specific-Port-on-Linux-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/How-to-Open-a-Specific-Port-on-Linux-768x432.jpg",768,432,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/How-to-Open-a-Specific-Port-on-Linux-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/How-to-Open-a-Specific-Port-on-Linux.jpg",1366,768,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/09\/How-to-Open-a-Specific-Port-on-Linux.jpg",1366,768,false]},"uagb_author_info":{"display_name":"Adrian Antony","author_link":"https:\/\/www.veeble.com\/kb\/author\/adrian\/"},"uagb_comment_info":0,"uagb_excerpt":"Learn how to open a specific port on Linux using UFW, IPtables, Firewalld, or by stopping services with this step-by-step tutorial.","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/5230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=5230"}],"version-history":[{"count":20,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/5230\/revisions"}],"predecessor-version":[{"id":7500,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/5230\/revisions\/7500"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/8071"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=5230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=5230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=5230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}