Thanks itzg for creating this amazing docker image, it’s super easy to use and allow you to spin up a minecraft server under 5 minutes.
Creating docker environment
First you need to have a Linux machine that’s able to run docker.
Follow the docker offical guide to install docker
Also install docker-compose
to manage container eaiser, guide can be found here
Set up minecraft
docker image
Use your favorite text editor to create a docker-compose.yml
file, populate it with the following content:
docker-compose.yml
version: "3"
services:
mc:
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
tty: true
stdin_open: true
restart: unless-stopped
volumes:
# attach a directory relative to the directory containing this compose file
- ./minecraft-data:/data
Run docker-compose up -d
and that’s it your Minecraft server is up and running!
More RAM!
If you need more RAM, add environment variable MEMORY
like this
version: "3"
services:
mc:
container_name: minecraft-server
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
MEMORY: "4G"
tty: true
stdin_open: true
restart: unless-stopped
volumes:
# attach a directory relative to the directory containing this compose file
- ./minecraft-data:/data
Fabric server with lithium and phosphor mods.
Change the docker-compose.yml
file as following:
version: "3"
services:
mc:
container_name: minecraft-server
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
MEMORY: "4G"
TYPE: FABRIC
tty: true
stdin_open: true
restart: unless-stopped
volumes:
# attach a directory relative to the directory containing this compose file
- ./minecraft-data:/data
Go to the Minecraft folder, it should be called minecraft-data
as set above. Inside there is a mods
folder where you put your server mod. Go there, for me it should be minecraft-data/mods
and download lithium and phosphor:
Lithium can be found in it’s Github release page.
Phosphor can be found in it’s Github release page.
wget https://github.com/CaffeineMC/lithium-fabric/releases/download/mc1.18.1-0.7.7/lithium-fabric-mc1.18.1-0.7.7.jar
wget https://github.com/CaffeineMC/phosphor-fabric/releases/download/mc1.18.x-0.8.1/phosphor-fabric-mc1.18.x-0.8.1-dev.jar
Then you are done, go back to the fold where you have your docker-compose file
sudo docker-compose up -d
The fabric server with lithium and phosphor mods should be up and running!