Every Minecraft player eventually asks the same question: "How do I set up a server so my friends can join?" You bought the game, you've built some amazing bases, and now you want to share the world with others. But the server setup process can feel intimidating if you've never done it before.
The good news is that setting up a Minecraft server is easier than most people think. You can go from zero to a working server in about 15 minutes — no advanced technical skills required. This guide walks you through every step, explains what each setting does, and gives you two clear paths: run the server from your own computer for free, or rent a 24/7 server so you never have to worry about keeping it running.
What You'll Need Before You Start
Before we dive in, let's gather everything you need. The requirements are modest for a small vanilla server:
- A computer to run the server. It can be the same machine you play Minecraft on — many people start this way. It just needs to stay on while your friends are playing.
- Minecraft Java Edition. You need the Java Edition of Minecraft, not the Bedrock Edition. The Java Edition lets you run your own server software. If you own Minecraft on PC, check whether you have the Java Edition or the Windows 10/11 Bedrock Edition — they're different products.
- Java Runtime Environment (JRE) 21 or later. Minecraft's server is a Java program, so your computer needs Java installed to run it. Version 21 is the minimum for Minecraft 1.20.5+ and all 1.21.x releases. For the latest snapshots, you may need Java 25.
- At least 2 GB of RAM to dedicate to the server. For 5–10 players, aim for 4 GB. Your computer needs that much free memory on top of what your operating system and other programs are using.
- A stable internet connection with decent upload speed. Your upload speed matters more than download. For 5 players, you'll want at least 10 Mbps upload.
Quick Spec Check
2–5 Players (Small Friends Group)
2 GB RAM, 2+ GHz CPU, 10 Mbps upload
Works on most modern laptops or desktops
5–10 Players
4 GB RAM, 3+ GHz CPU, 20 Mbps upload
Better on a dedicated machine or hosted server
10+ Players
6–8 GB RAM, 3.5+ GHz CPU, 50+ Mbps upload
Consider renting a hosted server at this point
Option A: Self-Hosting (Free — Your Own Computer)
Self-hosting is the cheapest way to run a Minecraft server. You use your own computer, your own internet, and the free server software that Mojang provides. It costs nothing beyond your existing electricity and internet bills. Let's walk through it step by step.
Step 1: Install Java
Minecraft's server software is a Java application, so Java must be installed on your computer first. Most computers don't come with Java pre-installed for games, so you'll need to download it.
Here's how to check whether you already have Java, and how to install it if you don't:
Windows
- Open Command Prompt (press Windows Key, type "cmd", press Enter)
- Type
java -versionand press Enter - If you see a version number (21 or higher), you're good. If you see "not recognised," download from adoptium.net (look for "Temurin 21" or "Temurin 25" — these are the free, open-source builds)
- Run the installer. It's straightforward — accept the defaults and click through
macOS
- Open Terminal (Applications > Utilities > Terminal)
- Type
java -versionand press Enter - If Java isn't installed, macOS will prompt you to install it — or download from adoptium.net
Linux
- Open your terminal
- Run:
sudo apt install openjdk-21-jre(Debian/Ubuntu) orsudo dnf install java-21-openjdk(Fedora)
Step 2: Download the Minecraft Server
Mojang publishes the official Minecraft server software for free. You download a single file called server.jar.
- Go to minecraft.net/download/server in your web browser
- You'll see a download link for the latest version of the Minecraft server. Click it — you'll get a file called
server.jar(about 50 MB)
If you want a specific version (for example, you and your friends are playing on Minecraft 1.20.4), you can find older server versions on mcversions.net or via the Minecraft version manifest API.
Step 3: Create a Server Folder
Organisation matters. Create a dedicated folder for your server so all the files it generates stay in one place — worlds, settings, logs, and backups.
- Windows: Create a folder on your desktop called
minecraft-server. Move theserver.jarfile into it. - macOS / Linux: Same idea —
mkdir ~/minecraft-serverthen move the jar there.
Keep this folder somewhere you won't accidentally delete or move it. Your server's entire world will live inside it.
Step 4: Run the Server for the First Time
Now for the moment of truth — let's start the server.
Windows
- In your
minecraft-serverfolder, hold Shift and right-click on empty space - Select "Open in Terminal" or "Open PowerShell window here"
- Type:
java -Xmx2048M -Xms1024M -jar server.jar noguiand press Enter
macOS / Linux
- Open Terminal and navigate to your folder:
cd ~/minecraft-server - Run:
java -Xmx2048M -Xms1024M -jar server.jar nogui
The -Xmx2048M part tells Java to use 2 GB of RAM. You can change this later — we'll cover that in the performance section.
The first time you run it, the server will start, then stop almost immediately. This is normal! It's creating some configuration files it needs. Look in your server folder — you should now see several new files, including server.properties, eula.txt, and ops.json.
⚠️ Accept the EULA
Open eula.txt in a text editor. You'll see a line that says eula=false. Change it to eula=true, save the file, and close it. This confirms that you accept Mojang's End User License Agreement. The server will not start until you do this.
Now run the same command again: java -Xmx2048M -Xms1024M -jar server.jar nogui. This time, the server should start properly. You'll see a flurry of text scroll by as it generates the world, and eventually you'll see "Done!" in the console. Your Minecraft server is running!
Step 5: Connect to Your Own Server
Let's make sure it works before we set up access for friends.
- Launch Minecraft Java Edition
- Click "Multiplayer"
- Click "Add Server"
- For the server address, type localhost
- Click "Done" and then double-click the server to join
If everything is working, you'll spawn into your new Minecraft world. Congratulations — you just set up a Minecraft server! Now let's get your friends in.
Step 6: Port Forwarding (Let Your Friends Connect)
For your friends to connect from their own homes, you need to open a door in your home network's firewall. This is called port forwarding. Minecraft uses port 25565 by default.
The exact steps depend on your router brand, but the process is nearly the same everywhere:
- Find your computer's local IP address. On Windows, open Command Prompt and type
ipconfig— look for "IPv4 Address" (something like192.168.x.x). On macOS, go to System Settings > Network > Wi-Fi > Details. - Find your router's IP address. Usually this is
192.168.0.1or192.168.1.1. You can also check the sticker on your router. - Type your router's IP into a web browser and log in. If you've never changed the password, try "admin" / "admin" or "admin" / "password" — it's often printed on the router itself.
- Look for a section called "Port Forwarding," "Virtual Server," or "NAT." It's usually under Advanced Settings.
- Create a new rule:
- Name:
Minecraft Server - Internal IP: your computer's local IP (from step 1)
- Port:
25565 - Protocol:
TCP(or TCP/UDP) - External Port:
25565
- Name:
- Save the rule. Some routers need a reboot — most apply it immediately.
🔒 Need Help with Port Forwarding?
Router interfaces vary wildly. If you're stuck, search "port forwarding [your router model]" on YouTube. The website portforward.com also has detailed guides for hundreds of router models. It's completely free.
Step 7: Share Your IP with Friends
Your friends need your public IP address to connect. This is different from the local IP you found earlier. Here's how to get it:
- Search "what is my IP" on Google — it's the very first result
- Send that IP address to your friends
- In Minecraft, they click "Multiplayer" > "Add Server" and enter your IP address as the server address, followed by
:25565(e.g.86.123.45.67:25565)
⚠️ Important: Dynamic IP Addresses
Most home internet connections have a dynamic IP that changes every few days or weeks. When your IP changes, your friends won't be able to connect until you give them the new one. To solve this, set up a free dynamic DNS service like DuckDNS or No-IP. You register a free subdomain (e.g. my-mc-server.duckdns.org), install a tiny program on your computer that automatically updates the domain when your IP changes, and then your friends just use the domain name instead of the IP. Problem solved.
Keep the Server Running
The server only runs while that terminal window is open. If you close it, everyone gets kicked. To keep it running:
- Minimise the window — don't close it. The server runs happily in the background while you do other things.
- Use a start script that sets everything up automatically, so you don't have to type the Java command each time.
Create a Start Script
Save this as start.bat (Windows) or start.sh (macOS / Linux) in your server folder:
java -Xmx2048M -Xms1024M -jar server.jar nogui
On macOS / Linux, make it executable with chmod +x start.sh. Now you just double-click the script to start the server.
Option B: Rented Hosting (24/7, No Maintenance)
Self-hosting is great for trying things out, but it has limitations. Your computer needs to stay on all the time, your upload speed caps how many players can join, and port forwarding can be a headache — plus if your internet goes down, so does the server.
Rented hosting fixes all of that:
- The server runs 24/7 in a professional data centre
- Gigabit internet connections — far faster than any home connection
- No port forwarding, no firewall configuration, no dynamic DNS
- Automatic backups, DDoS protection, and monitoring
- Support staff who can help when things go wrong
For most groups, rented hosting is the better option. The small monthly cost (typically £5–15) saves you hours of tinkering and means the server is always available whenever your friends want to play.
What to Look For in a Host
- Dedicated resources. Some hosts oversell — they cram 20 servers onto one physical machine and throttle everyone under load. Look for hosts that guarantee your RAM and CPU are yours alone. We've written in detail about why overselling matters for game servers.
- Easy setup. The best hosts let you launch a Minecraft server in a few clicks — pick the version, allocate RAM, and hit deploy. No manual Java installation or configuration.
- UK or EU data centres for low latency if you and your friends are in Europe.
- Good support. Real humans who understand Minecraft, not just script-reading first-line support.
Why Ilyssa Hosting for Your Minecraft Server
Every Ilyssa Minecraft server runs on its own dedicated virtual machine. No overselling, no shared resources. UK data centres for low latency, high-frequency CPUs, NVMe storage, one-click setup, and a free subdomain so your friends never lose the address. Real human support from people who actually play Minecraft.
View Minecraft Hosting PlansEssential Configurations
Now that your server is running, let's configure it properly. All the settings live in a file called server.properties in your server folder. Open it in any text editor. Here are the most important settings:
gamemode
survival (default), creative, adventure, or spectator. Most servers start in survival.
difficulty
peaceful, easy (default), or hard. Pick what feels right for your group.
max-players
How many players can join at once. Default is 20. Set it to match your group size.
white-list
true or false (default). When enabled, only players you explicitly add to the whitelist can join. Essential for private servers — more on this below.
Setting Up a Whitelist (Private Server)
By default, anyone who knows your IP can join. To keep the server private, enable the whitelist:
- In
server.properties, setwhite-list=true - Save the file and restart the server
- In the server console, type
whitelist add PlayerNamefor each player - Players not on the list will be kicked with "You are not white-listed on this server!"
Granting Operator (OP) Status
Operators have access to admin commands like /gamemode, /give, and /time set. Grant OP status to players you trust:
op PlayerName — type this in the server console. You can also edit the ops.json file in your server folder.
Game Rules Cheat Sheet
Game rules change how the world works without needing mods. Change them with /gamerule [rule] [value]:
doMobSpawning false — no hostile mobs spawn anywhere
doDaylightCycle false — locks the time of day
keepInventory true — players keep items on death (popular for casual servers)
doWeatherCycle false — locks the weather
randomTickSpeed — higher = faster crop/tree growth (default 3)
pvp true/false — enables or disables PvP combat (default true, moved from server.properties to gamerules in Minecraft 1.21.9 (25w35a))
mobGriefing false — creepers and endermen can't destroy blocks
World Seed and Border
In server.properties:
- level-seed= — set this to any seed value (numbers or text) to generate the same world every time. Leave it blank for a random seed.
- max-world-size= — sets the world border radius (in blocks from spawn). Default is 29,999,984 (the full Minecraft world). Setting it to 5000 or 10000 keeps the world file smaller and players closer together — great for small groups.
Basic Server Management
Once your server is running, you'll need a few essential commands to manage it day to day.
Starting and Stopping
- Start: Run your start script or the
java -jar server.jar noguicommand - Stop gracefully: Type
stopin the console. This saves the world before shutting down — always do this instead of closing the window, or you risk corrupting your world.
Key Console Commands
list — shows connected players
say Hello everyone! — sends a message to all players
op PlayerName — grants operator status
deop PlayerName — removes operator status
ban PlayerName — bans a player permanently
pardon PlayerName — unbans a player
whitelist add PlayerName — adds player to whitelist
whitelist remove PlayerName — removes from whitelist
save-all — forces the world to save immediately
Backing Up Your World
World corruption happens. A power outage during an auto-save, a plugin conflict, or just bad luck can wipe out hours of building. Regular backups are your safety net.
For a self-hosted server, the world is in a folder called world inside your server folder. To back it up:
Simply copy the world folder somewhere safe:
- Stop the server with
stop - Copy the
worldfolder to another drive or cloud storage - Rename it to include the date (
world-backup-2025-06-03) - Restart the server
To restore, stop the server, replace the world folder with your backup, and restart.
If you're using a hosted server, check that your hosting provider includes automated backups. Most good hosts do daily backups with one-click restore.
Performance Tips for Vanilla Servers
A vanilla Minecraft server isn't as demanding as a modded one, but it still benefits from some tuning.
1. Allocate the Right Amount of RAM
In your start command, the -Xmx flag sets the maximum RAM: -Xmx2G for 2 GB, -Xmx4G for 4 GB.
Here's what to allocate based on your group size:
- 1–3 players: 1–2 GB
- 4–8 players: 2–4 GB
- 9–15 players: 4–6 GB
A common mistake is allocating too much RAM. Giving a server 8 GB when it only needs 2 GB forces Java to work harder to manage the memory — more is not always better.
2. Reduce View Distance (Biggest Performance Lever)
In server.properties, you'll find view-distance=. This controls how many chunks the server sends to each player. The default is 10, but for 5–10 players, reducing it to 6–8 makes a massive difference in CPU and bandwidth usage. Players won't notice the difference unless they were hoping to see mountaintops from sea level.
3. Pre-Generate Chunks
By default, the server generates new chunks as players explore. This causes lag spikes when someone runs into unexplored terrain. For larger servers, you can pre-generate chunks so the world is ready before players arrive. Download a standalone tool like Chunky (a Forge/Fabric mod) or use the /pregen command with certain server plugins. This is optional for small friend groups but valuable if you want buttery-smooth exploration.
4. When to Switch to Paper or Fabric
Vanilla Minecraft is great, but if you're running into performance issues, you can switch to a server-software alternative without changing how the game plays:
- Paper is a drop-in replacement for the vanilla server that's heavily optimised. Most vanilla servers run 2–3x better on Paper with zero gameplay changes. Players connect the exact same way — they don't need to install anything different.
- Fabric is a lightweight mod loader that can also improve performance when paired with optimisation mods like Sodium and Lithium.
For more on this, see our modded Minecraft hosting guide when you're ready to go beyond vanilla.
Troubleshooting Common Issues
Even after following all the steps, things can go wrong. Here's how to fix the most common problems.
"Connection Refused" / "Can't Connect"
- The server isn't running. Check your terminal window — if you closed it, restart the server.
- Port forwarding isn't set up correctly. Double-check the rules in your router.
- Your computer's firewall is blocking the connection. On Windows, you may need to allow
javaw.exethrough the firewall. - Your friend is using the wrong IP. Confirm your public IP hasn't changed since you shared it.
Server Won't Start
- You haven't accepted the EULA. Open
eula.txtand seteula=true. - Wrong Java version. Run
java -versionto check. You need version 21 or later. - The
server.jarfile is corrupted. Re-download it from minecraft.net. - You're running the command from the wrong folder. Make sure the terminal is pointed at your server folder.
Lag / TPS Issues
- Reduce
view-distancein server.properties — this is the single most effective change. - Check how much RAM you're allocating. Too little causes lag spikes during chunk generation.
- Are there too many entities? A massive mob farm or a dozen chickens in one pen can slow the server. Consider culling entities with the command
/kill @e[type=!player](use with care — it kills everything except players). - If you're running mods or plugins, one of them might be the culprit. Try removing recent additions.
"Out of Memory" Errors
If the server crashes with an OutOfMemoryError, increase the -Xmx value in your start command. For example, change -Xmx2G to -Xmx4G. If your computer doesn't have enough free RAM overall, close other programs before starting the server.
Next Steps: Going Beyond Vanilla
Once you're comfortable running a vanilla server, you might want to explore what else is possible:
- Plugins add features to your server without changing the game's core mechanics — land claiming, economy shops, chat formatting, and minigames. You'll need Paper or Spigot for these.
- Mods change the game itself — new blocks, items, dimensions, and mechanics. Forge and Fabric are the two main mod loaders.
- Pre-made modpacks bundle hundreds of compatible mods together. CurseForge has thousands to choose from.
When you're ready to go further, read our complete guide to modded Minecraft hosting — it covers everything from mod loaders to RAM requirements for heavy modpacks.
Wrapping Up
You now have everything you need to set up a Minecraft server. Let's recap the two paths:
- Self-host (free) — install Java, download the server, configure port forwarding, and share your IP. Best for 2–5 players, free, and a great way to learn how it all works.
- Rented hosting (24/7) — a hosting provider handles everything. Best for larger groups, anyone who wants the server online all the time, or players who'd rather spend time building than configuring routers.
Whichever path you choose, you'll have a Minecraft world that you and your friends can call your own. That's the whole point — building, exploring, and surviving together.
Need a Host? Start Your Ilyssa Minecraft Server in Minutes
If you'd rather skip the setup entirely, Ilyssa Hosting gets your Minecraft server online in under 5 minutes. UK data centre, dedicated resources, free subdomain, and real support from people who know the game. No port forwarding, no dynamic DNS — just play.
View Minecraft Hosting PlansStill deciding? Read our guide to choosing the right Minecraft host to compare your options.