What uses port 25565
Minecraft Java Edition servers listen on TCP 25565; Bedrock Edition uses UDP 19132. To let friends join a server at home, forward the port on the router to the machine running the server, or use a tunneling service so you don’t have to expose your home IP.
Should port 25565 be open to the internet?
Meant to be public. This port is meant to be reachable by clients on the internet when you run this service publicly.
- Players see “Connection timed out” when the router isn’t forwarding 25565, or the computer’s firewall blocks Java. Test from outside your network, because many routers don’t support connecting to your own public IP.
Check what is listening on port 25565
sudo ss -ltnp 'sport = :25565'
sudo lsof -nP -iTCP:25565 -sTCP:LISTEN
Get-NetTCPConnection -LocalPort 25565 -State Listen
netstat -ano | findstr :25565
No output means nothing is listening. If a service should be, check that it is running and which address it binds to: 127.0.0.1 only accepts local connections, 0.0.0.0 or :: accepts them on every interface.
Fix “address already in use” on port 25565
Another process already holds the port. Find it with the commands above, then stop that service properly, or end the process:
sudo kill $(sudo lsof -t -iTCP:25565 -sTCP:LISTEN)
Stop-Process -Id (Get-NetTCPConnection -LocalPort 25565 -State Listen).OwningProcess
Open port 25565 in the firewall
sudo ufw allow 25565/tcp
# Close it again:
sudo ufw delete allow 25565/tcp
sudo firewall-cmd --permanent --add-port=25565/tcp
sudo firewall-cmd --reload
New-NetFirewallRule -DisplayName "Minecraft 25565/TCP" -Direction Inbound -Protocol TCP -LocalPort 25565 -Action Allow
On AWS, Google Cloud and Azure, also allow the port in the security group or network firewall rules; host firewalls and cloud firewalls are separate.
Port 25565 with Docker
docker run -d -p 25565:25565 itzg/minecraft-server
The format is -p host_port:container_port. Containers on the same Docker network reach each other on
the container port directly, without publishing it. Convert a long docker run command into a Compose
file with docker run to compose.
Test port 25565 from another machine
nc -zv example.com 25565
Test-NetConnection example.com -Port 25565
More other ports
7000 (AirPlay (macOS) / Cassandra) . See all ports in the port lookup.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What is port 25565 used for?
Port 25565 is the default port for Minecraft Java Edition servers. Minecraft Java Edition servers listen on TCP 25565; Bedrock Edition uses UDP 19132. To let friends join a server at home, forward the port on the router to the machine running the server, or use a tunneling service so you don’t have to expose your home IP.
Is it safe to open port 25565?
This port is meant to be reachable by clients on the internet when you run this service publicly. Keep the service behind it up to date and require authentication where it applies.
How do I check if port 25565 is open?
On the server, list listening sockets with "sudo ss -ltnp 'sport = :25565'" on Linux or "sudo lsof -nP -i :25565" on macOS. From another machine, run "nc -zv host 25565" or, on Windows, "Test-NetConnection host -Port 25565". Connection refused means nothing is listening; a timeout means a firewall is dropping the traffic.