allow
Open a TCP port in the server firewall
- Command:
/go/allow - Category: Security
- Required option: A port number from 1 to 65535
- Output: None on success;
Invalid PORTfor a bad port number - Last updated: 2026-11-19
On this page: Overview · Quick start · Syntax · Arguments · Output · Examples · Troubleshooting · Details · See also
Overview
/go/allow opens one TCP port in the server's firewall, so that clients on the internet can connect to it. It:
- checks that the port is a whole number from 1 to 65535
- uses
firewalldon AlmaLinux, Rocky, CentOS, Red Hat, and Fedora, andufwon Debian and Ubuntu - makes the rule permanent, so it stays after a reboot
- reloads the firewall so the rule takes effect
The port is opened for all source addresses. The command does not install or start a firewall.
Quick start
# Open port 8080
/go/allow 8080
Syntax
/go/allow <port>
The command takes one argument and has no -- options. Only the first argument is read.
Arguments
| Argument | Required | Notes |
|---|---|---|
<port> |
Yes | A whole number from 1 to 65535. One port per run. Ranges are not accepted. |
Only TCP is opened. To open a UDP port, use your firewall tool directly.
Output
When the port is valid, the command prints nothing, whether or not the rule was added. The output of the firewall tools is hidden. To check the result, list the rules yourself:
# AlmaLinux, Rocky, CentOS, Red Hat, Fedora
firewall-cmd --zone=public --list-ports
# Debian, Ubuntu
ufw status
| Message | Meaning |
|---|---|
Invalid PORT |
The argument is missing, not a whole number, or outside 1 to 65535. The command exits with status 1. |
Examples
# Open the HTTPS port
/go/allow 443
# Open a custom application port
/go/allow 8080
# Check that the port is listed (firewalld)
firewall-cmd --zone=public --list-ports
# Review the log of past runs
tail -n 20 /var/log/go/allow.log
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Invalid PORT |
The port is missing, contains non-digits, or is outside 1 to 65535. | Pass a single whole number, such as /go/allow 8080. |
| No output, but the port is still closed | The firewall tool is not installed, the OS is not supported, or the firewall is not running. | Check with checkfirewall, or install a firewall with firewall. |
ufw status shows inactive |
ufw is installed but not enabled. The command adds the rule but does not enable it. |
Enable ufw yourself. The rule is then in force. |
| The port is open in the firewall but connections still fail | Nothing is listening on the port, or a provider or cloud firewall blocks it. | Check with ss -tlnp, and open the port in your provider's panel. |
| A UDP service does not work | Only TCP is opened. | Open the UDP port with firewall-cmd or ufw. |
| The port is open to everyone | Rules apply to all source addresses. | To limit access, use your firewall tool's rich rules or ufw allow from <ip>. |
Details
What it runs
On AlmaLinux, Rocky, CentOS, Red Hat, and Fedora, when firewall-cmd is installed:
| Step | Command |
|---|---|
| Service rule (ports 22, 80, 3306 only) | firewall-cmd --zone=public --add-service=<service> --permanent |
| Port rule | firewall-cmd --zone=public --add-port=<port>/tcp --permanent |
| Apply | firewall-cmd --reload |
On Debian and Ubuntu, when ufw is installed:
| Step | Command |
|---|---|
| Service rule (ports 22, 80, 3306 only) | ufw allow <service> |
| Port rule | ufw allow <port>/tcp |
| Apply | ufw reload |
The rules go into the public zone on firewalld. On any other OS, the command does nothing.
Named services
Three ports also get the matching named service rule, in addition to the port rule.
| Port | Service |
|---|---|
22 |
ssh |
80 |
http |
3306 |
mysql |
Port 443 has no service rule. It gets the port rule only.
If SSH listens on another port, open that port too. See port.
Logging
Every run appends its arguments with a timestamp to /var/log/go/allow.log.
What a run does
flowchart TD
A["allow port"] --> B{"Whole number from 1 to 65535?"}
B -- "No" --> X["Invalid PORT, exit 1"]
B -- "Yes" --> C{"Which OS?"}
C -- "AlmaLinux, Rocky, CentOS, Red Hat, Fedora" --> D["firewall-cmd: add port, reload"]
C -- "Debian, Ubuntu" --> E["ufw: allow port, reload"]
C -- "Other" --> F["Do nothing"]
See also
| Command | Description |
|---|---|
deny |
Block incoming traffic on a TCP port |
checkfirewall |
Verify that important required ports are open on your server |
firewall |
Install a firewall on a GoAdmio server |
port |
Change the default SSH port (22) to another port |
block |
Block an IP address in the server firewall and in Cloudflare |