Tutorial | Build A Vanilla Minecraft Server

Overview

Setting up a Minecraft server on Ubuntu involves:

  1. Preparing your system.

  2. Installing Java.

  3. Downloading and configuring the Minecraft server software.

  4. Running the server.

  5. Configuring server settings.

  6. Setting up port forwarding (if you want external connections).

  7. Testing your server.

Prerequisites

  • A system running Ubuntu LTS (e.g., 22.04 LTS).

  • A user account with sudo privileges.

  • An active internet connection.

  • Basic command-line knowledge.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Step 1: Prepare Your System

  1. Update Package Lists:
    Open your terminal and run: sudo apt-get update. This command updates the list of available packages and their versions.
  2. Install Java:
    Minecraft Java Edition requires Java Runtime Environment (JRE) to run. We’ll install the latest version of OpenJDK.
    Use this command sudo apt install openjdk-17-jre-headless to install.
  3. Confirm that Java is installed:
    java -version
    Expected Output:
    openjdk version "17.0.*" 2023-**
    OpenJDK Runtime Environment (build 17.0.***)
    OpenJDK 64-Bit Server VM (build 17.0.***, mixed mode, sharing)
  4. Create and Navigate to a Dedicated Directory:
    It’s good practice to keep your server files organized.
    FIrst, create a dedicated directory using mkdir ~/minecraft_server  then switch to this directory using  cd ~/ minecraft_server

Step 2: Download and Run

  1. Find the Mineceraft Server Software:
    To find the Latest Version of Minecraft server software, you can access the official Minecraft Java Edition server page to get the URL of the latest server .jar file.
  2. Download the Server JAR:
    Use wget to download the server core file: wget <latest_version_link> -O, Replace <latest_version_link> with the actual download link from the website.
    For example, If the latest version link is https://launcher.mojang.com/v1/objects/abc123/server.jar
    Then use the command of wget https://launcher.mojang.com/v1/objects/abc123/server.jar -O server.jar
  3. Start Your Server:
    Attempting to run the server for the first time generates the necessary configuration files.
  4. Run the Server
    java -Xmx1024M -Xms1024M -jar server.jar nogui
    In the command above,
    • -Xmx1024M sets the maximum RAM to 1024MB.

    • -Xms1024M sets the initial RAM to 1024MB.

    • nogui runs the server without the graphical user interface.

    Note: The server will fail to start and prompt you to accept the EULA.

  5. Accept the EULA:
    Minecraft requires you to accept the End User License Agreement. To edit the EULA file,nano eula.txt and change eula=false into eula=true
  6. Start the Server Again:
    Now that you’ve accepted the EULA, start the server again using the previous starting command java -Xmx1024M -Xms1024M -jar server.jar nogui
    You should see the server start-up process, ending with something like:[Server thread/INFO]: Done (X.XXXs)! For help, type "help"
  7. Create and Navigate to a Dedicated Directory:
    It’s good practice to keep your server files organized.
    FIrst, create a dedicated directory using mkdir ~/minecraft_server  then switch to this directory using  cd ~/ minecraft_server

Basic Configurations

Next, lets customize your server to your preferences. First, stop the server to prevent any conflicts while editing configurations. In the terminal where the server is running, type: stop

123

  1. Customize :
    Use nano to open server.properties: nano server.properties
  2. Settings you might want to adjust:
    • motd: The message that displays in the server list.

    • max-players: Maximum number of players.

    • difficulty: Game difficulty (peaceful, easy, normal, hard).

    • gamemode: Default game mode for players (survival, creative, adventure, spectator).

  3. Save and Exit after making changes.

Now, your server is good to go!

Scroll to Top