How to host Minecraft server in docker container?
Table of contents
In this article I will show you how to host a Minecraft server in docker.
What is the purpose of a Minecraft server?
Minecraft multiplayer mode can be quite overwhelming if there are so many unwanted players. By hosting your own Minecraft server you can play with your friends and enjoy the multiplayer mode of the game.
Requirement -
OS - Ubuntu/CentOS
Docker
Internet connection
Clone my repository from GitHub.
git clone https://github.com/asabhi6776/minecraft_server.git
cd minecraft_server
Add the latest Minecraft server version and PaperMC build number to the env file.
vim .env
BUILD = "141"
VERSION = "1.19.2"
You can find build no. here
In the end, start the container after you have completed these steps.
docker-compose up -d
It will automatically sync your volume with the container game directory after the container is started. Within your volume, edit the server.properties according to your requirements and restart the container.
In your game, you can now use the server's IP address and port and share it with your friends.
You can reach out to me on twitter, you can join my discord by clicking this link.
Thanks.
Subscribe to my newsletter
Read articles from Abhishek Singh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Abhishek Singh
Abhishek Singh
Hi This is Abhishek Singh, Devops Engineer by profession and Gamer by passion. I'm a devops engineer with more than 3 years of experience in Linux, Monitoring and Devops. I'm huge Open source supporter and Linux lover. In free time I love to play Minecraft and Valorant.