How To

How to Make a Minecraft Server: Step-by-Step Free Java Setup Guide

A complete beginner-friendly guide on how to create, configure, and host your own Minecraft Java Edition server for free with friends.

Running your own private Minecraft Java server gives you complete authority over world seeds, player whitelists, difficulty settings, and custom datapacks without paying monthly hosting fees. Hosting a vanilla server on your PC requires only the official server software, a suitable Java runtime, and a dedicated directory to organize your world data.

Hosting your own local Minecraft Java Edition server on your PC is completely free, gives you control over your survival saves, and lets your friend group play together without paying for recurring Realm subscriptions.

Configure Your Server Online with Live Validation

Skip tedious manual text editing and avoid syntax typos. Use our free Minecraft Server Properties Generator to customize game mode, difficulty, server-port values, MOTD messages, whitelists, and simulation distance with visual toggles and version-aware checks for Minecraft 1.8.9 through modern 1.21.x and beyond.

Launch Server Properties Generator

Server Prerequisites & System Requirements

Before launching your server, make sure your computer meets these essential requirements:

  • Java Runtime Environment: Java 26.x requires Java 25 (64-bit). Java 1.20.5 through 1.21.x used Java 21. You can verify your installed version by opening Command Prompt or Terminal and entering java -version. If Java is missing or outdated, download the latest release from Oracle or Adoptium Temurin.
  • Available System RAM: At least 4GB of free RAM on your machine (2GB dedicated to the server process for 1 to 4 players; 4GB or more for larger groups).
  • Stable Network Connection: A reliable Ethernet or Wi-Fi connection with good upload bandwidth if inviting remote friends.
Vibrant Minecraft multiplayer server spawn hub with banners, lanterns, and players gathered together
Creating your own Minecraft server gives you complete ownership of your survival world, custom gamerules, and multiplayer adventures.

Acquiring the official Minecraft server software

Always download your server file directly from the official Mojang portal for the official server file.

  1. Navigate to the official Mojang server download page: minecraft.net/en-us/download/server.
  2. Click the link labeled minecraft_server.XX.X.jar (hosted securely on Mojang's official CDN piston-data.mojang.com).
  3. If your web browser displays a warning stating that .jar files can potentially harm your computer, select Keep or Allow.
  4. Helpful Tip: Rename the downloaded file to simply server.jar. This makes writing launch scripts much cleaner and saves you from updating your startup commands whenever you update versions.
Official Minecraft download page showing the Java Edition server jar link and standard launch command
Download the official server.jar directly from Mojang. Avoid third-party mirror websites to ensure clean, untampered files.

Setting up an isolated server directory

Never run your server file directly inside your general Downloads folder or on your open Desktop surface. When Minecraft starts, it unpacks dozens of configuration files, world folders, libraries, and log files.

  1. Create a brand-new folder in an easily accessible location, such as on your Desktop or at C:\Minecraft Server.
  2. Move your downloaded server.jar file into this new folder.
Dedicated folder on Windows 11 containing the newly downloaded server.jar executable file
Isolate your server.jar inside a dedicated directory to keep all world dimensions, configuration files, and logs organized.

First boot and signing the Mojang EULA

Your server needs to run once to unpack its initial configuration files and register Mojang's End User License Agreement (EULA).

  1. Double-click server.jar in your server folder (or open Command Prompt in the directory and run java -jar server.jar).
  2. The process will close automatically after a few seconds. This is completely normal behavior.
  3. Notice that several new files have appeared in your folder: eula.txt, server.properties, along with logs and libraries directories.
  4. Open eula.txt with Notepad or any text editor.
  5. Read the linked EULA. If you agree to it, change eula=false to eula=true.
  6. Save the file (Ctrl + S) and close your text editor. The server will now be permitted to boot fully.
Server folder showing newly generated files including eula.txt, server.properties, logs, and libraries
The initial launch generates eula.txt and server.properties. Read the EULA, then set eula=true if you agree before starting the server.

Tuning server.properties for your world

The server.properties file controls every fundamental rule of your server, including difficulty, player capacity, game mode, and network ports.

While you can open the file in a plain text editor, manual editing often leads to syntax mistakes or unsupported values that cause the server to reset to defaults. Edit the file directly or use the Server Properties Generator. Common settings include:

  • server-port: The default network port is 25565. Leave this unchanged unless you are running multiple servers simultaneously on the same machine.
  • gamemode: Set to survival, creative, or adventure.
  • difficulty: Choose between peaceful, easy, normal, or hard.
  • max-players: Specify how many players can join your world simultaneously (e.g. 10).
  • motd: The Message of the Day displayed in the Minecraft multiplayer server browser.
  • white-list: Toggle to true if you want only approved player usernames to join.
  • online-mode: Keep set to true to authenticate player accounts with Mojang servers for security.

After adjusting your options in our generator, click Download and place the exported server.properties file into your server folder, overwriting the default file.

Writing a RAM-allocated launch batch script

To ensure your server has sufficient memory and does not crash during intense chunk generation, create a dedicated launch batch script:

  1. In your server folder, right-click an empty area and select New > Text Document.
  2. Name the file run.bat (make sure file name extensions are visible in Windows so it does not end up as run.bat.txt).
  3. Right-click run.bat, select Edit, and paste the following startup command:
    java -Xmx4G -Xms2G -jar server.jar nogui
    pause
  4. Command breakdown: -Xmx4G allocates a maximum of 4 gigabytes of RAM; -Xms2G sets initial RAM to 2 gigabytes; nogui runs the server inside the lightweight console without the extra graphical overhead; and pause prevents the terminal window from abruptly closing if an error occurs.
  5. Save the file and double-click run.bat.
  6. Watch the console load the spawn area. Once you see [Server thread/INFO]: Done (X.Xs)! For help, type "help", your Minecraft server is officially live and ready for connections!
Minecraft server GUI console displaying memory stats and the success message Done for help type help
When the console prints Done! with preparation at 100%, the world has fully initialized and is listening on port 25565.

Testing your local host connection

Because the server is running on the same computer where you play the game, connecting is instant:

  1. Launch Minecraft Java Edition (ensure your game version matches your server version, such as 26.3).
  2. Click Multiplayer on the main menu, then select Add Server.
  3. In Server Name, enter a label such as Local Connection or My Server.
  4. In Server Address, type localhost (or 127.0.0.1).
  5. Click Done. You will see your local server entry appear with a server status response if the server is reachable.
  6. Select your server and click Join Server to enter your brand-new world!
In-game Add Server menu configured with Server Name Local Connection and Server Address localhost
Enter localhost in the Server Address field to connect directly to the server running on your local machine.

Opening your server to outside friends (Port forwarding & alternatives)

While you can connect via localhost, friends outside your home Wi-Fi network cannot reach that address. To invite remote friends, you have two primary options:

Method A: Standard Router Port Forwarding

  1. Find Your Local IPv4 Address: Open Command Prompt, type ipconfig, and note down your IPv4 Address (usually formatted like 192.168.1.XX).
  2. Access Your Router Admin Dashboard: Open your web browser, navigate to your router default gateway (typically 192.168.1.1 or 192.168.0.1), and log in.
  3. Create a Port Forwarding Rule: Locate the Port Forwarding or Virtual Server section. Add a new rule forwarding port 25565 (TCP for vanilla Java gameplay) to your local IPv4 address.
  4. Check Windows Firewall: Ensure Windows Defender Firewall allows incoming connections for the Java executable used by your launch script.
  5. Share Your Public IP: Visit a public IP lookup site (like whatismyipaddress.com) to find your external IP. Give this external IP address to trusted friends in the format YOUR_PUBLIC_IP:25565.
Network Security Notice:

Never share your home public IP address in public forums, social media, or open Discord groups. Anyone with your public IP can potentially identify your general location or target your home connection with denial-of-service (DDoS) traffic. Only share your direct IP with trusted friends.

Method B: Zero-Port-Forwarding Alternatives (Playit.gg & Virtual LANs)

If your home internet uses Carrier-Grade NAT (CGNAT) or your router does not support port forwarding, you can use secure tunneling tools like Playit.gg or virtual private LAN software like Radmin VPN. A tunnel service can provide a public endpoint; a virtual LAN requires friends to join the same virtual network.

Hosting alternative

Hosting away from home

Self-hosting at home is great for casual play sessions, but your computer must remain turned on and awake for friends to play. For a persistent world on another computer, compare paid hosts by backup access, location, resource limits and renewal cost.

Third-party server software and modpacks require compatible versions. Follow their own installation instructions.

Troubleshooting Common Minecraft Server Errors

Error Message Root Cause How to Fix
"UnsupportedClassVersionError / Has been compiled by a more recent version of the Java Runtime" Your system is running an older Java version (such as Java 8 or Java 17) incompatible with modern Minecraft 1.20.5+ or 1.21+. Install Java 25 (64-bit) for 26.x from Adoptium or Oracle. Restart your command prompt and run java -version to confirm.
"FAILED TO BIND TO PORT! (Address already in use)" Port 25565 is already locked by another program or an earlier background server process that did not shut down cleanly. Open Windows Task Manager, find and stop the duplicate server process that owns this port, then restart your server.
"Connection Refused: getsockopt / no further information" The server is offline, the port forwarding rule is pointing to the wrong internal IP, or Windows Firewall is blocking the port. Verify the server console shows Done!, check that port 25565 TCP is allowed in Windows Firewall, and confirm your local IP hasn't changed.
"java.lang.OutOfMemoryError" The server exhausted the allocated memory during heavy entity loading or world exploration. Increase the maximum RAM flag in your run.bat script (for example, change -Xmx2G to -Xmx4G or -Xmx6G).

Looking to customize your world further? Explore biomes on our Interactive Seed Map, plan crafting recipes on the Crafting Calculator, or learn multiplayer basics in our complete guide on How to Play Minecraft With Friends.

Minecraft server setup questions and common issues

Is hosting a Minecraft server on my own PC completely free?

Yes. Mojang provides the official Minecraft Java Edition server JAR free. You do not need to pay any recurring fees or buy extra server licenses to host games for your friends.

How much RAM should I allocate to a vanilla Minecraft server?

For 1 to 4 players on a standard vanilla survival world, 2GB to 3GB is a starting estimate; terrain generation, view distance and server version affect demand. For 5 to 10 players or worlds with heavy redstone farms and extensive exploration, allocate 4GB to 6GB of RAM.

Can Bedrock Edition players join my Java dedicated server?

Not on a vanilla server by default, because Java and Bedrock use different network protocols. However, if you run a Paper or Purpur server and install the free open-source GeyserMC plugin, Bedrock players on mobile, consoles, and Windows can join .

Does my PC need to stay turned on for friends to play?

Yes. Because the server runs locally on your personal machine, closing the server console, shutting down your PC, or letting your computer sleep will take the server offline. If you need a world accessible 24/7 while your computer is off, consider a dedicated cloud host.

Gio Nui

Gio Nui

Independent web developer and editor of MC Toolbox. Guides are maintained alongside the site’s browser-based Minecraft tools, with commands, file formats and version notes reviewed during updates.