Direct answer
Use localhost when Minecraft is running on the same computer as the server. Use the server computer's private LAN address for devices on the same home network. Friends outside your network use your public address or a domain that resolves to it, after networking is configured.
Which address should each player use?
| Player location | Address to try |
|---|---|
| Same computer | localhost or 127.0.0.1 |
| Same home network | Server's LAN IPv4, e.g. 192.168.1.50 |
| Outside your home | Public IP or domain, plus port if non-default |
Find the LAN address
On Windows, run ipconfig and look for the active adapter's IPv4 Address. On Linux, ip addr shows interface addresses. Use the address belonging to the network interface that actually connects the server to your router.
A public IP is not server-ip
Your public IP is what remote players target at the edge of your network. The server-ip property controls the local bind address and should normally stay blank. Typing the public IP there can stop the server from binding at all.
Why your own public address might fail from inside the house
Some routers do not support NAT loopback (hairpin NAT). That means a public IP can work for a friend while failing from your own Wi-Fi. Test external access from a phone hotspot or ask someone outside your network to test.
Using a domain
A domain is a friendlier name for an address; it does not automatically bypass port forwarding, CGNAT, or firewall rules. If you use a non-default port, an SRV record can sometimes let players use a clean hostname, but DNS does not make a closed port reachable.
Official references
These references were checked while preparing this guide. Version-specific behavior can change, so use the project documentation for your exact release when a detail differs.
Related guides
Help us improve this article
Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.