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 GeneratorServer 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.
Acquiring the official Minecraft server software
Always download your server file directly from the official Mojang portal for the official server file.
- Navigate to the official Mojang server download page: minecraft.net/en-us/download/server.
- Click the link labeled minecraft_server.XX.X.jar (hosted securely on Mojang's official CDN
piston-data.mojang.com). - If your web browser displays a warning stating that
.jarfiles can potentially harm your computer, select Keep or Allow. - 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.
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.
- Create a brand-new folder in an easily accessible location, such as on your Desktop or at
C:\Minecraft Server. - Move your downloaded
server.jarfile into this new folder.
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).
- Double-click
server.jarin your server folder (or open Command Prompt in the directory and runjava -jar server.jar). - The process will close automatically after a few seconds. This is completely normal behavior.
- Notice that several new files have appeared in your folder:
eula.txt,server.properties, along withlogsandlibrariesdirectories. - Open
eula.txtwith Notepad or any text editor. - Read the linked EULA. If you agree to it, change eula=false to eula=true.
- Save the file (
Ctrl + S) and close your text editor. The server will now be permitted to boot fully.
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, oradventure. - difficulty: Choose between
peaceful,easy,normal, orhard. - 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
trueif you want only approved player usernames to join. - online-mode: Keep set to
trueto 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:
- In your server folder, right-click an empty area and select New > Text Document.
- Name the file
run.bat(make sure file name extensions are visible in Windows so it does not end up asrun.bat.txt). - Right-click
run.bat, select Edit, and paste the following startup command:java -Xmx4G -Xms2G -jar server.jar nogui pause - Command breakdown:
-Xmx4Gallocates a maximum of 4 gigabytes of RAM;-Xms2Gsets initial RAM to 2 gigabytes;noguiruns the server inside the lightweight console without the extra graphical overhead; andpauseprevents the terminal window from abruptly closing if an error occurs. - Save the file and double-click
run.bat. - 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!
Testing your local host connection
Because the server is running on the same computer where you play the game, connecting is instant:
- Launch Minecraft Java Edition (ensure your game version matches your server version, such as 26.3).
- Click Multiplayer on the main menu, then select Add Server.
- In Server Name, enter a label such as
Local ConnectionorMy Server. - In Server Address, type
localhost(or127.0.0.1). - Click Done. You will see your local server entry appear with a server status response if the server is reachable.
- Select your server and click Join Server to enter your brand-new world!
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
- Find Your Local IPv4 Address: Open Command Prompt, type
ipconfig, and note down your IPv4 Address (usually formatted like192.168.1.XX). - Access Your Router Admin Dashboard: Open your web browser, navigate to your router default gateway (typically
192.168.1.1or192.168.0.1), and log in. - 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.
- Check Windows Firewall: Ensure Windows Defender Firewall allows incoming connections for the Java executable used by your launch script.
- 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.
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 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.




