Introduction

This time, we will teach you how to create a basic Minecraft Server on Linux, so you can play locally with your friends.


Hosting a Minecraft server unlocks a tonne of additional control over how you play Minecraft with your friends. You can change the game rules and difficulty, the behaviour of enemies and determine how players interact.


Reference


Note
We’ll be using Ubuntu Desktop 22.04 for in this tutorial.

STEP 1

Download and Install your System

You can get system from Debian and Ubuntu (Common Systems)

XUyzXn.md.jpg

XU6900.md.jpg

STEP 2

Make sure all software are the latest

whenever we start a new project, it’s always important to make sure everything is up to date.


open a Terminal and type:


1
2
sudo apt update
sudo apt upgrade

STEP 3

Install JAVA

Minecraft servers are based on Minecraft Java Edition, the original version of Minecraft, so our next step is to install Java on our Computer.

1
sudo apt install openjdk-18-jre

Type Y to continue

STEP 4

Download Minecraft Server

There are two ways to download.

In your browser, go to this page: https://www.minecraft.net/en-us/download/server

XU6pmq.md.jpg

Download the server file or use wget to download in Terminal

1
wget

Download minecraft_server.1.18.2.jar

(Make sure you download the latest, this is just a example)


STEP 5

Create a folder for your server

Use GUI or use terminal

1
mkdir Minecraft-Server

Go to the folder

1
cd Minecraft-Server

Bring the file you downloaded to the folder

1
mv server.jar Minecraft-Server

STEP 6

Start the server

Type this will lead error. >_<


1
java -Xmx1024M -Xms1024M -jar minecraft_server.1.18.2.jar nogui

This command on the official website won’t work, Because the file on your folder is called server.jar

This is the right one —>

1
java -Xmx1024M -Xms1024M -jar server.jar nogui

Emmmm…..

STEP 7

One More Step

We need to agree to the EULA (End User License Agreement )before we can get started.

XUyx6s.md.jpg

1
sudo gedit eula.txt

Now you just need to change the eula line to true instead of false.

STEP 8

Start the server again

1
java -Xmx1024M -Xms1024M -jar server.jar nogui

171652688193_.pic_hd.jpg.webp

171652688193_.pic_hd.jpg.webp

Source: Ubuntu’s Post

STEP 9

Some Commands

You can stop your server any time by typing

1
stop

STEP 10

Modifying your Server Settings

Server.properties is a file that stores all the settings of the multiplayer game (Minecraft or Minecraft Classic) server.

When editing server.properties, even if the order between different rows can be disrupted, it is important to ensure that it has the same structure as the original file.

1
sudo gedit server.properties

Java Edition

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#Minecraft server properties
#(timestamp of first initializing)
enable-jmx-monitoring=false
rcon.port=25575
level-seed=
gamemode=survival
enable-command-block=false
enable-query=false
generator-settings={}
level-name=world
motd=A Minecraft Server
query.port=25565
pvp=true
generate-structures=true
max-chained-neighbor-updates=1000000
difficulty=easy
network-compression-threshold=256
require-resource-pack=false
max-tick-time=60000
use-native-transport=true
max-players=20
online-mode=true
enable-status=true
allow-flight=false
broadcast-rcon-to-ops=true
view-distance=10
server-ip=
resource-pack-prompt=
allow-nether=true
server-port=25565
enable-rcon=false
sync-chunk-writes=true
op-permission-level=4
prevent-proxy-connections=false
hide-online-players=false
resource-pack=
entity-broadcast-range-percentage=100
simulation-distance=10
rcon.password=
player-idle-timeout=0
force-gamemode=false
rate-limit=0
hardcore=false
white-list=false
broadcast-console-to-ops=true
spawn-npcs=true
spawn-animals=true
function-permission-level=2
level-type=minecraft\:normal
text-filtering-config=
spawn-monsters=true
enforce-whitelist=false
resource-pack-sha1=
spawn-protection=16
max-world-size=29999984

Default as of 22w11a.


Find more from minecraft.fandom.

STEP 11

Connecting to your Minecraft server remotely

NAT Service

For Another Time. >_<


Here We Are, Thank You Very Much.