How To Open Ports via WHM or Command Line

This article will explain how you can open ports for your server in CSF.

Please be aware that opening ports on your server can be a security risk, please be aware of any risks when opening a specific port on your server.

There are 2 different ways to open ports on your server. One way is through WHM and one is via command line.

Steps to open ports in WHM


1.) Log in to your WHM: SERVER-IP/WHM

2.) Click “ConfigServer Security & Firewall,” which is under the “Plugins” section



3.) Go to "Firewall Configuration"



4.) Find "TCP_IN=" under "IPv4 Port Settings"



5.) Enter the port number in the list below. Make sure to separate ports with a single comma and do not enter any spaces.

6.) Click "Change" at the bottom of the page.



This will reset the firewall so that the ports that you have opened will take effect.

Steps to open ports via command line


1.) SSH into your server.

2.) Go to the directory with the CSF configuration file.



3.) Open the file "csf.conf"



4.) Once you are in the configuration file, find "TCP_IN=", it will be under "# Allow incoming TCP ports"



5.) Within the quotation marks, put the port number that you wish to open. Separate each IP using a single comma and no spaces.

6.) Close the file and save all changes.

7.) Restart the firewall.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

CSF command not found in cPanel/WHM server

CSF – Config server firewall is a firewall configuration tool for WHM/cPanel server. CSF is...

How to install ConfigServer Security & Firewall

ConfigServer Firewall, also known as CSF, is a firewall configuration script created to provide...

How to install ConfigServer Explorer (cse)

To install or upgrade cse simply do the following from the root shell via SSH: cd /usr/src rm...

Fix False Downtime Reports of Your Server

Many of our clients are using uptimerobot to ensure the uptime status of their servers. Some of...

How to ignore emails/messages sent by CSF/LFD

Many peoples would like to ignore messages sent by CSF/LFD. So, we're writing a tutorial to guide...