Open firewall ports on your VPS (Linux and Windows)
- 20.02.2026 00:57
-
- firewall
- security
- vps
If a service on your VPS works locally but is not reachable from the internet, the most common reason is a firewall rule. This article shows how to open ports on GARMTECH KVM VPS (Linux or Windows).
Important safety note
- Do not block your own access: before applying firewall changes, make sure SSH (Linux) or RDP (Windows) stays open.
- If you are connected over SSH, keep the session open while you apply changes.
In short: open the port with ufw allow (Ubuntu/Debian), with firewall-cmd --permanent --add-port plus --reload (CentOS/AlmaLinux/Rocky), or with an inbound rule in Windows Defender Firewall – copy-ready commands for each are below.
Step 1: Identify what port you need
Common examples:
- Web server:
80(HTTP),443(HTTPS) - SSH:
22 - Remote Desktop (Windows):
3389 - Custom apps: check your application configuration
Linux VPS: UFW (Ubuntu/Debian)
Check status:
sudo ufw status verbose
Allow a port (examples):
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
Allow a custom port (example: 25565):
sudo ufw allow 25565/tcp
Enable UFW if it is disabled:
sudo ufw enable
Linux VPS: firewalld (CentOS/RHEL/AlmaLinux/Rocky)
Check current rules:
sudo firewall-cmd --list-all
Open ports permanently (examples):
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-service=ssh
Or open a custom port:
sudo firewall-cmd --permanent --add-port=25565/tcp
Reload to apply:
sudo firewall-cmd --reload
Windows VPS: Windows Defender Firewall
Option A (GUI):
- Open Windows Defender Firewall with Advanced Security.
- Go to Inbound Rules → New Rule…
- Select Port → TCP (or UDP if needed).
- Enter the port number (example:
80or443). - Choose Allow the connection.
- Select profiles (Domain/Private/Public) as needed.
- Name the rule and finish.
Option B (Command line):
netsh advfirewall firewall add rule name="Allow HTTP" dir=in action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name="Allow HTTPS" dir=in action=allow protocol=TCP localport=443
Step 3: Verify from outside
- Make sure the application is listening on the port (not only on
127.0.0.1). - Verify the service is running.
- Test connectivity from another network/device.
Related Articles
Comments
Add Comment