This article has 631 words in total, and the estimated reading time is around 3 minutes.
Want to know how long your article takes to read? Why not »Click here« to try it out!
Overview
Setting up a Minecraft server on Ubuntu involves:
Preparing your system.
Installing Java.
Downloading and configuring the Minecraft server software.
Running the server.
Configuring server settings.
Setting up port forwarding (if you want external connections).
Testing your server.
Prerequisites
A system running Ubuntu LTS (e.g., 22.04 LTS).
A user account with
sudo
privileges.An active internet connection.
Basic command-line knowledge.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Step 1: Prepare Your System
- Update Package Lists:
Open your terminal and run:sudo apt-get update
. This command updates the list of available packages and their versions. - Install Java:
Minecraft Java Edition requires Java Runtime Environment (JRE) to run. We’ll install the latest version of OpenJDK.
Use this commandsudo apt install openjdk-17-jre-headless
to install. - Confirm that Java is installed:
java -version
Expected Output:openjdk version "17.0.*" 2023-**
OpenJDK Runtime Environment (build 17.0.***)
OpenJDK 64-Bit Server VM (build 17.0.***, mixed mode, sharing) - Create and Navigate to a Dedicated Directory:
It’s good practice to keep your server files organized.
FIrst, create a dedicated directory usingmkdir ~/minecraft_server
then switch to this directory usingcd ~/ minecraft_server
Step 2: Download and Run
- Find the Mineceraft Server Software:
To find the Latest Version of Minecraft server software, you can access the official Minecraft Java Edition server page to get the URL of the latest server.jar
file. - Download the Server JAR:
Use wget to download the server core file:wget <latest_version_link> -O
, Replace<latest_version_link>
with the actual download link from the website.
For example, If the latest version link ishttps://launcher.mojang.com/v1/objects/abc123/server.jar
Then use the command ofwget https://launcher.mojang.com/v1/objects/abc123/server.jar -O server.jar
- Start Your Server:
Attempting to run the server for the first time generates the necessary configuration files. - Run the Server
java -Xmx1024M -Xms1024M -jar server.jar nogui
In the command above,-Xmx1024M
sets the maximum RAM to 1024MB.-Xms1024M
sets the initial RAM to 1024MB.nogui
runs the server without the graphical user interface.
Note: The server will fail to start and prompt you to accept the EULA.
- Accept the EULA:
Minecraft requires you to accept the End User License Agreement. To edit the EULA file,nano eula.txt
and changeeula=false
intoeula=true
- Start the Server Again:
Now that you’ve accepted the EULA, start the server again using the previous starting commandjava -Xmx1024M -Xms1024M -jar server.jar nogui
You should see the server start-up process, ending with something like:[Server thread/INFO]: Done (X.XXXs)! For help, type "help"
- Create and Navigate to a Dedicated Directory:
It’s good practice to keep your server files organized.
FIrst, create a dedicated directory usingmkdir ~/minecraft_server
then switch to this directory usingcd ~/ minecraft_server
Basic Configurations
Next, lets customize your server to your preferences. First, stop the server to prevent any conflicts while editing configurations. In the terminal where the server is running, type: stop
123
- Customize :
Usenano
to openserver.properties
:nano server.properties
- Settings you might want to adjust:
motd
: The message that displays in the server list.max-players
: Maximum number of players.difficulty
: Game difficulty (peaceful
,easy
,normal
,hard
).gamemode
: Default game mode for players (survival
,creative
,adventure
,spectator
).
- Save and Exit after making changes.
Now, your server is good to go!
v1.0.0 - Updated on 2024-11-01