India English
Kenya English
United Kingdom English
South Africa English
Nigeria English
United States English
United States Español
Indonesia English
Bangladesh English
Egypt العربية
Tanzania English
Ethiopia English
Uganda English
Congo - Kinshasa English
Ghana English
Côte d’Ivoire English
Zambia English
Cameroon English
Rwanda English
Germany Deutsch
France Français
Spain Català
Spain Español
Italy Italiano
Russia Русский
Japan English
Brazil Português
Brazil Português
Mexico Español
Philippines English
Pakistan English
Turkey Türkçe
Vietnam English
Thailand English
South Korea English
Australia English
China 中文
Canada English
Canada Français
Somalia English
Netherlands Nederlands

How to Set Up a Minecraft Server on VPS Ubuntu (Complete Beginner)

So, you’re ready to ditch the laggy public servers and become the master of your own Minecraft domain?

Awesome.

Let’s get this done.

This guide is for complete beginners who want to set up a Minecraft server on a VPS running Ubuntu. We’ll break it down step-by-step, no tech wizardry required.

Why a VPS?

  • Control: You make the rules. No more unwanted griefers or annoying admins.
  • Performance: VPS servers offer dedicated resources, meaning smoother gameplay and less lag.
  • Customization: Mod it up! Install plugins, create custom worlds, and tailor the experience to your liking.

What You’ll Need:

  • A VPS (Virtual Private Server) running Ubuntu: Think of this as your server’s home. Providers like Linode, DigitalOcean, and Vultr offer affordable options.
  • PuTTY (Windows) or Terminal (Mac/Linux): This is your tool to connect to your VPS.
  • Basic computer skills: You should be comfortable navigating files and folders.

Let’s get started!

Read also: Is Minecraft Server Hosting the Same as VPS? The Truth

How to Set Up a Minecraft Server on VPS Ubuntu

1. Prepare Your VPS

Think of this as laying the foundation for your Minecraft empire.

  • Connect to your VPS: Fire up PuTTY or Terminal and enter your VPS credentials. You’ll get a command-line interface – don’t worry, it’s not as scary as it looks.
  • Update and upgrade: Keep your system fresh. Run these commands:

Bash

sudo apt update
sudo apt upgrade -y
  • Install Java: Minecraft needs Java to run. We’ll install OpenJDK 17:

Bash

sudo apt install openjdk-17-jre-headless -y
  • Verify Java installation:

Bash

java -version

You should see output similar to openjdk version "17.0.x".

Key Takeaway: A well-maintained VPS is a happy VPS. These initial steps ensure your server is up-to-date and ready to roll.

2. Set Up the Minecraft Server

Time to build our world, block by block.

  • Create a Minecraft directory: This keeps things organized.

Bash

mkdir ~/minecraft
cd ~/minecraft
  • Download the Minecraft server JAR: Grab the latest version from the official Minecraft website. Use wget to download it directly to your server.

Bash

wget https://launcher.mojang.com/v1/objects/e3b2d9e4d27b20a83e1ab2cc36a521b9940c0ad8/server.jar -O server.jar
  • Run the server: This generates necessary configuration files.

Bash

java -Xmx1024M -Xms1024M -jar server.jar nogui
  • Accept the EULA: Minecraft requires you to agree to their End User License Agreement (EULA). Open the eula.txt file with a text editor like nano and change eula=false to eula=true.

Bash

nano eula.txt

Key Takeaway: Downloading the server files and accepting the EULA are essential steps in getting your Minecraft server up and running.

3. Configure Your Server

This is where you customize your Minecraft experience.

  • Server properties: The server.properties file is your control panel. Here you can adjust game modes, difficulty, player limits, and much more. Open it with nano and explore the options. Some key settings:
    • gamemode: survival, creative, adventure, spectator
    • difficulty: peaceful, easy, normal, hard
    • motd: The message that displays when players join your server.
    • max-players: Set the maximum number of players.
  • Whitelist: Want to keep your server exclusive? Add your friends’ Minecraft usernames to the whitelist.json file.
  • Customize your world: Generate a new world with custom settings, or upload an existing world.

Key Takeaway: Don’t be afraid to experiment with the server properties. This is your chance to create a unique Minecraft experience.

4. Run Your Server in the Background

You don’t want to keep your terminal window open forever, right?

  • Screen: This handy tool lets you run your server in the background, even if you disconnect from your VPS.

Bash

sudo apt install screen
screen -S minecraft
  • Start the server: Inside the screen session, run your server JAR file.

Bash

java -Xmx1024M -Xms1024M -jar server.jar nogui
  • Detach from the screen: Press Ctrl + A + D to detach from the screen session. Your server will continue running in the background.
  • Reattach to the screen: To check on your server or stop it, use:

Bash

screen -r minecraft

Key Takeaway: Screen is your best friend for keeping your server running 24/7.

5. Connect to Your Server

Time to join the party!

  • Get your server’s IP address: You’ll need this to connect. Find it in your VPS control panel.
  • Open Minecraft: Launch Minecraft on your computer.
  • Add server: In the Multiplayer menu, click “Add Server.”
  • Enter your server details: Give your server a name and enter its IP address.
  • Join the server: Click “Done” and then join your server from the server list.

Key Takeaway: Make sure you have the correct IP address and port number (default is 25565) to connect to your server.

Advanced Tips (Optional)

Want to take your server to the next level?

  • Allocate more RAM: If you have a lot of players or are running resource-intensive mods, you may need to allocate more RAM to your server.
  • Install mods and plugins: Spice things up with custom gameplay mechanics, new items, and more.
  • Set up a domain name: Give your server a memorable address instead of an IP address.
  • Secure your server: Implement security measures to protect your server from attacks.

Read also: How Much RAM Do You NEED for a Minecraft VPS?

Key Takeaway: There’s a whole world of customization options available. Don’t be afraid to explore and experiment!

Congratulations!

You’ve just set up your own Minecraft server on a VPS.

But it doesn’t stop here, you need to start using.

Read also: Cost of Running a Minecraft Server on VPS (Latest Figures)

The Ultimate Ubuntu Minecraft Server Startup Script

Tired of manually starting your Minecraft server every time your VPS reboots?

Waste of time, right?

Let’s automate that.

This guide shows you how to create a startup script that automatically launches your Minecraft server on boot. Think of it as your server’s autopilot.

Why a Startup Script?

  • Convenience: No more logging in and starting the server manually.
  • Reliability: Ensures your server is always online, even after reboots or crashes.
  • Efficiency: Saves you time and hassle.

What You’ll Need:

  • A running Minecraft server on Ubuntu: If you haven’t set one up yet, check out our guide on “How to Set Up a Minecraft Server on VPS Ubuntu (Complete Beginner).”
  • Basic familiarity with the Linux command line: You should be comfortable navigating directories and editing files.

Let’s get scripting!

1. Create the Script

Use nano to create a new file called minecraft.sh in your home directory.

Bash

nano ~/minecraft.sh
  • Add the following script: This script navigates to your Minecraft server directory, starts a screen session, and launches the server.

Bash

#!/bin/bash

cd /home/your_username/minecraft
screen -S minecraft -dm java -Xmx1024M -Xms1024M -jar server.jar nogui
  • Replace your_username with your actual username.
  • Adjust Xmx and Xms values to match your server’s RAM allocation.

This script automates the process of starting your Minecraft server within a screen session.

2. Make the Script Executable

  • Grant execute permissions: This allows the system to run the script.

Bash

chmod +x ~/minecraft.sh

Without execute permissions, your script is just a text file.

3. Create a Systemd Service

  • Create a service file: This tells Ubuntu to run your script on startup.

Bash

sudo nano /etc/systemd/system/minecraft.service
  • Add the following content:

Ini, TOML

[Unit]
Description=Minecraft Server
After=network.target

[Service]
User=your_username
WorkingDirectory=/home/your_username/minecraft
ExecStart=/home/your_username/minecraft.sh
Restart=always

[Install]
WantedBy=multi-user.target
  • Replace your_username with your actual username.

Key Takeaway: Systemd is a powerful tool for managing services in Ubuntu.

4. Enable and Start the Service

  • Enable the service: This ensures it starts on boot.

Bash

sudo systemctl enable minecraft.service
  • Start the service:

Bash

sudo systemctl start minecraft.service
  • Check the service status:

Bash

sudo systemctl status minecraft.service

You should see a green “active (running)” status.

Key Takeaway: Enabling and starting the service puts your automation into action.

5. Troubleshooting

If your server isn’t starting, check the logs for errors.

Bash

sudo journalctl -u minecraft.service
  • Review the script: Make sure the paths and commands in your script are correct.
  • Verify screen is installed: Ensure you have screen installed on your server.

Don’t panic if things don’t work perfectly at first.

Troubleshooting is part of the process.

Congratulations!

You’ve successfully automated your Minecraft server startup. Now you can focus on building your world, not managing your server.

Read also:

Author

× WhatsApp us