UFW Firewall & Port Binding on VPS
Opening common server ports and troubleshooting why your server refuses to bind to the IP address.
1. Open Ports in UFW
If you are using a VPS, you must manually tell the firewall which ports should be open. Use 'ufw' for this.
sudo ufw allow 25565/tcp # Minecraft
sudo ufw allow 30120/tcp # FiveM TCP
sudo ufw allow 30120/udp # FiveM UDP
sudo ufw enable2. Troubleshoot 'Address already in use' error
If your server refuses to start with an 'EADDRINUSE' or 'Cannot bind to port' error, another process is already using that port or you are trying to bind to an incorrect IP.
sudo lsof -i :25565 # Find the process ID holding the port
sudo kill -9 [PID] # Stop that specific process3. Use 0.0.0.0 for binding
Instead of entering your VPS's specific IP address in the server configurations (e.g. server.properties or server.cfg), it's safer and easier to bind to 0.0.0.0. This makes it listen on all network interfaces.
server-ip=0.0.0.0Still stuck?
Tell support what you already tried so we can help faster.
