Opening ports in the CSF (ConfigServer Security & Firewall) is essential for allowing specific network traffic to reach your server. Ports are communication endpoints identified by 16-bit numbers that enable IP addresses and Internet protocols to communicate with source or destination addresses. This guide shows you how to configure CSF through WHM to open the necessary ports for your server while maintaining security.

How to Do It

  1. Step 1: Access WHM

    Log into WHM with your root account credentials.

  2. Step 2: Navigate to Plugins

    Select the Plugins option from the navigation menu.

    WHM Plugins menu

  3. Step 3: Open ConfigServer Security & Firewall

    Click on ConfigServer Security & Firewall.

    ConfigServer Security & Firewall option

    The ConfigServer Security & Firewall panel will appear.

  4. Step 4: Access Firewall Configuration

    Go to the csf tab and click on the Firewall Configuration button in the csf-ConfigServer Firewall section.

    Firewall Configuration button

    Different customization options appear for the firewall.

  5. Step 5: Configure IPv4 Port Settings

    Select the IPv4 Port Settings section from the dropdown list.

  6. Step 6: Enter Port Numbers

    Copy or enter the following port numbers in the respective fields:

    Allow incoming TCP ports:

    20,21,22,25,53,80,110,143,443,465,587,993,995,2077,2078,2082,2083,2086,2087,2095,2096,26

    Allow outgoing TCP ports:

    20,21,22,25,37,43,53,80,110,113,443,587,873,2086,2087,2089,2703

    IPv4 port settings

    Although we recommend these port numbers, you can enter other port numbers as per your requirements.

  7. Step 7: Save Configuration

    Click the Change button at the end to save the changes you made to the firewall configuration.

  8. Step 8: Restart CSF

    Click on Restart csf+lfd to restart the CSF firewall and apply the changes.

    Restart CSF button