How to configure firewall on Hostinger

intermediate 12 min read Updated 2026-03-13
Quick Answer

Use Hostinger's managed VPS firewall in hPanel: create a firewall group, add accept rules for ports 22 (SSH), 80 (HTTP), and 443 (HTTPS) from anywhere, then activate it. This drops all other incoming traffic by default, so always add SSH rule first to avoid lockouts. Test ports after activation using telnet or SSH.

Prerequisites

  • Active Hostinger VPS
  • hPanel access credentials
  • SSH details (IP and root password/key)
  • Basic knowledge of ports and protocols
  • Server backup or snapshot

Step-by-Step Instructions

1

Log in to hPanel and select VPS

Log in to your hPanel at hPanel.hostinger.com and navigate to the VPS section. Select the VPS server you want to configure by clicking on it.
2

Access Firewall settings

In the left sidebar, click SecurityFirewall (or directly Firewall in some views).
3

Create new firewall group

Click Add Firewall (or + Add New Firewall Rule / Create firewall configuration). Enter a firewall name (e.g., "main-firewall") and click Create.
Choose a descriptive name like 'web-ssh-firewall' for easy management.
4

Edit the firewall group

Locate the new firewall group in the list, click the ellipsis button (⋯) next to it, and select Edit.
5

Add SSH rule (port 22)

In the Add firewall rule section: Select action: Accept, protocol: TCP, port: 22, traffic source: Anywhere (0.0.0.0/0). Click Add rule. Always add this first to prevent lockout.
Test SSH before proceeding: <code>telnet YOUR_VPS_IP 22</code>.
6

Add HTTP rule (port 80)

Add another rule: action: Accept, protocol: TCP, port: 80, source: Anywhere. Click Add rule.
7

Add HTTPS rule (port 443)

Add final basic rule: action: Accept, protocol: TCP, port: 443, source: Anywhere. Click Add rule.
For custom apps, add their ports (e.g., TCP 3000:4000).
8

Save and apply rules

Click Save or Apply to update the firewall group.
9

Activate the firewall

Return to the Firewall list, find your group, click the ellipsis (⋯), and select Activate (toggle on). Wait up to 5 minutes for activation.
Monitor status; it shows as enabled when active.
10

Test and verify

Test ports: SSH to port 22, browse HTTP/HTTPS on 80/443. Use telnet YOUR_VPS_IP 22 or telnet YOUR_VPS_IP 80 from terminal.
If issues arise, deactivate via hPanel and re-edit.

Common Issues & Troubleshooting

Locked out of SSH (port 22) after activation

Deactivate firewall via hPanel → VPS → Firewall (wait 5 mins), add Accept TCP 22 Anywhere rule first, reactivate, and test with <code>telnet YOUR_VPS_IP 22</code>.

Website inaccessible (ports 80/443)

Ensure Accept TCP rules for ports 80 and 443 from Anywhere are added and saved before activation. Test with browser or <code>telnet YOUR_VPS_IP 443</code>.

Firewall activation takes too long

Wait up to 5 minutes as shown in hPanel status. If stuck, refresh page or check VPS overview for errors.

Custom app ports blocked

Edit firewall group via ellipsis → Add rule for your app's protocol/port (e.g., TCP 3000), source Anywhere or specific IP/CIDR, save, and reactivate.

Need to reset firewall

In VPS dashboard, find Reset firewall configuration option under Main settings and click Reset, then reconfigure.

Exclusive Deal

Affiliate link. We may earn a commission at no extra cost to you.