Dedicated servers
INFO
Since Release 1.2.5 / Snapshot 1.3 you can run a dedicated server for Minecraft: Java Edition.
Earlier versions worked too, but Mojang no longer hosts direct downloads. You can find archived JARs on Betacraft, but file integrity isn't guaranteed.
Setup
Download the Server Jar for your target version from Xyrios.
- Check the required Java version. You can't run, for example, a Java 21 server with Java 8.
The download URL points back to Mojang's official server.
Grab the matching Java runtime from Adoptium. Filter by OS (e.g. Windows), architecture (e.g. x64), and version (e.g. 21). Pick the JRE (or JDK) in the
.zip/.tar.gzextractable format so nothing gets installed system-wide.Create a folder for your server. Put
server.jarinside it, then extract the Java archive into the same folder.- Rename the extracted Java folder to something short. This guide uses
java_folder.
- Rename the extracted Java folder to something short. This guide uses
Open a terminal in that folder (or
cdto it) and start the server:shjava_folder/bin/java -Xmx1024M -Xms1024M -jar server.jar noguiOn Linux / macOS you may need to make
server.jarexecutable first:chmod +x server.jar(or755).The first run creates an
eula.txtfile. Open it in any text editor and changeeula=falsetoeula=trueto accept the Minecraft EULA.(Optional) Edit
server.propertiesto taste. Pay particular attention toenforce-secure-profileandonline-mode.- After changes, restart the server (run
stop, then re-run the command from step 4).
- After changes, restart the server (run
Set up port forwarding so external players can connect:
- Open your router's admin page (typically
192.168.0.1or192.168.1.1). - Find port forwarding settings (sometimes under Advanced, Security, or Gaming).
- Forward TCP port
25565to your computer's local IP. The port matchesserver-portinserver.properties. - Share your public IP (search "what is my IP") with people you want to let in.
- Open your router's admin page (typically
WARNING
Only share your public IP with trusted friends. For public-facing servers, consider a dedicated hosting provider instead of self-hosting from home.