Want to create your own Minecraft world to share with friends, or maybe build an epic survival realm? Setting up your own server is the way to go! While the idea of server administration might seem daunting, we're here to show you how easy it can be, especially when you leverage the power of automated deployments with DeployHQ.
This guide will walk you through setting up a Minecraft server on a Linux VPS, designed for beginners and seasoned players alike. We'll streamline the process, ensuring your server is up and running in no time, with the added benefit of easy updates and management thanks to DeployHQ.
What You'll Need
Before we dive in, let's gather our tools:
- A Linux VPS: We recommend an Ubuntu 20.04 or Debian-based VPS. These are user-friendly and cost-effective. For this guide, we'll assume you have a VPS with at least 2 vCPUs, 4 GB of RAM, and 50 GB of SSD storage.
- DeployHQ Account: This is where the magic happens! If you don't have one, sign up for a free trial to get started.
- SSH Client: For initial server access (e.g., Xshell for Windows, Terminal for macOS/Linux).
Step 1: Prepare Your VPS
First things first, you need to get your VPS ready. This involves connecting to it and ensuring it has the necessary components for Minecraft.
Connect to Your Server via SSH
Open your SSH client and connect to your VPS using the following command, replacing your-server-IP
with your actual server's IP address:
ssh root@your-server-IP
When connecting for the first time, you'll need to enter the root password you set when you purchased your VPS.
Install Java (Minecraft's Prerequisite)
Minecraft, being a Java application, requires a Java Runtime Environment (JRE) to run. We'll install Java 17, which is a good stable version for Minecraft servers.
First, update your package lists:
sudo apt update
Then, install Java 17:
sudo apt install -y openjdk-17-jdk
Verify the installation by running:
java -version
If you see output similar to openjdk version "17"
, you're good to go!
Step 2: Set Up Your DeployHQ Project
Now, let's integrate DeployHQ into our workflow. This is where we'll set up the automated deployment process.
Create a New Project in DeployHQ
- Log in to your DeployHQ account.
- Click on New Project.
- Give your project a descriptive name (e.g., "Minecraft Server").
- Choose your repository type. If you're managing your server files (like the
server.jar
or configuration files) in a Git repository (e.g., GitHub, GitLab, Bitbucket), select that option. This is highly recommended for version control and easier updates. If not, you can use SFTP/FTP, but a Git-based approach offers more benefits for automation. - Follow the on-screen prompts to connect your repository.
Configure Your Server in DeployHQ
- Once your project is created, navigate to the Servers section.
- Click New Server.
- Server Name: Give it a name (e.g., "Minecraft Production Server").
- Deployment Protocol: Select SSH/SFTP.
- Hostname: Enter your VPS's IP address.
- Port: The default SSH port is
22
. - Username: Use
root
(or a dedicated server user you've created for deployments). - Authentication: For security and automation, we highly recommend using SSH Key authentication.
nano ~/.ssh/authorized_keys
Paste the public key on a new line, save, and exit.
- Deployment Path: This is where your Minecraft server files will live on your VPS. Let's create a directory for it:
/opt/minecraft
. You can add this in the DeployHQ configuration.
Step 3: Deploy Your Minecraft Server Files
This is where the automation truly shines!
Prepare Your Repository (if using Git)
If you're using a Git repository, you'll want to include your server.jar
and a basic eula.txt
file (with eula=true
already set to skip the manual step) in your repository.
- Download the Minecraft Server JAR: Go to the official Minecraft website to get the link for the latest server
.jar
file.- Use
wget
on your local machine (or directly on the server if you prefer, but for DeployHQ, it's better to have it in your repo):
- Use
wget https://launcher.mojang.com/v1/objects/YOUR_MINECRAFT_SERVER_LINK/server.jar -O minecraft_server.jar
Important: Replace YOUR_MINECRAFT_SERVER_LINK
with the actual URL from the official Minecraft website.
- Create
eula.txt
: In the same directory where you downloadedminecraft_server.jar
, create a file namedeula.txt
with the following content:
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms/MinecraftEULA).
#Fri Jun 19 08:50:06 CEST 2025
eula=true
- Commit and Push: Add these files to your Git repository, commit them, and push them to your remote branch.
Configure DeployHQ Deployment
- In your DeployHQ project, go to the Deployments section.
- Select your configured server.
- Deployment Mode: Choose Automatic or Manual. For your first deployment, manual might be helpful, but automatic deployments are great for continuous integration.
Deployment Steps: This is crucial. We'll add commands to be executed on your VPS after the files are deployed.
Add the following commands as "After Deployment" hooks in DeployHQ:
# Create the directory if it doesn't exist
mkdir -p /opt/minecraft
# Change to the deployment directory
cd /opt/minecraft
# Move the deployed files to the correct location (if not directly deployed there)
# This might not be needed if your deployment path is already /opt/minecraft
# mv /path/to/deployed/minecraft_server.jar /opt/minecraft/minecraft_server.jar
# mv /path/to/deployed/eula.txt /opt/minecraft/eula.txt
# Start the Minecraft server using screen for persistence
# We use 'screen -dmS minecraft_server' to run it in a detached screen session,
# allowing the server to continue running even after the SSH session ends.
# -Xmx2G -Xms1G allocates 2GB max and 1GB min RAM. Adjust as needed.
# nogui prevents the graphical interface.
screen -dmS minecraft_server java -Xmx2G -Xms1G -jar minecraft_server.jar nogui
Explanation of the screen
command:
-`screen`: A terminal multiplexer.
-`-dmS minecraft_server`: Starts a new screen session in detached mode (`-d -m`), and names it `minecraft_server` (`-S`). This means the server will run in the background.
-`java -Xmx2G -Xms1G -jar minecraft_server.jar nogui`: Your standard Minecraft server startup command.
Step 4: Run Your First Deployment!
With everything configured in DeployHQ, it's time to deploy!
- In DeployHQ, go to the Deployments section for your project.
- Click Deploy (if manual) or trigger a push to your repository (if automatic).
- Monitor the deployment logs within DeployHQ. You should see the files being transferred and the post-deployment commands executing.
If all goes well, you'll see a successful deployment message!
Step 5: Verify Your Server and Open the Port
Check Server Status
You can connect to your VPS via SSH and check if the Minecraft server is running within the screen
session:
screen -r minecraft_server
You should see the Minecraft server console. To detach from the screen session without stopping the server, press Ctrl+A
then D
.
Open the Minecraft Port (25565)
Minecraft uses port 25565
by default. You need to ensure this port is open on your VPS's firewall. For Ubuntu, you can use ufw
(Uncomplicated Firewall):
sudo ufw allow 25565
sudo ufw enable # if firewall is not already enabled
Step 6: Connect to Your Minecraft Server!
Congratulations! Your Minecraft server should now be live.
- Open your Minecraft game client.
- Go to Multiplayer.
- Click Add Server.
- Server Name: Give it a name (e.g., "My DeployHQ Server").
- Server Address: Enter your VPS's public IP address.
- Click Done, then Join Server.
Advanced Tips and Future Deployments
- Customizing
server.properties
: Want to change the MOTD, enable a whitelist, or install plugins? Edit theserver.properties
file (and other configuration files) directly in your Git repository. DeployHQ will automatically deploy these changes on your next deployment. - Server Updates: When a new Minecraft version comes out, simply download the new
server.jar
, update it in your Git repository, commit, and push. DeployHQ will handle the transfer and restart (if your deployment hooks are set up to stop and then restart the server). - Optimized Server Cores: For a more optimized survival experience, consider using server cores like Paper or Spigot. You would download their respective JAR files and use them in place of the official
server.jar
. - Version Control for Configs: Storing your
server.properties
and other configuration files in your Git repository is a best practice. This allows you to track changes, revert if necessary, and easily replicate your server setup. - Stopping the Server During Deployment: For seamless updates without data corruption, you might want to add commands to gracefully stop the Minecraft server before new files are deployed, and then restart it after deployment. This can be done by adding a "Before Deployment" hook in DeployHQ that issues a
screen -S minecraft_server -X quit
command.
Conclusion
Setting up your own Minecraft server with automated deployments using DeployHQ isn't just about getting online; it's about making server management efficient, reliable, and scalable. By leveraging Git for version control and DeployHQ for seamless deployments, you can focus on building epic worlds and enjoying the game with your friends, rather than getting bogged down in manual server administration.
Ready to start your automated Minecraft server journey? Sign up for DeployHQ today and get building!