How to configure firewall on Hostinger
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
Log in to hPanel and select VPS
Access Firewall settings
Create new firewall group
Edit the firewall group
Add SSH rule (port 22)
Add HTTP rule (port 80)
Add HTTPS rule (port 443)
Save and apply rules
Activate the firewall
Test and verify
telnet YOUR_VPS_IP 22 or telnet YOUR_VPS_IP 80 from terminal.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.