Home › How to Make a Minecraft Server

How to Make a Minecraft Server

Updated October 2026 · Java Edition 26.3 (requires Java 25) and Bedrock Dedicated Server

You can make a Minecraft server for free with the official server software from Mojang. This guide compares every way to host a world for friends, then walks you through a Java Edition server on Windows, macOS or Linux, from installing Java to letting friends join over the internet.

Ways to host a Minecraft server

"Making a server" can mean five different things. Pick the one that fits how many people you play with, whether you need mods, and whether the world should stay online when your computer is off.

OptionCostPlayers at onceMods / pluginsOnline when you are off?
Open to LANFreePeople on your home networkOnly what the host has installedNo, only while the host is in the world
Realms (Java)$7.99/monthYou + 10No mods or pluginsYes, 24/7
Realms (Bedrock)$3.99/month (you + 2) or $7.99 Realms Plus (you + 10)You + 2 or you + 10Marketplace content and add-onsYes, 24/7
Java server on your PCFree20 by default, limited by your hardwareYes, with Paper, Fabric, NeoForge or ForgeOnly while your PC runs it
Bedrock Dedicated ServerFree10 by default, limited by your hardwareAdd-ons and behavior packsOnly while your PC runs it
Paid server hostingMonthly plan, priced mostly by RAMDepends on the planUsually yes, often one-clickYes, 24/7
  • Open to LAN is the quickest test: in Java, open the pause menu, choose Open to LAN, then Start LAN World. Players on the same Wi-Fi see it in their Multiplayer list (Bedrock worlds are visible to LAN by default). It does not reach the internet without port forwarding or a VPN.
  • Realms is Mojang's own subscription server. Invited friends play free, the world is backed up, and there is nothing to configure. Java Realms cannot run mods or plugins, and Realms always runs the latest version. New subscribers can get a 30-day free trial.
  • Your own server is free and fully under your control, but your PC must stay on and outside friends need port forwarding. The rest of this guide covers it.
  • Paid hosting rents a server in a data center: 24/7 uptime, a control panel and no router setup. Our RAM calculator tells you what plan size to look for.

Step by step: a Java Edition server

You need a computer running Windows, macOS or Linux, about 2 GB of free RAM for a small group, and access to your router if friends will join from outside your home.

1. Install Java 25

Minecraft Java Edition 26.1 and newer require Java 25 (1.20.5 to 1.21.11 needed Java 21). The Minecraft Launcher brings its own Java for the game, but the server uses the Java installed on your system.

  • Windows and macOS: download and run an OpenJDK 25 installer, for example Eclipse Temurin from adoptium.net or the Microsoft Build of OpenJDK. A JRE is enough; a full JDK also works.
  • Linux: install an OpenJDK 25 package from your distribution if it offers one (on Debian and Ubuntu the headless runtime is usually named like openjdk-25-jre-headless), or use a Temurin 25 build.

Then open a terminal (Command Prompt or PowerShell on Windows, Terminal on macOS and Linux) and check:

java -version

It should report version 25. If it shows an older one, your PATH still points to an old Java.

2. Download server.jar

Go to the official download page at minecraft.net/en-us/download/server and download the server for the current version. Create an empty folder, for example minecraft-server, and move the file into it. The file is normally called server.jar; if yours has a different name, rename it so the commands below match.

3. First run and eula.txt

  1. Open a terminal in the server folder (on Windows, type cmd in the folder's address bar; on macOS and Linux, use cd).
  2. Run java -jar server.jar --nogui. The server creates its files and stops right away.
  3. Open eula.txt, change eula=false to eula=true and save. This confirms you agree to the Minecraft EULA. Without it the server shuts down every time you start it.

4. Create a start script with RAM settings

Save one of these files in the server folder and use it to start the server from now on.

Windows: start.bat

@ECHO OFF
java -Xms1G -Xmx2G -jar server.jar --nogui
pause

macOS and Linux: start.sh

#!/bin/sh
cd "$(dirname "$0")"
exec java -Xms1G -Xmx2G -jar server.jar --nogui

On macOS and Linux, run chmod a+x start.sh once, then start with ./start.sh. On Windows, pause keeps the window open so you can read errors.

  • -Xmx2G is the maximum memory for the server; 2 GB suits about five players on default settings.
  • -Xms1G is the starting memory. Keep it lower on a PC you also use; set it equal to -Xmx on a machine that only runs the server.
  • Both flags go between java and -jar. --nogui hides the small server window.

Start the server. When the console prints a line ending in Done, the world is ready. Type stop in the console to save and shut down; closing the window instead can lose recent progress.

5. Make yourself an operator and set up the whitelist

Type these in the server console (no slash needed there). In game, operators type the same commands with a / in front.

op YourName              give full admin rights (use sparingly)
whitelist add FriendName allow a player to join
whitelist remove Name    take them off the list
whitelist list           show who is allowed
whitelist on             turn the whitelist on (off = anyone can join)
New in 26.3: the whitelist is on by default (white-list=true). If friends get a "not whitelisted" message, add them with whitelist add. Operators can always join.

6. Connect

  • From the same PC: Multiplayer → Direct Connection → localhost.
  • From your home network: use the server PC's local IP, for example 192.168.1.20. No port forwarding is needed.
  • From the internet: friends use your public IP; see Letting friends join.

server.properties basics

server.properties is created on the first run. Stop the server, edit the file in a text editor, then start it again.

SettingDefaultWhat it does
motdA Minecraft ServerText under the server name in the server list. Supports color codes; keep it under 59 characters.
max-players20How many players can be online at once.
online-modetrueChecks every player's Minecraft account. Keep it true on any server reachable from the internet.
white-listtrue (26.3)Only players in whitelist.json can join.
difficultyeasypeaceful, easy, normal or hard.
gamemodesurvivalDefault mode for new players: survival, creative, adventure or spectator.
server-port25565The TCP port the server listens on.
view-distance10How many chunks (radius) are sent to each player. Lower it to save RAM and CPU.
simulation-distance10How far from players mobs, crops and redstone keep running (3 to 32).

PvP is no longer in server.properties; current versions use the pvp game rule, so old guides that say pvp=false are out of date.

For a colorful MOTD, pick codes from our color codes reference, for example motd=§aGreen §lBold. If the § sign shows up garbled, write it as the escape \u00A7 instead.

Letting friends join over the internet

Port forwarding

  1. Give the server PC a fixed local IP. In your router, reserve its current address (often called DHCP reservation), so the rule below does not break after a restart.
  2. Allow Java through the firewall. On Windows, the first start may show a firewall prompt for OpenJDK Platform binary; allow it on private networks. Otherwise add an inbound rule for TCP port 25565.
  3. Create the forwarding rule. Log in to your router (the address is usually printed on it), find Port forwarding, Virtual server or NAT, and forward external port 25565 to the server PC's local IP, port 25565. Java Edition uses TCP; choosing "TCP/UDP" or "Both" also works.
  4. Test it. With the server running, check port 25565 with an online port checker.

Find and share your public IP

Your public IP is the address the internet sees, not the 192.168.x.x one. Search "what is my IP" on the server PC and give that to friends; with a non-default port they add it after a colon, like 203.0.113.7:25570. Home IPs change now and then, so recheck it when joining suddenly fails.

If the WAN IP on your router's status page differs from the one "what is my IP" shows, your provider likely uses CGNAT and port forwarding will not work. Ask for a public IP or use an alternative below.

Alternatives to port forwarding

  • Virtual LAN / VPN tools put you and your friends in a private network. Everyone installs the same app and joins with your VPN address; nothing is opened on your router.
  • Tunneling services give your server a public address and relay traffic to your PC. They work behind CGNAT, but add latency and you trust the service with your traffic.
  • Realms or paid hosting avoid the problem, because the server is not in your home.

Security checklist

  • Keep online-mode=true; with it off, anyone can join under any name, including yours.
  • Keep the whitelist on and only op people you fully trust: operators can run any command.
  • Never share your PC login, router password or console access. Leave enable-rcon=false unless you need it.
  • Forward only the one port you need and remove the rule when you stop hosting.
  • Back up the world folder while the server is stopped, and keep Java and the server updated.

Bedrock Dedicated Server

For Bedrock players, Mojang offers the free Bedrock Dedicated Server at minecraft.net/en-us/download/server/bedrock. It needs no Java.

  1. Download the Windows (Windows 10 or Server 2016 and newer) or Linux (Ubuntu 22.04 or newer) version and unzip it into an empty folder.
  2. Start the server program in that folder on Windows, or run LD_LIBRARY_PATH=. ./bedrock_server on Linux.
  3. Edit server.properties: set allow-list=true and add players in the console with allowlist add "Gamertag". Operator rights are set in permissions.json (operator, member or visitor), then reload with permission reload.
  4. Forward UDP port 19132 (and UDP 19133 if you use IPv6). Bedrock uses UDP, unlike Java's TCP.

Windows and mobile players add it under Servers → Add Server with your IP and port 19132. According to the Minecraft Wiki, Xbox, PlayStation and Switch usually reach a self-hosted server only over LAN or through custom DNS workarounds, so test with console friends first. Joining from the same Windows PC requires allowing loopback connections for Minecraft.

Mods and plugins

The vanilla server.jar loads no mods or plugins. You swap it for other server software that uses the same Java 25, eula.txt and server.properties.

SoftwareAddsPlayers needGood for
Paper (and Spigot)Plugins (Bukkit/Spigot/Paper API)A normal, unmodded gameServer-side features: land claims, homes, economy, anti-grief, plus better performance
FabricModsUsually the same mods on FabricLightweight mod sets and performance mods; most mods need Fabric API
NeoForge / ForgeModsThe same modpackBig content modpacks with new blocks, machines and dimensions
  • Plugins (in the plugins folder) run only on the server, so friends join with a normal game. Paper is a drop-in replacement for Spigot and runs most Bukkit and Spigot plugins.
  • Mods (in the mods folder) usually change both sides, so every player installs the same mods and loader. NeoForge and Forge installers set up the server with --installServer and create run.bat/run.sh; memory goes in user_jvm_args.txt.
  • Every mod or plugin must match your exact Minecraft version.

How much RAM do I need?

There is no official formula, but these are common starting points for the -Xmx value:

ServerTypical allocation
Vanilla, 1 to 5 players2 to 3 GB
Vanilla or Paper, 10 to 20 players3 to 5.5 GB
Light Fabric mod set (under 50 mods)2.5 to 4 GB
Forge or NeoForge modpack, 50 to 300+ mods6 to 10+ GB

View distance and mods matter more than the player count alone. The Minecraft server RAM calculator shows a full breakdown and writes the start command. Leave memory for the operating system on top of -Xmx; a fast CPU core matters more than extra RAM.

Make your server look good

Troubleshooting

ProblemFix
Error mentioning class file version 69.0Your Java is too old. Install Java 25 and check java -version.
Server stops right after startingSet eula=true in eula.txt.
"Failed to bind to port"Something already uses port 25565, often a second copy of the server. Close it or change server-port.
Friends see "not whitelisted"Run whitelist add Name in the console.
Works on localhost but not for friendsCheck the firewall, port forward and public IP, and look out for CGNAT.
Lag with few playersLower view-distance and simulation-distance, or switch to Paper.

Frequently asked questions

Is it free to make a Minecraft server?

Yes. The Java Edition server (server.jar) and the Bedrock Dedicated Server are free downloads from minecraft.net. You only need a computer that can stay on while people play. Every player still needs their own copy of Minecraft. Realms and paid hosting cost money but save you the setup and keep the world online without your PC.

What Java version do I need for a Minecraft 26.x server?

Java 25. Minecraft Java Edition 26.1 and newer require Java 25; 1.20.5 to 1.21.11 needed Java 21. If you start server.jar with an older Java you get an error that mentions class file version 69.0. Run java -version to check which version your command line uses.

Why can't my friends join my server?

Work through it in order: the server must be running, they must be on your whitelist (in 26.3 white-list is on by default), port 25565 must be forwarded on your router to your PC's local IP and allowed through your firewall, and they must use your public IP, not localhost or a 192.168.x.x address. If your router's internet IP differs from your public IP, your provider may use CGNAT and port forwarding will not work.

Is Java Edition port 25565 TCP or UDP?

The game connection uses TCP. server-port is the TCP port the server listens on, 25565 by default. UDP is only used by the optional query protocol. Many guides, including the Minecraft Wiki tutorial, simply forward both TCP and UDP, which does no harm. Bedrock Dedicated Server is different: it uses UDP 19132 (and 19133 for IPv6).

Can Java and Bedrock players play on the same server?

Not on a vanilla server. A Java server only accepts Java Edition players, and a Bedrock Dedicated Server only accepts Bedrock players. Mixed servers rely on third-party proxy software, which is outside Mojang's official support.

How many players can my server handle?

The default max-players is 20 on Java and 10 on Bedrock, and you can raise it. The real limit is your hardware and upload speed. A normal home PC handles a group of friends well; dozens of players usually need a strong CPU, more RAM, a lower view distance and an optimized server like Paper.

Can I run a server and play on the same PC?

Yes, as long as the PC has enough memory for both. Mojang lists 8 GB of RAM (with a dedicated graphics card) as the minimum just to play Java Edition and recommends 16 GB. A small vanilla server needs about 2 to 3 GB on top. Join your own server with localhost.

Should I use Realms or host my own server?

Use Realms if you want a small, always-online world with no setup: Realms for Java Edition is $7.99 a month for you plus 10 players, and Bedrock Realms start at $3.99 for you plus 2. Host your own server if you want it free, want more players, or need mods or plugins, which Java Realms cannot install.