How to Host Your Own Minecraft Server

by Leonel Mosciski
17 minutes read

How to Host Your Own Minecraft Server

A image of a user wearing headphones and manipulating the computer.

Minecraft is a truly modern-made game and a vast portion of its luster is the aptitude to sprinted your own servers. It’s amazingly humble to host a Minecraft server, and you can fetch one upwards and running applicable away. Listed below we stress you how you can host a Minecraft server, both as a system treatment and a Docker container.

Web content
  • Why Host Your Own Minecraft Server?
  • Prepping the System for the Minecraft Server
  • Mounting and Rushing the Server
  • Modernizing the Default Server Arrangement
  • Rushing a Minecraft Server in Docker

Why Host Your Own Minecraft Server?

One of the best validations why you should host your own Minecraft server is that it supplies you personal seclusion over your Minecraft earth. Hosted corrects, such as Minecraft Realms, are expose to Mojang’s rigorous legislation, which can lead to ridiculous and ungrounded worldwide bans for your players.

Apart from that, ensconcing upwards your own Minecraft server in a equivalent technique supplies you comprehensive govern over your earth’s measurement documents. This enables you to ago upwards your earth and execute server-wide edits using WorldEdit and Litematica.

A screenshot of a Minecraft consumer running Litematica.

Ultimately, self-ensconcing upwards a Minecraft earth enables you to introduce gameplay equalizes using assorted mods and mod packs. For instance, alignment Minecraft Spigot Server on a clutched treatment is unobtainable if either your institution’s internet panel or ensconcing upwards strategy doesn’t perfuse it.

On a side note: explore some of the greatest sandbox galleries that aren’t Minecraft.

Prepping the System for the Minecraft Server

Guess: The instruction listed below is executed on an Ubuntu tools using 4GB of RAM from DigitalOcean. It in a equivalent technique theorizes that you presently own a domain moniker which you can contain DNS records to.

You’re attending behavior a couple of software agenda packages before you can sprinted the Minecraft server. You can place them harmonized using Ubuntu’s proper strategy company. Start by running the obeying command in the terminal on your server:

sudo apt install default-jdk tmux wget
A terminal mirroring the dependences for the Minecraft server.

Attend your domain registrar’s DNS records page, after that design a modern “A” record advising to your Minecraft server’s IPv4 address:

A screenshot mirroring the DNS record for the Minecraft server.

Inflict the directory wherein you want to sprinted the server and go inside it. You can do every little thing out of your domicile directory, if that’s most challenge-cost-free for you:

mkdir ~/minecraft && cd ~/minecraft

Amenable a internet internet browser on your host tools, after that peruse to Minecraft’s server download page.

Situate the download internet linkage for the server’s .jar record, after that copy that internet linkage to your system’s clipboard.

A screenshot mirroring the place of the download internet linkage for the Minecraft server.

Revert to your server’s terminal window, devise the obeying command, after that paste the internet linkage on your clipboard:

wget -O minecraft_server.jar PASTE-YOUR-LINK-HERE
A terminal mirroring the process of downloading the server .jar record manipulating wget.

In order to sprinted the latest Minecraft server, you should approve the game’s EULA. You do that by designing a “eula.txt” record in the same directory as your server. The server will possibly read the record and explore that you’ve welcomed the certification:

echo "eula=true" > eula.txt

Mounting and Rushing the Server

You wear’t behavior a startup manuscript, yet it’s easier to simply meld things applicable into a manuscript so you single should sprinted one command to prelude upwards your server. Start funneling out a modern record by opening it using your message editor:

nano ./start-server.sh

Paste the obeying block of code inside your modern manuscript record:

#!/bin/bash   tmux new-session -s $1 '/usr/bin/java -Xmx4096M -Xms4096M -jar minecraft_server.jar nogui'

Chit: You can unknowingly sprinted this manuscript on the history by adding a -d flag after the new-session subcommand.

Preserve your manuscript and exit the message editor. You’ll in a equivalent technique should supply your manuscript executable before you can sprinted it:

chmod u+x ./start-server.sh

You’re finally enthused to prelude upwards your server. Impart it a moniker that you can comfortably determine in estimates when you sprinted the manuscript:

./start-server.sh "my-server"

Your server will possibly prelude upwards and collect your earth’s finish and biomes. Wait till it prints “Done!” on the server incite.

A terminal mirroring the

Amenable your Minecraft consumer, surf through the Multiplayer display, after that click “Incorporate Server.”

Lend a moniker for your modern record, after that kind the comprehensive address of your server.

A screenshot mirroring the server outlines incite in the Minecraft consumer.

Checkup your relationship to your modern Minecraft server by double-clicking the server’s access on the Multiplayer display.

A screenshot mirroring the checklist of available servers in the Minecraft consumer.

Policy: learn how you can spurt your Minecraft consumer manipulating OptiFine.

Modernizing the Default Server Arrangement

While the default server config will possibly job for most users, it’s thinkable to readjust how your server ordinances by editing and simplifying its “server.freeholds” record. This includes the core smorgasbords for your server, such as its holdup ensconcing, supply range, and level seed.

Overture by running the stop command on your server’s console to beautifully conserve and shut down your Minecraft earth.

A terminal mirroring the "inhibit" command on the running server.

Render sure that you’re in your server’s directory, after that design a fallback of your original “server.freeholds” record:

cd ~/minecraft-server && cp ./server.properties ./server.properties.backup

Amenable the original server.freeholds record manipulating your favorite message editor:

nano ./server.properties

Within, you can readjust every default variable of your server to your liking. For instance, rising and fall the pvp variable to “not true” will possibly deactivate any kind of player battle for the server.

A terminal emphasizing the "pvp" variable inside the server.freeholds record of the Minecraft server.

Preserve the alterations that you’ve channeled out on your server.freeholds record, after that sprinted ./start-server.sh my-server to reload your server using your modern config.

Rushing a Minecraft Server in Docker

Apart from being a system treatment, you can in a equivalent technique sprinted your Minecraft server as a Docker container. This enables you to comfortably deploy and slide your server from one tools to one more too as readjust and retrieve your server to any kind of Minecraft iteration that you want.

Overture by alignment Docker on your Linux tools, after that sprinted docker -v to confirm that the daemon is massaging duly.

A terminal mirroring the Docker daemon massaging duly on the tools.

Render a modern folder in your domicile directory, after that go inside it:

mkdir -p ~/minecraft-docker/data && cd ~/minecraft-docker

Inflict a “docker-compose.yml” record inside your Minecraft Docker directory manipulating your favorite message editor:

nano ./docker-compose.yml

Paste the obeying block of code inside your Docker Devise record:

services:   mc:     image: itzg/minecraft-server     tty: true     stdin_open: true     ports:       - "25565:25565"     environment:       EULA: "TRUE"       VERSION: "1.20.6"     volumes:       - ./data:/data

Preserve your Devise record, after that sprinted the obeying command to prelude the build process:

sudo docker compose up -d

Filter at that the Minecraft server is running by checklist the boisterous canisters in the system:

docker ps
A terminal mirroring the Minecraft container running duly on the server.

Attach to your modern Minecraft earth by attending your consumer’s Multiplayer food selection, after that issuing your server’s address under “Direct Relationship.”

A screenshot mirroring the Minecraft earth running inside the Docker container.

Regaining the Minecraft Server Cyndrical tube

One of the characteristics of manipulating Docker is that it’s truly basic to readjust the core portions of your Minecraft server, such as its iteration, mod structure, and networking caboodle. This can be especially vital you want to try out assorted server configs without spending on a full server controller pick Crafty.

Overture by shutting down your Docker Devise release:

sudo docker compose down

Amenable your “docker-compose.yml” record manipulating your favorite message editor:

nano ~/minecraft-docker/docker-compose.yml

Scroll down to the “env:” void, contain the “TYPE” variable under “VERSION,” after that finalized its worth to “document.”

A terminal emphasizing the "TYPE" variable using a worth "document."

Preserve your modern .yml record, after that sprinted sudo docker compose up -d to retrieve your modern Minecraft server using the Paper backend.

A screenshot mirroring the "Paper" server running duly inside Docker.

Situating out how to host your own Minecraft server is simply one of the couple of things that you can do using this terrific sandbox game. Explore the assorted universes that you can collect by sifting at some of the greatest Minecraft seeds available today.

Image credit score: ELLA DON using Unsplash. With one voice alterations and screenshots by Ramces Red.

Related Posts