AI Block Lab | Linux Server Tutorials
Linux Server Tutorials
How to Set Up a Minecraft Java Server on Linux or Windows

Want to play Minecraft with your friends on your own rules? Setting up your own Minecraft server is easier than you might think. This guide shows you how to create a Minecraft Java Edition server from scratch — whether you're on Linux or Windows.
Requirements
- Java 17 or later (Java 21 recommended)
- At least 2–4 GB of RAM
- Port 25565 (TCP) opened on your firewall/router
1. Install Java
On Debian/Ubuntu:
sudo apt update
sudo apt install openjdk-17-jre-headless
java -version
On Windows:
- Download Java 17 or Java 21 from Adoptium
- Install it and verify with:
java -version
2. Create Server Directory
mkdir ~/minecraft-server
cd ~/minecraft-server
3. Download the Minecraft Server File
Go to the official site: minecraft.net
Download the .jar
file and save it as server.jar
. Or use:
wget https://example.com/server.jar -O server.jar
4. Start the Server
java -Xmx2G -Xms1G -jar server.jar nogui
This creates configuration files and stops with an EULA message.
5. Accept the EULA
Open eula.txt
and change:
eula=false
to
eula=true
6. Configure Your Server
Edit server.properties
to change:
motd=My Minecraft Server
max-players=10
online-mode=true
(orfalse
for cracked clients)
Warning: Set
online-mode=false
only if you know what you're doing. It allows anyone to connect with any name.7. Open Port 25565
On Linux:
sudo ufw allow 25565/tcp
On Router:
Forward TCP port 25565
to your local machine's IP address.
8. Connect to Your Server
- Local:
localhost
- Remote: your public IP
9. Optional: Startup Script
nano start.sh
#!/bin/bash
java -Xmx2G -Xms1G -jar server.jar nogui
chmod +x start.sh
./start.sh
Want Plugins or Mods?
Try:
Summary
You now have a fully working Minecraft server! Whether it’s a personal world or a public one, this setup gives you total control over your game experience.