How to Setup a Minecraft Server on a VPS

Minecraft Server Screenshot

Players and Server Admins: A Step-by-Step Guide

Have you ever considered hosting your own server; just for you and your friends, or for an entire community? HammerVM's high-performance servers can that possible, at some of the most affordable rates.

This guide will walk you through setting up a Minecraft server on a Linux VPS from HammerVM. Beginners are welcome!


Why Host Minecraft with HammerVM?

HammerVM offers a performance-optimized, reliable, and scalable setup. We recommend, for an unbeatable experience at all times, our Basic Hybrid package:

  • 16-core AMD Epyc 7642 CPU
  • 16GB DDR4 ECC RAM
  • 200GB NVMe SSD Storage
  • 5 Gbit/s Bandwidth (fair usage policy)

Choosing a VPS over shared game hosting for Minecraft provides several advantages:

  • Dedicated Resources: With a VPS, you have guaranteed CPU, RAM, and storage, ensuring optimal performance without interference from other users.
  • Customization: You can configure your server settings to suit your specific needs, allowing for a tailored gaming experience.
  • Scalability: Easily upgrade your resources as your player base grows, ensuring a smooth experience for all users.
  • Enhanced Security: VPS hosting provides better security measures, protecting your game and data from potential threats.

Step-by-Step: Setting Up Your Game Server

1. Log In To Your VPS

Visit www.hammervm.com and log in. Choose your VPS and install Debian 12 with at least 16GB of RAM, then open the VNC console.

2. Update Your OS

sudo apt update && sudo apt upgrade -y
sudo apt install default-jre

3. Set Up a Dedicated Minecraft User (You will be prompted to set a password)

sudo adduser minecraft
sudo usermod -aG sudo minecraft

Log out of the Root user:

exit

Log in as the Minecraft user.

4. Download the Minecraft Server Files

mkdir minecraft && cd minecraft
wget https://launcher.mojang.com/v1/objects/3737db93722a9e39eeada7c27e7aca28b144ffa7/server.jar -O minecraft_server.1.17.jar

5. Create a Script to Launch the Server

sudo apt install vim 
vim run.sh

Insert the following into the file (if you cannot copy it, you may need to enter it manually. Press "i" to enter insert mode, type the text, then press "escape" when you are done and proceed to the next step):

#!/bin/bash
java -Xms8G -Xmx12G -jar minecraft_server.1.17.jar -o true

Exit the text editor and save the file:

:wqa!

Make the script executable:

chmod +x run.sh

Run the script to initialize and generate files (it won't start up correctly yet):

./run.sh

Inject the EULA agreement into the eula.txt (now the script will be able to run properly):

echo "eula=true" > eula.txt

Configure the firewall to allow the correct Minecraft port to be used:

sudo apt install iptables
sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPT

6. Use Tmux to Keep the Server Running

sudo apt install tmux
tmux new-session -s minecraft bash run.sh

To detach the session:

Ctrl + B, then D

To reattach or kill the session:

tmux attach-session -t minecraft
tmux kill-session -t minecraft

Recommended Settings

Edit the server.properties file using the vim text editor:

server-port=25565
server-ip=
level-name=world
online-mode=true
motd=Welcome to My First Server!
max-players=20

Final Thoughts

Hosting with HammerVM is ideal for gamers, educators, and communities. You'll have full control and powerful features at your fingertips.

Whether you're building a creative paradise or a survival challenge, HammerVM can handle it.

Get started: https://www.hammervm.com/servers

Document Publish Date: 11th of May, 2025

Close

Discount     Save 35% using discount code FREEPALESTINE 🇵🇸 Order a VPS