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.
| Option | Cost | Players at once | Mods / plugins | Online when you are off? |
|---|---|---|---|---|
| Open to LAN | Free | People on your home network | Only what the host has installed | No, only while the host is in the world |
| Realms (Java) | $7.99/month | You + 10 | No mods or plugins | Yes, 24/7 |
| Realms (Bedrock) | $3.99/month (you + 2) or $7.99 Realms Plus (you + 10) | You + 2 or you + 10 | Marketplace content and add-ons | Yes, 24/7 |
| Java server on your PC | Free | 20 by default, limited by your hardware | Yes, with Paper, Fabric, NeoForge or Forge | Only while your PC runs it |
| Bedrock Dedicated Server | Free | 10 by default, limited by your hardware | Add-ons and behavior packs | Only while your PC runs it |
| Paid server hosting | Monthly plan, priced mostly by RAM | Depends on the plan | Usually yes, often one-click | Yes, 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
- Open a terminal in the server folder (on Windows, type
cmdin the folder's address bar; on macOS and Linux, usecd). - Run
java -jar server.jar --nogui. The server creates its files and stops right away. - Open
eula.txt, changeeula=falsetoeula=trueand 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.
-Xmx2Gis the maximum memory for the server; 2 GB suits about five players on default settings.-Xms1Gis the starting memory. Keep it lower on a PC you also use; set it equal to-Xmxon a machine that only runs the server.- Both flags go between
javaand-jar.--noguihides 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)
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.
| Setting | Default | What it does |
|---|---|---|
motd | A Minecraft Server | Text under the server name in the server list. Supports color codes; keep it under 59 characters. |
max-players | 20 | How many players can be online at once. |
online-mode | true | Checks every player's Minecraft account. Keep it true on any server reachable from the internet. |
white-list | true (26.3) | Only players in whitelist.json can join. |
difficulty | easy | peaceful, easy, normal or hard. |
gamemode | survival | Default mode for new players: survival, creative, adventure or spectator. |
server-port | 25565 | The TCP port the server listens on. |
view-distance | 10 | How many chunks (radius) are sent to each player. Lower it to save RAM and CPU. |
simulation-distance | 10 | How 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
- 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.
- 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.
- 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.
- 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
oppeople you fully trust: operators can run any command. - Never share your PC login, router password or console access. Leave
enable-rcon=falseunless you need it. - Forward only the one port you need and remove the rule when you stop hosting.
- Back up the
worldfolder 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.
- 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.
- Start the server program in that folder on Windows, or run
LD_LIBRARY_PATH=. ./bedrock_serveron Linux. - Edit
server.properties: setallow-list=trueand add players in the console withallowlist add "Gamertag". Operator rights are set inpermissions.json(operator,memberorvisitor), then reload withpermission reload. - 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.
| Software | Adds | Players need | Good for |
|---|---|---|---|
| Paper (and Spigot) | Plugins (Bukkit/Spigot/Paper API) | A normal, unmodded game | Server-side features: land claims, homes, economy, anti-grief, plus better performance |
| Fabric | Mods | Usually the same mods on Fabric | Lightweight mod sets and performance mods; most mods need Fabric API |
| NeoForge / Forge | Mods | The same modpack | Big content modpacks with new blocks, machines and dimensions |
- Plugins (in the
pluginsfolder) 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
modsfolder) usually change both sides, so every player installs the same mods and loader. NeoForge and Forge installers set up the server with--installServerand createrun.bat/run.sh; memory goes inuser_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:
| Server | Typical allocation |
|---|---|
| Vanilla, 1 to 5 players | 2 to 3 GB |
| Vanilla or Paper, 10 to 20 players | 3 to 5.5 GB |
| Light Fabric mod set (under 50 mods) | 2.5 to 4 GB |
| Forge or NeoForge modpack, 50 to 300+ mods | 6 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
- Color codes: every § and & code for your MOTD and plugin messages.
- Gradient text generator: hex gradients for server names and ranks in RGB-capable plugins.
- Banner maker: a server flag with loom steps and a
/givecommand. - Slime chunk finder: run
seedin the console and help players plan slime farms.
Troubleshooting
| Problem | Fix |
|---|---|
| Error mentioning class file version 69.0 | Your Java is too old. Install Java 25 and check java -version. |
| Server stops right after starting | Set 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 friends | Check the firewall, port forward and public IP, and look out for CGNAT. |
| Lag with few players | Lower view-distance and simulation-distance, or switch to Paper. |