Dedicated servers
info
Since Release 1.2.5 / Snapshot 1.3 * you can create a dedicated server for Minecraft: Java Edition.
* - Actually from previous versions as well, but there is a problem: there is no direct download link from Mojang anymore. So you can search for previous versions from Betacraft, but we can't ensure the file integrity.- Download the Server Jar of the version you want from Xyrios1.
- Check the required Java version, since you can't use (for example) Java 8 if the server requires Java 21.
- Download the required Java version from Adoptium, make sure to filter by OS (like Windows), Architecture (like x64) and finally Version (like 21). Then download the one that is JRE (otherwise JDK) and its extension is
.zip/.tar.gz2 - Create a folder for your server and put inside the
server.jar, also extract the Java.zip/.tar.gzfile into that folder.- And rename the Java folder to something simple, in this guide we rename it to
java_folder
- And rename the Java folder to something simple, in this guide we rename it to
- Open a command prompt or terminal here (or navigate to your server folder using the
cdcommand) and execute the following Java command to start your Minecraft multiplayer server:
java_folder/bin/java -Xmx1024M -Xms1024M -jar server.jar nogui3 - The first run will generate an
eula.txtfile. Open this file with any text editor and changeeula=falsetoeula=trueto accept Minecraft's End User License Agreement. - (Optional) Configure the server.properties file the way you want, especially the enforce-secure-profile and online-mode keys.
- Restart the server (basically by executing the
stopcommand and starting it again with step 4) after making changes to this file.
- Restart the server (basically by executing the
- Set up port forwarding to allow other players to connect to your server over the internet:
- Access your router's configuration page (usually at 192.168.0.1 or 192.168.1.1)
- Find port forwarding settings (may be under "Advanced," "Security," or "Gaming")
- Forward port 25565 (TCP) 4 to your computer's local IP address
- Players can connect using your public IP address (find it by searching "What is my IP" online) 5
Footnotes
-
If you check the URL of the Server Jar you are about to download, you will see that it comes from Mojang's official server. ↩
-
Basically, the extractable version of Java compatible with your PC so you don't install anything. ↩
-
On Linux / macOS you may need to give it execute permissions first by typing
chmod +x server.jar(and maybe755instead of+x). ↩ -
Basically the value of
server-portin yourserver.properties↩ -
Security Note: Only share your IP address with trusted friends. For public servers, consider using a dedicated hosting service instead of self-hosting. ↩