Step-by-Step Guide to Setting Up a Minecraft Server
Prerequisites
- Java: Ensure you have the latest version of Java installed (Java SE Development Kit). You can download it from Oracle's website or use OpenJDK.
- A Dedicated PC or VPS: This can be a Windows, macOS, or Linux machine.
Instructions
-
Download Minecraft Server Software
- Go to the official Minecraft website and download the latest Minecraft server
.jar
file (e.g.,minecraft_server.1.xx.x.jar
).
- Go to the official Minecraft website and download the latest Minecraft server
-
Create a Server Directory
- Create a new folder on your computer where you want to run the server (e.g.,
C:\Minecraft_Server
).
- Create a new folder on your computer where you want to run the server (e.g.,
-
Move the Server File
- Place the downloaded
.jar
file into your server directory.
- Place the downloaded
-
Create a Batch File (Windows) or Shell Script (Linux)
-
For Windows:
- Create a new text file in the server directory and rename it to
start.bat
. - Edit
start.bat
and add the following line:bash java -Xmx1024M -Xms1024M -jar minecraft_server.1.xx.x.jar nogui
- This command allocates a minimum and maximum of 1 GB of RAM to the server. You can adjust these values based on your system's available RAM.
- Create a new text file in the server directory and rename it to
-
For Linux:
- Create a new text file (e.g.,
start.sh
) and add:bash #!/bin/sh java -Xmx1024M -Xms1024M -jar minecraft_server.1.xx.x.jar nogui
- Make the script executable:
bash chmod +x start.sh
- Create a new text file (e.g.,
-
-
Run the Server
- Windows: Double-click
start.bat
. - Linux: Run
./start.sh
in the terminal. - The server will start and generate some files and folders, including
eula.txt
.
- Windows: Double-click
-
Accept the EULA
- Open the
eula.txt
file in your server directory and change:plaintext eula=false
- To:
plaintext eula=true
- Save and close the file.
- Open the
-
Start the Server Again
- Run the
start.bat
orstart.sh
file again. Your server should now fully start, and you’ll see messages in the console.
- Run the
-
Configure Server Properties
- Open
server.properties
in your server directory to customize settings like:level-name
: Set your world name.max-players
: Change the max number of players allowed.gamemode
: Set the default game mode (survival, creative, etc.).
- Open
-
Set Up Port Forwarding
- Access your router settings by entering your router’s IP address in a web browser (often
192.168.1.1
or192.168.0.1
). - Forward the default Minecraft port (25565) to your server's local IP address.
- Check your local IP address using
ipconfig
(Windows) orifconfig
(Linux).
- Access your router settings by entering your router’s IP address in a web browser (often
-
Connect to Your Server
- Launch Minecraft on your PC.
- Click on “Multiplayer.”
- Click “Add Server” and enter your server’s IP address (use your public IP if connecting from outside your home network, or
localhost
if connecting from the same machine).
-
Optional: Install Mods or Plugins
- To enhance your server, consider using server management tools like Spigot, Paper, or Bukkit for mod support.
- Download plugins and place them in the
plugins
folder (this is created when you run a server with Spigot/Paper).
Additional Tips
- Backup: Regularly back up your server files and worlds.
- Performance: Monitor server performance and adjust RAM allocation as needed.
- Community: Consider joining Minecraft server hosting communities for support and resource sharing.
With these steps, you should now have a functional Minecraft server to enjoy with friends! Happy crafting!