To make a Minecraft 1.21 server for Java Edition, install Java 21, download the official 1.21.x server JAR, run it once to generate its files, accept the EULA, edit server.properties, and launch it again. Playing on the same computer uses localhost. Letting friends join over the internet additionally requires a firewall exception, router port forwarding (normally TCP port 25565), and your public IP address.
Godlike.Host offers hosted Minecraft Java servers with its own game panel, SFTP access and free DDoS protection, if you would rather not host it yourself.
What this guide creates
This is a self-hosted Minecraft Java Edition server running the 1.21.x server software on a computer you control. The official Java server software is free to download, but it is not a one-click service: the host computer must run Java continuously while people play, store the world files, accept incoming connections, and handle administration.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
Minecraft | Java & Bedrock Deluxe Collection | Windows Digital Code | $39.99 | Buy on Amazon |
| 2 |
|
Minecraft | Java & Bedrock Ultimate Collection | Windows Digital Code | $49.99 | Buy on Amazon |
| 3 |
|
Minecraft | Standard Edition | XBOX Digital Code | $19.99 | Buy on Amazon |
| 4 |
|
Minecraft | $6.99 | Buy on Amazon |
| 5 |
|
Minecraft - Bedrock Edition PS4 | $42.98 | Buy on Amazon |
As an Amazon Associate I earn from qualifying purchases.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteThe instructions apply to the 1.20.5–1.21.x server line, whose current compatibility guidance identifies Java 21 as the target runtime. They do not describe a Bedrock Dedicated Server, console hosting, or a paid managed server dashboard. Bedrock and Java players normally cannot join the same standard server, so confirm that everyone is using Java Edition before you begin.
Before you start
Use a computer that can stay online
The host can be a desktop, laptop, or other supported computer, but it must remain powered on and connected whenever remote players need access. A sleeping laptop or a computer that shuts down ends the session for everyone. Keep enough free disk space for the world, backups, logs, and future updates; the exact amount varies with exploration and player activity.
#1 Best Overall
- DELUXE COLLECTION — Includes Minecraft: Java & Bedrock Edition, three Bedrock add-ons, three exclusive Character Creator items, and 700 Minecoins.
- CREATE YOUR WORLD — Build whatever you imagine in an infinite world that’s unique in every playthrough.
- EXPLORE AND CRAFT — Discover biomes, resources, and mobs, then craft your way through a sandbox world filled with surprises.
- SURVIVE THE ADVENTURE — Face mysterious foes, travel across exciting landscapes, and venture into perilous dimensions.
- PLAY TOGETHER — Play cross-platform with friends in Bedrock Edition on console, mobile, and PC, or join community servers in Java Edition on PC, Mac, and Linux. Online console multiplayer requires a platform-specific subscription (sold separately).
Have administrator access
You need permission to install Java, create a folder, allow an application through the operating-system firewall, and change your router’s port-forwarding rules. If the computer belongs to a school, employer, or another managed network, those controls may be unavailable.
Know which Minecraft release you will run
Download the server JAR for the exact 1.21.x release your group intends to use. Clients should normally use the same release as the server. A server running 1.21.1 is not the same file as a server running another 1.21.x release, so retain the downloaded filename rather than typing a guessed name in the launch command.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
1. Install and verify Java 21
Minecraft 1.21 servers in the 1.20.5–1.21.x compatibility range require a Java 21 runtime according to current compatibility guidance. Installing an older Java release can produce an unsupported-class-version error or prevent the server from starting.
- Install a 64-bit Java 21 runtime from a reputable distribution available for your operating system.
- Open a new terminal after installation. On Windows, open PowerShell or Command Prompt; on macOS or Linux, open Terminal.
- Run
java -version. - Confirm that the output identifies Java 21. If the command is not found, restart the terminal and check that Java was added to your system PATH. If a different version appears, remove the obsolete PATH entry or invoke the Java 21 executable using its full path.
The server download itself is free; Java is a separate prerequisite that must already be installed.
2. Download the official 1.21.x server JAR
Use Minecraft’s official Java server download page and select the 1.21.x release you want. The official release documentation for 1.21.1 identifies a server JAR for that release. Save the file rather than opening it in an archive utility, and note its exact name, including every number and character.
A server JAR is executable Java software, so obtain it from the official Minecraft site rather than an unverified mirror. Keep the JAR in a dedicated server directory; mixing it with unrelated downloads makes backups, upgrades, and troubleshooting harder.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsRank #2
- ULTIMATE COLLECTION — Includes Minecraft: Java & Bedrock Edition, five Bedrock add-ons, five exclusive Character Creator items, and 1000 Minecoins.
- CREATE YOUR WORLD — Build whatever you imagine in an infinite world that’s unique in every playthrough.
- EXPLORE AND CRAFT — Discover biomes, resources, and mobs, then craft your way through a sandbox world filled with surprises.
- SURVIVE THE ADVENTURE — Face mysterious foes, travel across exciting landscapes, and venture into perilous dimensions.
- PLAY TOGETHER — Play cross-platform with friends in Bedrock Edition on console, mobile, and PC, or join community servers in Java Edition on PC, Mac, and Linux. Online console multiplayer requires a platform-specific subscription (sold separately).
3. Create a dedicated server folder
Create a folder with a simple path, such as Minecraft Server on Windows or minecraft-server on macOS and Linux. Avoid placing the world in a temporary Downloads folder or in a directory synchronized by consumer cloud software, where partially written files can conflict during shutdown.
Move the downloaded JAR into this folder. The folder will eventually contain the world directory, server.properties, eula.txt, logs, and other generated files. Treat it as the server’s complete data set: back up the whole folder, not only the JAR.
4. Run the server once to generate its files
Open a terminal and change to the server folder. On Windows PowerShell, a path containing spaces needs quotation marks:
cd "C:pathtoMinecraft Server"
On macOS or Linux, use:
cd /path/to/minecraft-server
Start the server with a memory allocation appropriate for your computer:
Recommended Free Tools
java -Xmx2G -Xms1G -jar minecraft_server.1.21.x.jar nogui
Replace minecraft_server.1.21.x.jar with the exact downloaded filename. -Xmx2G sets a 2 GB maximum heap and -Xms1G sets the initial heap; these are starting values, not a universal performance recommendation. Do not allocate all of the computer’s RAM, because the operating system and Minecraft client (if you also play on the host) need memory.
The first run normally creates files and stops because the EULA has not been accepted. That stop is expected. If the terminal reports that Java cannot find the JAR, check the current directory and filename before changing memory settings.
Rank #3
- CREATE YOUR WORLD — Build whatever you imagine in an infinite world that is unique in every playthrough.
- EXPLORE AND CRAFT — Discover biomes, resources, and mobs, then craft your way through a sandbox world full of surprises.
- SURVIVAL ADVENTURES — Face mysterious foes, travel across varied landscapes, and venture into perilous dimensions.
- PLAY TOGETHER — Play solo or join friends in local split-screen and cross-platform play across console, mobile, and PC. Online multiplayer supports up to 8 players.
- COMMUNITY PLAY — Connect with players on community servers, or subscribe to Realms Plus (sold separately) to play with up to 10 friends on a private server.
5. Accept the Minecraft EULA
- Open the newly created
eula.txtin a plain-text editor. - Read the license terms at the address named in that file.
- Change
eula=falsetoeula=trueonly if you agree to the terms. - Save the file as plain text, preserving the filename and extension.
The server will not complete normal startup while the value remains false. Do not create a second file such as eula.txt.txt; file-extension hiding in some editors can make that mistake easy to miss.
6. Configure server.properties
The first successful initialization creates server.properties. Stop the server before editing it: in the server console, enter stop and wait for the save to complete. Open the file in a plain-text editor, change only the values you need, and save it without adding rich-text formatting.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →| Option | What it controls | Practical choice |
|---|---|---|
gamemode |
Default mode for players who join without another assigned mode. | Choose the mode your group wants, such as survival or creative. |
difficulty |
Hostile-mob difficulty and related survival rules. | Set peaceful, easy, normal, or hard according to the group. |
pvp |
Whether players can damage one another. | Use false for a cooperative world where accidental fights are unwanted. |
max-players |
Maximum simultaneous players permitted by the server. | Set a limit your computer and connection can handle; no universal capacity is established by the setup instructions. |
level-seed |
The seed used when generating a new world. | Enter a chosen seed before the first world is created, or leave it blank for a random seed. |
motd |
The message displayed in the multiplayer server list. | Use a short name that helps friends identify the server. |
allow-nether |
Whether Nether travel is enabled. | Leave enabled unless the group’s rules require otherwise. |
spawn-protection |
Protection around the world spawn from ordinary player interaction. | Adjust it if trusted players need to build at spawn; understand that changing it alters the protected area. |
server-port |
The TCP port on which the Java server listens. | Keep the default 25565 unless another service requires a different port. |
server-ip |
The local interface address to which the server binds. | Leave blank in a typical home setup. Binding the wrong address can make the server unreachable. |
Keep server-ip blank unless you have a specific networking reason to bind one interface. If you change server-port, friends must use that port and the router rule must forward the same number.
7. Launch the configured server
From the server folder, run the same Java command again:
java -Xmx2G -Xms1G -jar minecraft_server.1.21.x.jar nogui
Leave the terminal window open while the server is running. The console shows startup progress, player joins, warnings, and errors, and it accepts administrative commands. Type help to see available commands. Common administration commands include list to show online players, op PlayerName to grant operator privileges, deop PlayerName to remove them, whitelist on to restrict access, and stop for a clean shutdown. Replace PlayerName with the player’s exact in-game name.
Always use stop before closing the terminal or powering off the computer. A forced shutdown can leave unsaved world data and increase the chance of corruption.
Rank #4
- Skins! We have biome settlers, city folk, town folk, and more!
- The Nether and all its inhabitants. Fight Ghasts and make friends with Pigmen
- Cross platform play for up to five players between Pocket Edition and Windows 10
- Revamped touch controls, controller support, and a controller mapping screen
- Enhanced Weather effects! Accumulating snow and more
8. Join from the host computer
- Start the server and wait until the console reports that it has finished loading.
- Open Minecraft Java Edition using the same release as the server.
- Select Multiplayer, then choose Add Server or Direct Connection.
- Enter
localhostas the server address. If you changed the port, enterlocalhost:PORT. - Connect and verify that the world loads, your chosen game rules apply, and the console records your login.
localhost refers to the computer on which the server is running. It is not an address that remote friends can use.
9. Let friends connect over the internet
Remote access has three separate requirements: the server must listen locally, the operating-system firewall must allow the traffic, and the router must forward the server port to the host computer. A failure in any one of these layers prevents outside connections.
Find the host computer’s local address
Use your operating system’s network details to find the host’s private IPv4 address, often in a form such as 192.168.x.x or 10.x.x.x. The router’s forwarding rule must point to this computer. Reserve the address in the router’s DHCP settings, if available, so it does not change after a reboot; otherwise a working rule can silently point at the wrong device later.
Allow Java through the firewall
When the operating system asks whether Java or the server may communicate on private networks, allow it for the network profile you actually use. If you dismissed the prompt, open the firewall’s allowed-app or inbound-rule settings and permit the Java runtime or the server process on the server port. Use the narrowest rule that works rather than disabling the firewall entirely.
Forward the server port in the router
- Sign in to the router’s administration interface.
- Open the section named Port Forwarding, Virtual Server, or a similar label.
- Create a rule for the host computer’s private IP address.
- Set the external and internal port to
25565whenserver-port=25565is unchanged. Use TCP, or the router’s TCP/UDP option if it does not offer TCP alone. - Save or apply the rule and confirm that it is enabled.
Router menus vary by manufacturer, so the labels and location of this setting are not identical everywhere. If you changed server-port, forward that new number instead of 25565.
Give trusted friends the public address
Friends outside your home network connect with your public IP followed by :25565 when the default port is in use, for example PUBLIC_IP:25565. Test from a different network, such as a phone’s mobile connection; testing the public address from inside the same home network may fail because some routers do not support hairpin NAT.
Best Value
- Play and share with friends on console, mobile and Windows 10
- discover community creations in the new in-game store
- access new mini games and game modes through servers
Your public IP identifies your home internet connection. Minecraft Help strongly urges owners not to publish it publicly because exposing it creates a security risk to the home network. Share it privately with people you trust, and remove the forwarding rule when you no longer need remote access.
Diagnose connection failures
- The server immediately says the Java version is unsupported: run
java -versionin the same terminal used to launch the server and install or select Java 21 if another release is active. - “Unable to access jarfile” appears: the terminal is in the wrong folder or the filename in the command does not exactly match the downloaded JAR. List the folder contents and copy the real name.
- The server stops asking for the EULA every time: confirm that
eula.txtcontains exactlyeula=true, is saved in the server folder, and was not saved with an extra extension. - The host can join but friends cannot: verify the server is running, check the firewall rule, confirm the router forwards to the host’s current private IP, and ensure friends are using the correct public IP and port.
- Friends receive a timeout: check that the router rule is enabled and that your internet provider is not placing the connection behind carrier-grade NAT. A router status page may show a different address from the public address seen by an external service; if they differ, ordinary forwarding may not work.
- Friends reach the wrong service: another application may already use the chosen port, or the router rule may target the wrong device. Keep
server-ipblank, check the server console for a bind error, and verify the forwarding destination. - The world rolls back or appears damaged after a crash: stop the server cleanly, restore the entire server folder from a known-good backup, and avoid restoring only individual world files unless you understand their dependencies.
- Performance becomes slow as more people join: reduce unnecessary view or simulation distance, close other applications, ensure the host has adequate free memory, and consider a more capable host. Do not solve lag by allocating every gigabyte of RAM to Java.
Backups, updates, and everyday administration
Back up before changes
Stop the server with stop, wait for the save to finish, and copy the complete server folder to a separate disk or storage location. Take an additional backup before changing versions, installing server-side modifications, or making major world edits. Automatic backup behavior is not provided by a basic self-hosted JAR, so scheduling and retaining copies is your responsibility.
Update deliberately
When moving to another 1.21.x release, stop the server, back up the folder, download the matching official JAR, and update your launch command to its exact filename. Start the copy and watch the console for conversion or compatibility errors before inviting players back. Keep the old JAR and backup until you have confirmed that the world and player data work normally.
Control who joins
For a private group, enable the whitelist with whitelist on and add players with whitelist add PlayerName. Grant operator status only to people who need administrative commands. Review the whitelist and operator list whenever someone leaves the group.
Self-hosting versus managed options
Self-hosting gives you direct access to files and settings, but it also makes you responsible for uptime, backups, Java updates, firewall rules, router configuration, and protecting your public IP. A managed service removes some of that work at a recurring cost that is not specified here. Minecraft Realms is the official hosted alternative described in the setup guidance and includes automatic backups for groups of up to 10 players.
Free tools Windows power users keep installed
One-click scans. No signup required.
| Consideration | Self-hosted Java server | Minecraft Realms | Other managed hosting |
|---|---|---|---|
| Setup effort | Install Java, download the JAR, accept the EULA, configure files, and set up networking. | Service-based setup; no home router forwarding is required. | Usually dashboard-based, but exact steps depend on the provider. |
| Ongoing maintenance | You maintain the computer, Java runtime, server files, firewall, and router. | Provider handles the underlying service; world and account management remain yours. | Provider handles infrastructure; plan-specific limits and controls vary. |
| Backups | You create and retain them yourself. | Official guidance describes automatic backups. | Backup schedules and retention are not stated here and must be checked for the chosen plan. |
| File and setting control | Direct access to server.properties, worlds, logs, and the server console. |
Convenience-focused controls with less underlying file access. | Control depends on the service and whether it permits custom server files. |
| Network exposure | Your home public IP and forwarded port are involved; protect and share them privately. | No home port-forwarding step for the hosted realm. | Players connect to the host’s address rather than your home router. |
| Player capacity | There is no fixed number in the setup instructions; hardware, connection, and configuration determine a practical limit. | Official guidance describes groups of up to 10 players. | Capacity depends on the selected plan and is not stated here. |
| Mods and plugins | Full server-file control allows you to choose compatible server software and extensions, subject to their own requirements. | Use only the customization supported by the service. | Support varies by provider, plan, and server software. |
| Recurring cost | The official server software is free; electricity, hardware, and internet service are your existing costs. | A subscription is required, but a price is not stated here. | Pricing depends on provider and plan and is not stated here. |
Choose self-hosting when file-level control and custom configuration matter and you can maintain a reachable computer. Choose a hosted option when automatic backups, simpler networking, or not running a home server are more important than direct control.
Quick Recap
A safe first-session checklist
- Java 21 is confirmed with
java -version. - The JAR filename in the launch command matches the downloaded file exactly.
eula=trueis saved in the server folder.- The server starts without errors and remains running while players connect.
server.propertiescontains the intended game rules, port, and message.- The host connects through
localhost. - The firewall allows the server only on the required network profile and port.
- The router forwards the selected port to the host’s current private IP.
- Remote access is tested from outside the home network.
- A clean backup exists before inviting a larger group or changing versions.
- The public IP is shared privately, never posted in a public chat or forum.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




