How to Create Your Own Minecraft Gaming Server
Minecraft is a popular game that allows players to create and control their gaming worlds. Setting up a server enables you to customize the environment, manage player limits, and configure gameplay settings to suit your preferences. This guide covers setting up a Minecraft Java server on a Linux system.
Requirements Copy link
The official wiki page recommends the following specs for running a Minecraft server.
Minimum Specifications:
- Supported OS: Windows 7 or newer, macOS Mojave (version 10.14.5 or later), or any Linux distribution.
- Processor: Intel Core i3-3210, AMD A8-7600, Apple M1 chip, or an equivalent processor (may function on older first-gen i3 processors but isn't officially recommended).
- Graphics Card: Intel HD Graphics, AMD Radeon R5, or comparable integrated GPUs.
- Memory: At least 2 GB of RAM.
Recommended Specifications:
- Supported OS: Windows 10 or newer, macOS Mojave (version 10.14.5 or later), or Linux.
- Processor: Intel Core i5-4690, AMD A10-7800, Apple M1 chip, or a similar CPU.
- Graphics Card: Dedicated GPUs like NVIDIA GeForce 700 series or AMD Radeon RX 200 series.
- Memory: 4 GB of RAM or more for better performance.
For this guide, we’ll use a Hostman Ubuntu cloud machine configured with the following specifications: a dual-core 3 GHz CPU, 4 GB of RAM, 80 GB of NVMe storage, and a 200 Mbps bandwidth connection.
Preparing the Server Copy link
First, we’ll install tools like screen to run the executable in the background, allowing us to continue using the terminal. We’ll also set up a non-root user to run the server securely. Additional security measures will be covered later.
Let’s proceed to the setup.
Updating and Installing Tools Copy link
Let’s begin by updating the server and installing essential tools. Update the package list and upgrade existing packages:
sudo apt update && sudo apt upgrade -yNext, we install essential tools like net-tools and screen:
sudo apt install net-tools screen -ynet-tools, including netstat, manages network connections, while screen enables background Minecraft server operation.
Install the latest Java Development Kit to proceed:
sudo apt install openjdk-21-jdkWith these steps done, we can move to the setup.
Create a User Copy link
First, add a new user called minecraft (feel free to name whatever you want).
sudo useradd -r -U -d /usr/local/minecraft/server/ -s /sbin/nologin minecraftThe -s option in the useradd command specifies the login shell for the new user. By setting it to /sbin/nologin, we effectively prevent the user from being able to log in interactively to the server. This will ensure that this user is only used to run the Minecraft server and reduce the attack surface.
Create a Directory for the Executable Files Copy link
Next, we create the directory structure to store the Minecraft server files:
sudo mkdir -p /usr/local/minecraft/server/JavaThe -p flag ensures that any missing parent directories are created automatically. This prepares a dedicated location to house all installation related files.
Assign Directory Ownership Copy link
We assign ownership of the directory to the minecraft user and group:
sudo chown -R minecraft: /usr/local/minecraft/server/The -R flag ensures permissions are applied recursively to all files and subdirectories. This allows the minecraft user to manage all server-related files without access issues.
Download and Prepare the Minecraft Server Copy link
We start by switching to the minecraft user with an interactive shell to perform the setup tasks securely:
sudo su - minecraft -s /bin/bashNext, we navigate to the server directory where all the Minecraft files will be stored:
cd /usr/local/minecraft/server/JavaFinally, we download the Minecraft server .jar file from Mojang’s official servers:
wget https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jarThis ensures the Minecraft executable is in the correct location and ready for further configuration. We recommend updating the URL if a newer server file version is available.
Run the Minecraft Server Copy link
We start the Minecraft server using the following command:
java -Xmx1024M -Xms1024M -jar server.jar noguiThis command allocates 1GB of memory to the server (-Xmx for the maximum and -Xms for the initial allocation). The nogui option disables the graphical interface, making it more efficient for a server environment by reducing resource usage.
You might first encounter an error due to the EULA similar to this:

When the server is started for the first time, it exits with a message requiring acceptance of the Minecraft End-user License Agreement (EULA). During this process, several files are created in the server directory:
lseula.txt libraries logs server.jar server.propertiesTo accept the EULA, we update the eula.txt file by replacing false with TRUE using the following command:
sed -i 's/\bfalse\b/TRUE/' eula.txtThis command edits the file, eliminating the need to open an editor like Vim or Nano.
With the EULA accepted, the server can now be launched. Use the screen command to run the server in the background:
screen -S mc_Java_server -dm java -Xmx1024M -Xms1024M -jar server.jar noguiCreate a session named mc_Java_server, which allows detaching from the terminal while keeping the server active.
Great! The Minecraft service is now running and accessible at your IP address on port 25565.
Testing the Server Copy link
To connect in multiplayer mode, open Minecraft and add a new address.

Once done, you can join the server after your client has established a connection.

Use online tools like mcsrvstat.us to check if the server is online. It also displays details such as player count, Minecraft version, and debug information.

Now that the Minecraft server is set up, let’s improve security and resource management.
Best Tips for Securing and Optimizing Your Installation Copy link
With the Minecraft server set up, focusing on securing the server and optimizing resource management is essential. Implementing these tips will help ensure smooth performance while protecting against potential vulnerabilities.
Secure with Firewall Copy link
Set up a firewall to control traffic and block unauthorized access:
-
Allow only necessary ports, such as 25565 for Minecraft, using tools like
ufworiptables:
sudo ufw allow ssh
sudo ufw allow 25565
sudo ufw enable-
Block all other incoming traffic unless explicitly required for different services.
A firewall protects the server from external threats by ensuring that only expected traffic can reach it.
Limit Access with a Whitelist Copy link
Activate the server whitelist to restrict access to specific players:
# In the Minecraft console or server.properties file:
whitelist=trueAdd trusted players to the whitelist:
whitelist add <player_username>This ensures that only approved players can access your machine, reducing the risk of griefing or malicious activities.
Use a Dedicated User Copy link
Always run the Minecraft server under a non-root user account, like the minecraft user we created earlier. This limits the machine’s permissions, ensuring it cannot harm the underlying system even if the server is compromised.
Specify and Monitor RAM Usage Copy link
Optimize memory usage to match the server’s workload. Allocate a specific amount of RAM to the server using the -Xmx and -Xms flags in the Java command.
For example, allocate 2GB of RAM:
java -Xmx2048M -Xms2048M -jar server.jar noguiYou can monitor RAM usage using tools like htop to ensure the server runs smoothly without exhausting system resources.
Limit Player Slots and Connections Copy link
You can restrict the maximum number of players in server.properties to match your server’s capacity:
max-players=10Add Plugins Copy link
Plugins are a great way to expand your Minecraft server's functionality with features like anti-griefing tools, economy systems, or mini-games. Here are some recommended plugins:
- WorldGuard: Protect specific areas from unwanted changes.
- CoreProtect: Log and roll back player actions.
- NoCheatPlus: Detect and prevent cheats or exploits.
Refer to our tutorial for plugin installation, from downloading to placing them in the correct directory. These enhancements will improve security and user experience.
Conclusion Copy link
This article covered the steps to install a Minecraft gaming server on a remote Ubuntu machine and best practices for maintenance and providing a fantastic player experience.
Consider our ready-to-run Minecraft servers available at Hostman Marketplace for a hassle-free setup.