DGuard

How to make a Minecraft server for friends: 5 ways

There are five ways to play Minecraft with friends: open your world to LAN, subscribe to Realms, run a server on your own computer, or use free or paid hosting. They differ in cost, in who can join, in whether your computer has to stay on, and in whether you can add plugins. Here is each one, and how to keep strangers off the server.

The DGuard team9 min read

In short: friends in the same home or on the same network — open your world to LAN; it's free and takes a minute. You want a world that runs without you and no setup — Realms, but it's a paid subscription with no plugins. Free and with plugins — a Paper server on your own computer, with port forwarding or a tunnel such as playit.gg. Don't want to keep your PC on — free hosting, and once the group grows — paid hosting or a VPS.

The ways compared

WayCostWho can joinYour PC must be onPluginsDifficulty
Open to LANFreeOnly the same local networkYes, and you're in that worldNoMinimal
RealmsPaid subscriptionInvited players only; on Java up to 10 at once besides the ownerNo, it runs 24/7NoMinimal
Your own server on your PCFreeAnyone with the address — close it with a whitelistYesYesMedium: Java, Paper, port forwarding or a tunnel
Free hostingFree, with limitsAnyone with the host's addressNo, but an empty server sleepsDepends on the host: on Aternos only from its libraryLow
Paid hosting or a VPSPaidAnyone with the address or domainNoYesHosting low, VPS high
LAN and Realms facts from the Minecraft Wiki and minecraft.net, the tunnel from playit.gg's own site, hosts from their websites. Links in the sources.

Way 1. Open to LAN

The quickest way when your friends are on the same router or hotspot. You don't need a server: your game shares the open world itself.

  1. 1

    Open the world

    Load a singleplayer world, press Esc and choose Open to LAN. The /publish command does the same.

  2. 2

    Pick the settings

    The game mode for guests, whether they may use commands, and the port. If you don't set a port, the game picks a random one and posts it in chat: "Local game hosted on port …".

  3. 3

    Friends join

    The world shows up at the bottom of the server list under Multiplayer. If it doesn't, they add a server by hand: your local IP (ipconfig on Windows) and the port after a colon, and you allow that port in your firewall.

Limits: the world lives while you're playing in it; everyone needs their own account — one account on two computers can't join the same world; no plugins. According to the Minecraft Wiki, players over the internet can reach a LAN world only through workarounds — port forwarding or a VPN. If it comes to that, it's easier to run a real server (way 3).

Way 2. Minecraft Realms

Realms is Mojang's official server by subscription: nothing to set up, the world runs 24/7, and friends can play in it even when you're offline. It's free for them, but each needs their own copy of the game. On Java Edition a Realm holds the owner plus up to 10 other players at once, and you can invite as many people as you like; a Realm has three world slots.

Players join by invitation only: on Java the owner adds their name in the Realm settings. The downsides per the Minecraft Wiki: mods and plugins can't be installed, and on Java inactive players are kicked after 15 minutes. Check minecraft.net for the subscription price — it depends on the edition.

Way 3. A server on your own computer

Free and without limits: any plugin, any setting, and your world stays on your own disk. Download Paper, install Java (Paper 1.20–1.21.11 needs Java 21, Paper 26.1 and newer needs Java 25), run it and accept the EULA — step by step in the complete guide. Then your friends have to reach the server, and there are two ways.

Port forwarding

The server listens on TCP port 25565. On your router you add a rule: send everything that arrives on 25565 from outside to your computer — then give your friends your public IP. Details, including checking the port and a domain without numbers, are in IP and port 25565. It won't work if your ISP puts you behind its own NAT: then you need a public IP or a tunnel.

A tunnel: playit.gg

A tunnel service gives your server a public address without port forwarding. With playit.gg, an agent program runs on the server's computer (Windows, Linux, macOS, Docker), and your friends just connect to the address it gives you; your home IP stays hidden from them. Minecraft Java is part of the free tier. Free tunnels are "global anycast", and as playit itself says, routing isn't always optimal: a player can be routed through a distant data center. Pinning a tunnel to a region is part of the paid Premium.

Without extra setup the server sees every player coming from a local address like 127.x.x.x, so IP bans and per-IP connection limits won't work. The Proxy Protocol passes the real IP: turn it on in Paper and pick version 2 in the tunnel settings on playit.gg. After that, connecting to the server directly, bypassing the tunnel, no longer works.

config/paper-global.yml — then restart the server
proxies:
  proxy-protocol: true

Way 4. Free hosting

The server runs on someone else's machine, with no port forwarding and no PC of yours left on. The price is limits: Aternos and Minehut stop or put an empty server to sleep, memory is small, and on Aternos plugins come only from the built-in library. The free options compared by facts from their own sites are in free Minecraft server hosting.

When the server has to be up around the clock, the group is growing and so is the plugin list, it's time for paid hosting: your own plugins, DDoS protection, backups, support. Well-known hosts compared are in best Minecraft server hosting, and how a hosting panel differs from your own VPS is in hosting or VPS.

Keeping strangers out

  • Whitelist. A server for friends should let in only friends. Turn the whitelist on and add each of them; since 26.3 it's on by default on a new server. On Java, operators always get in, even if they're not on the list. Details in operators and the whitelist.
  • Leave `online-mode` alone. With true the server only lets in players with a verified account. With false anyone can join under any name, and the whitelist no longer protects you. If one of your friends has no licensed account, read offline-mode servers first.
  • OP for yourself only. Friends are fine with normal permissions; a level 4 operator can even stop the server.
  • World backups. One bad explosion or grief and an evening of building is gone. How to make backups is in server backups.
server console
whitelist on
whitelist add Steve
whitelist add Alex
whitelist list

When the group gets bigger

A server for friends rarely stays at five people: friends bring their friends, the address gets passed around in chats, the whitelist grows — and sooner or later someone joins with a cheat. One player with KillAura, fly or X-Ray spoils the game for everyone else, and you won't be watching each of them.

An anticheat goes wherever plugins work: your own server, hosting and a VPS — a LAN world and Realms don't take plugins. DGuard — the best anticheat for a modern Minecraft server — installs on Paper or Leaf 1.21–26.3 next to the latest PacketEvents release and needs outbound HTTPS. It barely loads a home computer you also play on: checks run in network threads, and the main thread cost is 0.03% of one core. DGuard is free up to 30 players online, with the same protection as on paid plans.

FAQ

How can I play Minecraft online with a friend for free?

If you're on the same network, open your world to LAN from the pause menu. Over the internet, run a Paper server on your computer and forward port 25565 or set up a tunnel such as playit.gg, or use free hosting.

Can friends join a LAN world over the internet?

Only through workarounds: port forwarding on the host's router or a VPN. It's easier to run a separate Paper server — it works without you in the game, and with plugins.

How many friends can play on Realms?

On Java Edition, the owner plus up to 10 other players at once, and you can invite as many people as you like. Plugins and mods can't be installed on Realms.

Do I need to keep my computer on?

For a LAN world and a server on your own PC, yes. Realms and hosting run without your computer, but free hosts stop or put an empty server to sleep.

How do I let only my friends join?

Turn the whitelist on with whitelist on, add friends with whitelist add <name>, and keep online-mode set to true. Since 26.3 the whitelist is on by default on a new server.

Sources

All sections

Run the best anticheat for modern Minecraft

DGuard catches all 47 kinds of cheats in our comparison — the closest rival, Intave, has 27. Full protection on every plan, free up to 30 players online.