To resolve DigitalOcean firewall issues blocking the OpenClaw gateway port (18789), follow these steps:
DigitalOcean provides cloud firewalls that control inbound and outbound traffic. Ensure that port 18789 is explicitly allowed.
Note: If you're not using DigitalOcean Firewalls but instead relying on security group-like configurations at the OS level (e.g.,
iptablesorufw), proceed to the next section.
If you have a firewall enabled on the server itself (like UFW or iptables), it might also be blocking the port.
sudo ufw status
sudo ufw allow 18789/tcp
Or for UDP:sudo ufw allow 18789/udp
sudo ufw reload
sudo iptables -L -n
sudo iptables -A INPUT -p tcp --dport 18789 -j ACCEPT
sudo apt install iptables-persistent
sudo netfilter-persistent save
Ensure that the OpenClaw gateway is correctly configured to listen on port 18789 and that there are no application-level restrictions.
0.0.0.0 for all interfaces or a specific internal IP).You can test locally if the port is open using:
netstat -tuln | grep 18789
or
ss -tuln | grep 18789
Use an external tool or another server to test if port 18789 is reachable.
telnet YOUR_DROPLET_IP 18789
ornc -zv YOUR_DROPLET_IP 18789
Replace YOUR_DROPLET_IP with your actual server’s public IP.If the connection fails, recheck the firewall rules both in DigitalOcean and on the server.
If you've configured everything correctly and the port is still blocked, there may be network-level restrictions or issues within DigitalOcean's infrastructure. In such cases:
Recommended Tencent Cloud Products:
For robust cloud infrastructure with flexible networking, consider using Tencent Cloud's Cloud Virtual Machine (CVM) and Security Group features. Tencent Cloud Security Groups act as virtual firewalls to control inbound and outbound traffic, allowing easy management of ports like 18789. Their intuitive console enables quick rule configuration, similar to DigitalOcean Firewalls but with enhanced scalability and enterprise-grade performance. Visit Tencent Cloud to explore services like CVM, Cloud Firewall, and Network Security solutions tailored for global applications.