I am trying to host a Minecraft server in a docker container on a dedicated server (Ubuntu 20.04).
I am using the itzg/minecraft-server image with docker-compose to create my container.
I have no errors when creating the container nor when launching the minecraft server in the container logs. BUT when I connect to the server with the public ip of my vps and port 25565, I have
Can't connect to server: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection timed out: no further information:
I also tried to start the server as idzg suggests, following this instructions :
To simply use the latest stable version, run
docker run -d -p 25565:25565 --name mc itzg/minecraft-server
where the standard server port, 25565, will be exposed on your host machine.
but the problem is the same
The container is OK
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
21c67ba9a3c2 itzg/minecraft-server "/start" 16 minutes ago Up 16 minutes (healthy) 0.0.0.0:25565->25565/tcp, :::25565->25565/tcp, 25575/tcp mc
Server logs is OK
[10:42:11] [Server thread/INFO]: Preparing spawn area: 99%
[10:42:11] [Server thread/INFO]: Time elapsed: 14039 ms
[10:42:11] [Server thread/INFO]: Done (14.161s)! For help, type "help"
[10:42:11] [Server thread/INFO]: Starting remote control listener
[10:42:11] [Server thread/INFO]: Thread RCON Listener started
[10:42:11] [Server thread/INFO]: RCON running on 0.0.0.0:25575
docker-compose.yml
version: "3.7"
services:
mc:
container_name: mc
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
volumes:
# attach a directory relative to the directory containing this compose file
- /home/neuromob/minecraft-server/data_tmp:/data
Additionally, I have a second container with a nginx and node web server to build a vue.js project. This container is still down when I tried to start my Minecraft server, but I prefer to specify it if ever it can conflict for the connection ... ? But I don't think so.
For people who have the same problem, I solved it by simply opening port 25565 on the VPS host site