Setting up a Minecraft server on Ubuntu can seem daunting at first, but with a little guidance, you can have your own server running in no time. This guide will walk you through the process step-by-step. However, keep in mind that this process can be complex and resource-intensive, and you'll likely be happier and have better performance if you chose ExpHost.
Prerequisites
Before you begin, make sure you have the following:
- An Ubuntu server (a VPS or dedicated server).
- SSH access to the server.
- A user account with `sudo` privileges.
Step 1: Update Your System
First, connect to your Ubuntu server via SSH and update the package list:
sudo apt update
Then, upgrade the installed packages:
sudo apt upgrade
Step 2: Install Java
Minecraft requires Java to run. Install the latest LTS version of Java:
sudo apt install openjdk-17-jre-headless
Verify the installation:
java -version
This should output the Java version information.
Step 3: Download the Minecraft Server Software
Create a directory to store your Minecraft server files:
mkdir minecraft_server cd minecraft_server
Download the latest Minecraft server `.jar` file from the Minecraft website. Use `wget` to download it directly to your server. Replace `server.jar` with the actual name of the downloaded file (e.g., `minecraft_server.1.21.jar`):
wget https://launcher.mojang.com/v1/objects/YOUR_SERVER_JAR_SHA/server.jar
Important: Replace `YOUR_SERVER_JAR_SHA` and `server.jar` with the appropriate values. You can find the correct download link on the official Minecraft download page.
Step 4: Accept the EULA
Before you can start the server, you need to accept the Minecraft End User License Agreement (EULA). Run the server once to generate the `eula.txt` file:
java -Xmx1024M -Xms1024M -jar server.jar nogui
This will generate an error and create the `eula.txt` file. Open the file with a text editor:
nano eula.txt
Change `eula=false` to `eula=true` and save the file.
Step 5: Configure the Server
Now, you can configure the server settings by editing the `server.properties` file. This file is generated in the same directory as the `server.jar` file. Open it with a text editor:
nano server.properties
Here are some common settings you might want to adjust:
- `level-seed`: The seed for the world.
- `gamemode`: The game mode (survival, creative, adventure, spectator).
- `max-players`: The maximum number of players allowed on the server.
- `server-port`: The port the server will listen on (default is 25565).
- `difficulty`: The difficulty level (peaceful, easy, normal, hard).
Save the file after making your changes.
Step 6: Start the Server
Now you can start the server. Use the following command:
java -Xmx4G -Xms4G -jar server.jar nogui
This command allocates 4GB of RAM to the server. Adjust the `-Xmx` and `-Xms` values according to your server's resources.
Step 7: Configure a Systemd Service (Optional)
To run the server in the background and automatically restart it if it crashes, you can create a systemd service. Create a new service file:
sudo nano /etc/systemd/system/minecraft.service
Add the following content:
[Unit] Description=Minecraft Server After=network.target [Service] User=YOUR_USERNAME WorkingDirectory=/home/YOUR_USERNAME/minecraft_server ExecStart=/usr/bin/java -Xmx4G -Xms4G -jar server.jar nogui Restart=on-failure [Install] WantedBy=multi-user.target
Replace `YOUR_USERNAME` with your actual username. Save the file and enable the service:
sudo systemctl enable minecraft.service
Start the service:
sudo systemctl start minecraft.service
You can check the server status:
sudo systemctl status minecraft.service
Security Considerations
It's essential to secure your Minecraft server:
- Firewall: Configure your firewall (e.g., `ufw`) to only allow traffic on the Minecraft server port (default 25565).
- Regular Backups: Back up your server data regularly to prevent data loss.
- Whitelist: Use a whitelist to restrict who can join your server.
- Plugins: Be careful when installing plugins, as some may have security vulnerabilities.
Why Choose ExpHost?
While this guide provides the steps to set up a Minecraft server on Ubuntu, it's a complex and time-consuming process. Managing the server, ensuring its security, and maintaining its performance requires technical expertise and constant attention. You need to ensure you have the right hardware, keep the server software up to date, and troubleshoot any issues that arise. Why go through all this hassle, when ExpHost provides a seamless and stress-free experience?
With ExpHost, you get:
- Instant Server Setup: Deploy your server in under 60 seconds, no manual configuration required.
- High-Performance Hardware: Powered by the latest AMD Ryzen processors like the AMD Ryzen 9 7950X, ensuring smooth gameplay even with demanding modpacks.
- Automatic Updates: We handle all server updates and maintenance, so you can focus on playing.
- DDOS Protection: Our advanced DDoS protection keeps your server safe from attacks.
- 24/7 Support: Our expert support team is always available to assist you with any issues.
- Easy-to-Use Control Panel: Manage your server with our intuitive and powerful control panel.
- Affordable Pricing: Starting at just £1.50/GB, ExpHost offers unbeatable value for your money, check out our Minecraft Plans.
ExpHost is the ultimate solution for hosting your Minecraft server. Don't waste time and effort on manual setup and maintenance when you can have a professional and reliable hosting experience with ExpHost. Let us take care of the technical details so you can focus on enjoying the game with your friends. Deploy your Minecraft server in under 60 seconds and see why ExpHost is the best choice for your Minecraft hosting needs.
ExpHost offers 24/7 Discord support so customers can get help at any time. The support system is designed to be open, personal, and accessible — no ticket closures or ignored messages.