How to make a Minecraft server

Your own Minecraft Java server on the PC you already have, for free. Every step by hand, then the shortcut.

10 min readUpdated 11-12-2026

Minecraft dedicated server

Running your own server means the world is online whenever your friends want to play, you choose the rules, and you can add plugins or mods later. Mojang's official server software is free, and any reasonably modern PC can run a server for a group of friends.

This guide covers Minecraft Java Edition on Windows or Linux. Bedrock (phones, consoles and the Windows Bedrock app) uses different server software; see the note near the end.

at a glance

Server software
server.jar from minecraft.net, free
Needs
Java. Minecraft 1.20.5 and newer need Java 21 or later
Default port
25565 TCP
Settings file
server.properties
Hardware
A few GB of RAM covers a small vanilla group; modpacks need much more
Time to set up
About 20 to 30 minutes by hand, a few minutes with HostMode

Three ways to play Minecraft with friends

Open to LAN

One click from the pause menu, but only people on your home network can join, and only while you're playing.

Your own server

Free software on your own PC, online whenever it's running, with plugins and mods if you want them. This guide.

Realms or a rented host

A monthly subscription to Mojang's Realms or a hosting company. Nothing to set up at home, but less control and a recurring bill.

the manual way

Make a Minecraft server by hand

You'll install Java, download the server, accept Mojang's EULA, adjust a few settings, open one port and connect. Windows and Linux are both covered.

  1. 1

    Install Java

    The server needs a Java runtime, and the version depends on the Minecraft version: 1.20.5 and newer need Java 21 or later. A free build such as Eclipse Temurin works on Windows, macOS and Linux. On Ubuntu, install it with the command below (use a newer package if your Minecraft version asks for it).

    Check it worked with java -version. On Windows, if that command isn't found, reinstall Java with the option to add it to PATH turned on.

    linux
    sudo apt install openjdk-21-jre-headless
    java -version
  2. 2

    Download server.jar into its own folder

    Make a folder just for the server, because it fills up with files on first run. Download the server jar for the version you want from the official download page at minecraft.net, put it in that folder and name it server.jar.

    terminal
    mkdir ~/minecraft && cd ~/minecraft
    # move the downloaded server jar here and name it server.jar
  3. 3

    Run it once and accept the EULA

    Start the server. It stops almost immediately and creates eula.txt. Open that file, change eula=false to eula=true (that means you agree to Mojang's EULA), and save.

    -Xmx is the most memory the server can use and -Xms is what it starts with. Don't give it all of your PC's RAM; leave plenty for the system and for Minecraft itself if you play on the same PC.

    terminal
    java -Xms2G -Xmx4G -jar server.jar nogui
  4. 4

    Set up server.properties

    server.properties holds the main settings. Common ones: motd (the line under the name in the server list), max-players, difficulty, gamemode, white-list (only invited players can join), and server-port. Leave online-mode=true; it checks that players own the game and protects you from people joining under someone else's name.

    Restart the server after editing so the changes apply.

    server.properties (excerpt)
    motd=Our Minecraft server
    max-players=10
    difficulty=normal
    white-list=true
    server-port=25565
    online-mode=true
  5. 5

    Start it and make yourself an operator

    Run the same java command again and wait for the line that says Done. In the server window, type op YourName to give yourself admin, and whitelist add FriendName for each friend if you turned the whitelist on. Type stop to shut it down cleanly; closing the window can lose recent changes.

    To avoid typing the command every time, save it as start.bat on Windows (add a pause line after it) or start.sh on Linux. On a Linux machine, run it inside tmux or screen so it keeps going after you log out.

  6. 6

    Open the firewall and forward the port

    Allow TCP 25565 in the PC's firewall (Windows asks the first time the server starts) and forward TCP 25565 on your router to the PC's local IP. Reserve that IP in the router so the forward doesn't break later.

    terminal
    sudo ufw allow 25565/tcp
  7. 7

    Invite your friends

    Friends open Minecraft, go to Multiplayer, click Add Server, and enter your public IP. With the default port they don't need to add :25565. On your own PC, connect to localhost; other people in your house use the PC's local IP.

    Back up the world folders regularly, and always before changing the Minecraft version. Upgrading a world is one-way; you can't open it in an older version afterwards.

the easier way

Or let HostMode do the setup

HostMode runs your Minecraft server on your own PC and handles Java, server software, versions, backups and the console, all from a browser or your phone.

  1. 1

    Create a free account

    Sign up at hostmode.net/register. The free Solo plan covers one machine and one server with every feature, so you can run this whole guide without paying anything.

  2. 2

    Install the HostMode agent on your PC

    The agent is a small Docker container that runs your game servers and connects out to the dashboard. On Linux, run the command below. It installs Docker if it's missing and asks for your license key, which you'll find under Licenses in the dashboard.

    On Windows 10 or 11, open PowerShell and run irm https://hostmode.net/downloads/install-windows.ps1 | iex instead. It sets up WSL2 and Docker Desktop if you don't have them. Full details are in hostmode.net/docs/getting-started/installation.

    linux
    bash <(curl -fsSL https://hostmode.net/downloads/install.sh)
  3. 3

    Add a Minecraft server

    In the dashboard, add a server and pick the type: Vanilla, Paper, Spigot, Fabric, Forge or NeoForge, plus the Minecraft version. The agent installs the right Java version automatically.

  4. 4

    Change settings without opening files

    server.properties has an editor, the Players page handles op, whitelist, kick and ban, and the live console takes commands. Plugins, mods and whole modpacks install from Modrinth and CurseForge in one click.

  5. 5

    Forward the port and press Start

    The first Minecraft server uses TCP 25565, the next ones the next free port; the dashboard shows each server's port. Forward it on your router, press Start, and share your address.

    You also get scheduled backups with restore, scheduled restarts, crash recovery, a live map, and a Discord bot with a chat bridge.

Free for 1 server · Linux & Windows · Runs on your hardware

Plugins, mods and Paper

The official server runs vanilla Minecraft only. Paper is a popular drop-in replacement for server.jar that's tuned for performance and runs Bukkit and Spigot plugins (things like land claims, homes and economy). Server-side plugins don't need anything installed on players' computers.

Mods are different: Fabric, Forge and NeoForge mods usually have to be installed on both the server and every player's game, at matching versions. Modpacks bundle all of that together and need a lot more RAM than vanilla.

What about Bedrock Edition?

Phones, consoles and the Windows Bedrock app can't join a Java server without extra tools. Bedrock has its own dedicated server from Mojang that uses UDP 19132 instead. HostMode can run that too; see hostmode.net/games/minecraft-bedrock-server.

Troubleshooting

Friends can't connect from outside my house

Nine times out of ten this is the port forward. Check that TCP 25565 is forwarded to the right local IP (the PC's address can change, so give it a reserved IP in your router), that the firewall on the PC allows it, and that you gave friends your public IP, not the 192.168 one.

The port forward is right but it still doesn't work

Compare the WAN or internet IP shown in your router with the IP a site like whatismyip.com shows. If they're different, or the router's starts with 100.64 to 100.127, your internet provider uses CGNAT and nobody outside can reach your PC directly. Ask your provider for a public IP (some do it free, some charge). No server panel, HostMode included, can get around CGNAT for you.

Friends can join but I can't, using my public IP

Many routers don't let you connect to your own public IP from inside your network. Join with the PC's local IP (for example 192.168.1.50) when you're at home, and give friends the public one.

UnsupportedClassVersionError when starting

Your Java is too old for this Minecraft version. Install a newer Java (Java 21 or later for 1.20.5 and up) and run java -version to confirm the new one is the one being used.

Players see Outdated server or Outdated client

The server and the players' game must be the same Minecraft version. Either update the server jar or have players pick the matching version in the launcher's installations.

The server lags with only a few players

Make sure -Xmx isn't too small, try Paper instead of the vanilla jar, and lower view-distance in server.properties. Big redstone farms and lots of loaded chunks are the usual culprits.

Minecraft server FAQ

Is it free to make a Minecraft server?

+

Yes. Mojang's server software is free and you can run it on your own PC. You only need a copy of Minecraft to play on it, not to run it.

How much RAM does a Minecraft server need?

+

A small vanilla server for a few friends runs comfortably with a few GB. More players, Paper plugins and especially modpacks need more. Set the limit with -Xmx and leave room for your PC.

What port does a Minecraft server use?

+

Java Edition uses TCP 25565 by default. Bedrock Edition uses UDP 19132.

How do my friends join my Minecraft server?

+

They add your public IP under Multiplayer, Add Server. You must forward TCP 25565 on your router to the PC running the server first.

Can I make a Minecraft server without port forwarding?

+

Not for friends outside your house when the server runs on your own PC. Players connect straight to your PC, so the port has to be forwarded or the PC needs a public IP. Open to LAN works without it, but only on your home network.

Can my PC run the server and the game at the same time?

+

Usually, yes. Give the server its own memory limit with -Xmx so both have enough. If the game stutters, a spare PC running the server is the upgrade.