Firewall & Ports
Required ports and firewall configuration for OEC.sh managed servers.
Automatic Firewall Configuration
If your server does not have a firewall set up (or is running CSF/LFD, which is incompatible with Docker networking), the preflight check will show a Warning with a Configure button.
Clicking Configure runs the platform's automatic firewall setup:
- Detects and disables CSF/LFD if present (CSF interferes with Docker's iptables rules)
- Installs UFW if not already installed
- Opens your SSH port (auto-detected from
/etc/ssh/sshd_config— handles non-standard ports) - Opens ports 80 and 443
- Falls back to firewalld on CentOS/RHEL, or iptables as a last resort if neither UFW nor firewalld is available
The fix completes in about 30 seconds and the preflight check re-runs automatically to confirm.
The configure button only appears when the preflight check detects that no compatible firewall is active. If UFW or firewalld is already running with the right rules, you will see Passed and no action is needed.
To run the preflight check manually: go to Servers → select your server → Preflight Checks.
Required Ports
These ports must be open for OEC.sh to function:
| Port | Protocol | Direction | Purpose |
|---|---|---|---|
| 22 | TCP | Inbound | SSH access for OEC.sh management |
| 80 | TCP | Inbound | HTTP traffic (redirects to HTTPS) |
| 443 | TCP | Inbound | HTTPS traffic (main Odoo access) |
Critical: If port 22 is blocked, OEC.sh cannot manage your server. Deployments, backups, and monitoring will fail.
OEC.sh IP Addresses
OEC.sh connects to your server from these addresses:
| IP Address | When It Is Used |
|---|---|
49.12.128.238 | All connections: SSH for deployments, backups, logs and the terminal, server metrics, and health checks |
68.183.11.236 | Standby only, used if your hosting provider blocks the address above |
If you restrict SSH (port 22, or your custom SSH port) by source IP, allow both addresses. If you allow only the first one and OEC.sh has to switch to the standby address, it can no longer reach your server. The standby address can change; if it does, we will tell you before we use the new one. See Restricting SSH Access for an example.
Servers connected through a Cloudflare Tunnel need no inbound firewall rule for OEC.sh: everything OEC.sh does on them goes through the tunnel. Direct SSH/SFTP access to an environment isn't available on these servers; use the terminal in the dashboard instead.
Optional Ports
These ports may be needed depending on your configuration:
| Port | Protocol | Direction | Purpose | When Needed |
|---|---|---|---|---|
| 8069 | TCP | Inbound | Direct Odoo HTTP | Debugging, bypassing proxy |
| 8072 | TCP | Inbound | Odoo longpolling | Real-time features (discuss, chat) |
| 5432 | TCP | Inbound | PostgreSQL | External database access, BI tools |
| 19999 | TCP | Inbound | Netdata | Direct access to monitoring dashboard |
| 6432 | TCP | Inbound | PgBouncer (primary) | Connection pooling access |
| 6433 | TCP | Inbound | PgBouncer (replica) | Read replica access (Odoo 18+) |
Cloud Provider Configuration
AWS EC2 Security Groups:
- Go to EC2 → Security Groups
- Select your instance's security group
- Click Inbound rules → Edit inbound rules
- Add these rules:
| Type | Protocol | Port Range | Source | Description |
|---|---|---|---|---|
| SSH | TCP | 22 | 0.0.0.0/0, or the OEC.sh IP addresses plus your own IP | OEC.sh management |
| HTTP | TCP | 80 | 0.0.0.0/0 | Web traffic |
| HTTPS | TCP | 443 | 0.0.0.0/0 | Secure web traffic |
# AWS CLI example
aws ec2 authorize-security-group-ingress \
--group-id sg-xxxxx \
--protocol tcp \
--port 22 \
--cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress \
--group-id sg-xxxxx \
--protocol tcp \
--port 80 \
--cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress \
--group-id sg-xxxxx \
--protocol tcp \
--port 443 \
--cidr 0.0.0.0/0UFW Configuration (Server-Level)
If your server uses UFW (Uncomplicated Firewall):
# Allow required ports
sudo ufw allow 22/tcp comment 'SSH'
sudo ufw allow 80/tcp comment 'HTTP'
sudo ufw allow 443/tcp comment 'HTTPS'
# Enable firewall
sudo ufw enable
# Verify rules
sudo ufw status verboseExpected output:
Status: active
To Action From
-- ------ ----
22/tcp ALLOW Anywhere # SSH
80/tcp ALLOW Anywhere # HTTP
443/tcp ALLOW Anywhere # HTTPSiptables Configuration
For servers using raw iptables:
# Allow established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow loopback
iptables -A INPUT -i lo -j ACCEPT
# Allow SSH
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# Allow HTTP/HTTPS
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
# Drop everything else (optional, be careful!)
# iptables -A INPUT -j DROP
# Save rules (Debian/Ubuntu)
iptables-save > /etc/iptables/rules.v4Caution: Incorrect iptables rules can lock you out of your server. Always test in a screen/tmux session and have console access available.
Restricting SSH Access
For enhanced security, restrict SSH to specific IPs:
OEC.sh Management IPs
Allow both addresses listed in OEC.sh IP Addresses: 49.12.128.238 and 68.183.11.236.
UFW Example
# Remove the rule that allows SSH from anywhere first (UFW uses the first rule that matches).
# Check with: sudo ufw status numbered
sudo ufw delete allow 22/tcp
# Allow SSH only from specific IPs
sudo ufw allow from 49.12.128.238 to any port 22 comment 'OEC.sh management'
sudo ufw allow from 68.183.11.236 to any port 22 comment 'OEC.sh standby'
sudo ufw allow from 5.6.7.8 to any port 22 comment 'Office IP'
# Block SSH from everywhere else (if no default deny)
sudo ufw deny 22/tcpDatabase Access (Port 5432)
Security Risk: Opening port 5432 exposes your database to the internet. Only do this if you need external database access (e.g., BI tools).
If you need external PostgreSQL access:
-
Restrict to specific IPs only:
sudo ufw allow from 10.0.0.5 to any port 5432 comment 'BI Server' -
Consider using SSH tunnel instead:
ssh -L 5432:localhost:5432 user@your-server -
Use a read-only database user for reporting queries
Outbound Ports
OEC.sh servers need outbound access for:
| Port | Protocol | Destination | Purpose |
|---|---|---|---|
| 80, 443 | TCP | Internet | Docker Hub, package repos |
| 443 | TCP | api.oec.sh | OEC.sh API communication |
| 25, 465, 587 | TCP | Mail servers | Outgoing email (if configured) |
Most cloud providers allow all outbound traffic by default.
Testing Connectivity
Test from your machine
# Test SSH
nc -zv your-server-ip 22
# Test HTTP/HTTPS
curl -I http://your-server-ip
curl -I https://your-domain.comTest from the server
# Test outbound connectivity
curl -I https://api.oec.sh
curl -I https://hub.docker.comTroubleshooting
"Connection refused" on port 22
Causes:
- Firewall blocking the port
- SSH service not running
- Wrong IP address
Solutions:
- Check cloud firewall rules
- Use provider's console to access server
- Run:
sudo systemctl status sshd
"Connection timed out" on port 80/443
Causes:
- Firewall blocking the port
- No web server running
- Server not reachable
Solutions:
- Verify firewall rules (both cloud and server-level)
- Check if Traefik is running:
docker ps | grep traefik
OEC.sh shows "Server Unreachable"
Causes:
- Port 22 blocked
- SSH credentials changed
- Server powered off
Solutions:
- Verify port 22 is open
- Test SSH manually:
ssh user@server-ip - Check server status in cloud provider console
Security Best Practices
- Use SSH keys instead of passwords
- Disable root login via SSH
- Change default SSH port (optional, update OEC.sh settings)
- Use fail2ban to block brute force attempts
- Keep firewall rules minimal - only open what's needed
- Regularly audit open ports:
sudo netstat -tlnp - Use cloud firewalls in addition to server firewalls (defense in depth)
Need Help?
For firewall configuration assistance:
- Email: support@oec.sh
- Include: Cloud provider, current firewall rules, error messages