Minecraft, the immensely popular sandbox video game, offers players the opportunity to create and explore virtual worlds filled with endless possibilities. Hosting your own Minecraft server allows you to customize gameplay, invite friends to join, and experience the game in new ways. In this comprehensive guide, we’ll walk you through the step-by-step process of setting up a Minecraft server on Ubuntu 18.04, enabling you to create your own virtual realm and embark on adventures with friends.
Prerequisites:
- A server or virtual machine running Ubuntu 18.04.
- Access to a terminal with sudo privileges.
- Basic familiarity with Linux commands.
Step 1: Update System Packages
Before installing any software, it’s essential to ensure that your system’s package repository is up to date. Open a terminal and run the following commands:
sudo apt update
sudo apt upgrade
Step 2: Install Java
Minecraft requires Java to run. Install the OpenJDK Java runtime environment using the following command:
sudo apt install openjdk-8-jdk
Step 3: Download Minecraft Server
Navigate to the directory where you want to install the Minecraft server. Create a new directory for the server files and download the Minecraft server JAR file:
mkdir minecraft_server
cd minecraft_server
wget https://launcher.mojang.com/v1/objects/xxxxx/minecraft_server.x.x.x.jar
Replace ‘xxxxx’ with the desired Minecraft version number.
Step 4: Accept EULA
Before running the Minecraft server, you need to accept the End User License Agreement (EULA). Open the EULA file in a text editor:
nano eula.txt
Change ‘eula=false’ to ‘eula=true’ and save the file.
Step 5: Start Minecraft Server
Launch the Minecraft server by running the following command:
java -Xmx1024M -Xms1024M -jar minecraft_server.x.x.x.jar nogui
Replace ‘x.x.x’ with the version number of the Minecraft server JAR file.
Step 6: Configure Server Properties
After starting the server, it will generate default configuration files. Customize the server properties by editing the ‘server.properties’ file:
nano server.properties
Adjust settings such as server name, game mode, difficulty, and maximum number of players according to your preferences.
Step 7: Configure Firewall
Open the Minecraft server port (default: 25565) in the firewall to allow incoming connections. Use the following command:
sudo ufw allow 25565/tcp
Step 8: Access Minecraft Server
Once the server is running, players can connect to it using the Minecraft Java Edition client. Provide them with the server IP address or domain name to join the game.
Step 9: Server Management
To stop the Minecraft server, press ‘Ctrl + C’ in the terminal where it is running. You can restart the server or manage it remotely using tools like screen or tmux for persistent sessions.
Conclusion
By following this comprehensive guide, you’ve successfully installed and configured a Minecraft server on Ubuntu 18.04. Whether you’re hosting a private server for friends or creating a public community, you now have the tools to embark on exciting adventures and unleash your creativity in the blocky world of Minecraft. Enjoy building, exploring, and surviving in your own Minecraft realm!