Valkyrie Hosting is now part of Vluxon Inc.One team, one expanded platform and a broader hosting ecosystem built to deliver more for every customer.

Back to VPS Servers
VPS Servers

Install Minecraft Server on VPS: Complete Setup Guide

Learn how to install a Minecraft server on VPS with this complete setup guide. Get dedicated resources, guaranteed uptime & full control for optimal gameplay.

3 min read

Install Minecraft Server on VPS: Complete Setup Guide

A Virtual Private Server (VPS) provides an optimal hosting environment for Minecraft servers, offering dedicated resources, guaranteed uptime, and full administrative control. This setup eliminates the limitations of personal computer hosting while providing a stable, dedicated IP address for your server.

Note: This guide uses Ubuntu 22.04 as the base operating system.

Java Edition Installation

Prerequisites and Java Setup

  1. Connect to your VPS server via SSH

  2. Update the system package repository:

    sudo apt-get update
    
  3. Install the appropriate Java version based on your Minecraft version:

    sudo apt install [OpenJDK version]
    

Java Version Requirements

Minecraft Version Java Version OpenJDK Package
1.16.x and below Java 8 openjdk-8-jre-headless
1.17.x Java 16 openjdk-16-jre-headless
1.18.x - 1.20.4 Java 17 openjdk-17-jre-headless
1.20.5 and above Java 21 openjdk-21-jre-headless
  1. Confirm installation when prompted by entering y

Server Environment Setup

  1. Install screen for session management:

    sudo apt install screen -y
    
  2. Create a dedicated user for the Minecraft server:

    sudo useradd -r -U -d /usr/local/games/minecraft_server/ -s /usr/sbin/nologin [Username]
    

    Security Note: Never use root or privileged users to prevent security vulnerabilities.

  3. Create the server directory structure:

    sudo mkdir -p /usr/local/games/minecraft_server/java
    
  4. Assign ownership to the Minecraft user:

    sudo chown -R [Username]: /usr/local/games/minecraft_server/
    

Server Installation and Configuration

  1. Switch to the Minecraft user:

    sudo su - [Username] -s /bin/bash
    
  2. Navigate to the Java server directory:

    cd /usr/local/games/minecraft_server/java
    
  3. Download the server JAR file (obtain links from MCVersions.net):

    wget [server.jar link]
    
  4. Create a screen session:

    screen -S [Screen name]
    
  5. Perform initial server boot:

    java -Xmx1024M -Xms1024M -jar server.jar nogui
    
  6. Accept the End User License Agreement:

    sed -i 's/\bfalse\b/TRUE/' eula.txt
    
  7. Launch the server with custom RAM allocation:

    java -Xmx1024M -Xms1024M -jar server.jar nogui
    

    Adjust -Xmx and -Xms values based on your VPS RAM allocation.

Bedrock Edition Installation

Initial Setup

  1. Connect to your VPS server via SSH

  2. Install required packages:

    sudo apt install screen -y
    
  3. Navigate to the temporary directory:

    cd /tmp
    
  4. Download the Bedrock server (obtain links from the official Minecraft wiki):

    wget [server link]
    

Server Extraction and Configuration

  1. Install unzip utility and extract server files:

    apt-get install unzip
    sudo unzip -d /usr/local/games/minecraft_server/bedrock [.zip filename]
    
  2. Create a dedicated user account:

    sudo useradd -r -U -d /usr/local/games/minecraft_server/ -s /usr/sbin/nologin [Username]
    
  3. Create the Bedrock directory:

    sudo mkdir -p /usr/local/games/minecraft_server/bedrock
    
  4. Set directory permissions:

    sudo chown -R [Username]: /usr/local/games/minecraft_server/
    

Launch Script Creation

  1. Switch to the Minecraft user:

    sudo su - [Username] -s /bin/bash
    
  2. Navigate to the Bedrock directory:

    cd bedrock
    
  3. Create the launch script:

    nano launch_mc_bedrock_server.sh
    
  4. Add the following content to the script:

    #!/bin/bash
    LD_LIBRARY_PATH=. ./bedrock_server
    
  5. Save and exit (Ctrl+S, then Ctrl+X)

  6. Make the script executable:

    chmod +x launch_mc_bedrock_server.sh
    

Server Launch

  1. Create a screen session:

    screen -S [Screen name]
    
  2. Launch the Bedrock server:

    ./launch_mc_bedrock_server.sh
    

Related Articles

Want hassle-free Minecraft hosting? View Vluxon Minecraft Server plans with instant setup, or deploy on your own VPS for full control.