Skip to content

lukas362/Homelab-selfhost-minecraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selfhost-Minecraft

This is a overview on how I selfhosted my own minecraft server on my own ubuntu server safely and manage to make it joinable to others. I used itzg/minecraft-server image and made a tunnel via playit.gg so that anyone could connect without the need for port fowarding.

2026-05-23_20 11 16(1)

Features

  • Ansible: Downloads docker and sets it up automatically
  • Docker-compose: Where the configs for the server are located
  • playit.gg tunnel: Makes it so you can play with friends on the same server without having to expose home router with port forwarding
  • RCON: Enabled for bot/automation integrations
  • Auto-pause: Pause server when no players are online for a certain amount of time (saves resources)

What you need before you start

  • A playit.gg account and agent secret key (this will go into the .env file later for saftey)

1. Clone the repo

git clone https://github.com/lukas362/selfhost-minecraft.git

2. Run Ansible to get the dependancies you need

Run the playbook to install Docker on your server:

ansible-playbook -i inventory.ini playbook.yml

3. Create your .env file

.env

Then fill in your secrets:

MC_RCON_PASSWORD=your_secure_rcon_password
PLAYIT_SECRET_TOKEN=your_playit_agent_token

4. Start the server

docker compose up -d

Useful Commands

Action Command
Start server docker compose up -d
Stop server docker compose stop
Restart server docker compose restart
Check status docker compose ps
View MC logs docker compose logs -f mc
View tunnel logs docker compose logs -f playit

Ports that are being used

Port Purpose
25565 Minecraft
25575 RCON

Feel free to fork and adapt this for your own server needs.

About

Overview on how I selfhosted my own minecraft server on my ubuntu server and made it accessible to friends + guide on how you replicate it

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors