Step 1: Preparing Your Virtual Server
First things first, you need a solid foundation. This means getting a virtual server running a Linux distribution like Debian or Ubuntu. Once you have your server’s IP address and login details, connect to it using SSH.
Before we install anything, it’s crucial to get your server up to date. Run these commands to update your system’s package list and apply any pending upgrades:
sudo apt update
sudo apt upgrade -y
With your system current, you’re ready for the next step.
Step 2: Install Dependencies & Create a Secure User
LinuxGSM has a few software requirements to function correctly. You can install them all with a single command.
sudo apt install curl wget file tar bzip2 gzip unzip bsdmainutils python3 util-linux ca-certificates binutils bc jq tmux netcat lib32gcc-s1 lib32stdc++6 steamcmd
For security reasons, you should never run a game server as the ‘root’ user. Let’s create a dedicated user for our Minecraft server. We’ll call it “mcserver”.
sudo adduser mcserver
Follow the prompts to set a password. After the user is created, switch to it:
su - mcserver
Step 3: Download and Run LinuxGSM
Now, as the ‘mcserver’ user, we’ll download the LinuxGSM script.
wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh mcserver
This script will download the rest of the necessary files and get the framework in place.
Step 4: Install the Minecraft Server
With LinuxGSM ready, installing the actual Minecraft server is incredibly simple. Just run the installer command:
./mcserver install
The script will handle downloading the latest server files from Mojang. It will likely ask you to agree to the Minecraft EULA. Make sure to read it and accept it to continue.
Step 5: Open the Port and Launch!
For other players to connect to your server, you need to open the default Minecraft port (25565) in your server’s firewall.
sudo ufw allow 25565/tcp
Now you’re ready for the magic moment! Start your server with this command:
./mcserver start
You can check the server’s status and see live details by running:
./mcserver details
To connect, simply launch Minecraft, go to Multiplayer, click “Add Server,” and enter your server’s IP address.
Managing Your Server
LinuxGSM makes server management a breeze. Here are the essential commands:
- Stop the server:
./mcserver stop
- Restart the server:
./mcserver restart
- Update the server:
./mcserver update