Minecraft Server

Prerequisites

You can any computer, even the one that is running the game, does not have to be super fancy like people say :0. This guide is for the Linux population though, so if the computer is running Windows or MacOS, your mileage might vary

Installing Java

To run the Minecraft server, you first need to install Java. This is usually a pain because there are so many versions owned by different people. Supposedly they are all able to work with one another, However, that is not usually the case in my expereince. What works as of writing this is from Oracle and its not even the latest version. As of writing this, Java 25 is the newest, but 21 is what works the best (Gives no Warnings). If this guide is out of date, find a guide for how to install the latest (Maybe a few behind) version of Java

curl -O -L https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb

sudo dpkg -i jdk-21_linux-x64_bin.deb

sudo apt -f install

java --version


If you have multiple versions of Java installed:

sudo update-alternatives --config java

Setting Up The Environment

Now that Java is installed on the system. We need to make a location on the system for all of the files for the server. This can be anywhere, it really does not matter, just a safe spot where it will not get randomly altered. For my example I am putting it in my /home directory

mkdir minecraft_server

cd minecraft_server

Installing Minecraft Server

Next we need to download the actual server.jar file from Minecrafts site. Based on the url, it will most likely change, but you can go to Minecrafts offical site, find the server file location and cURL that file. You can right click the file with the hyperlink and thats what is similar to the command below, if there is a change: https://www.minecraft.net/en-us/download/server

curl -O https://piston-data.mojang.com/v1/objects/64bb6d763bed0a9f1d632ec347938594144943ed/server.jar

Setting Up The Server

You have to first start the server as a dry run to populate the directory

java -jar server.jar

Configure The Server

Now we have all of the files that are needed to properly run the server. You need to edit the eula.txt to eula=true, then edit server.properties to equal whatever you like. Important things that could be edited are level-seed=(Custom seed), server-port=25565 (Default), server-ip= (Custom IP [Not needed]), but that would be up to you

vim eula.txt

vim server.properties

Running The Server

Now you are ready to run the server and play the game! First we will find the LAN IP address of the computer running the server so we can connect to it. Use ip a to find this, look for inet (ip address) under wlo1 or eth0 and that is the address to use on the LAN network. Anyone on your LAN (Local WiFi) can now connect to this address. If you want people outside your LAN to access the server, you can port forward your router or use a VPN such as Tailscale to do so. Port fowarding your router is the easiest, but every router is different, so I will not cover it. If you know how to use Tailscale, just setup Tailscale on the same machine as the Minecraft server, and use the Tailscale ip for that device when connecting to the server

ip a

java -jar server.jar

Connecting To The Server

Lastly, we have to add the server to our Minecraft Client. Open Minecraft, go to Mulitplayer, Add Server, name it and add the ip address that we found above. Boom! All done :)