Firewall & Ports
Required ports and firewall configuration for OEC.sh managed servers.
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.
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 | Your IP or 0.0.0.0/0 | 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
OEC.sh connects from these IP ranges:
- Contact [email protected] for current IP whitelist
UFW Example
# Allow SSH only from specific IPs
sudo ufw allow from 1.2.3.4 to any port 22 comment 'OEC.sh management'
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 the read-only user for reporting (see PostgreSQL Read-Only User)
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: [email protected]
- Include: Cloud provider, current firewall rules, error messages