Minecraft Server in Docker Compose: Launch and Update

Guides

Example Docker Compose For Minecraft Java with постоянной папкой peace: Launch, журналы, Backup and update Without случайной смены Game versions.

  • 5 minutes reading
  • 3 views
  • 7 sections
My game select version

We'll remember in this browser and set up where your version is available. Open link settings are more important than this choice; the Vicki versions do not change.

On page 7 sections

What does the container store and what does the server folder store?

It is convenient to recreate the container when updating, and the world and settings should survive this action. In character itzg/minecraft-server game data is in /data. In the example below, this directory is associated with the folder data next to compose.yaml.

The example is designed for already installed Docker with Compose and a separate Minecraft Java 1.21.1 server. The version is clearly selected: if you set up another issue, replace it with a suitable generation of Java. The image tag latest and meaning LATEST for the game can change the environment without a separate decision of the owner.

Minimal compose.yaml

Create an empty working folder and put the file in it:

services:
  minecraft:
    image: itzg/minecraft-server:java21
    restart: unless-stopped
    ports:
      - "25565:25565"
    environment:
      EULA: "TRUE"
      TYPE: "VANILLA"
      VERSION: "1.21.1"
      MEMORY: "2G"
      ONLINE_MODE: "TRUE"
    volumes:
      - ./data:/data
    stop_grace_period: 1m

EULA: "TRUE" ask after reading and accepting the Minecraft terms. Meaning 2G This is an example of Java's memory size, not a promise of server capacity. Leave the resources for the system and the container itself; heavy assembly requires its own calculation.

Launch and first check

In the terminal of this folder, run:

docker compose up -d
docker compose logs -f minecraft

Wait for the startup completion message. Check the connection from a client of the same version to localhost:25565if the game works on this computer. Use the host address for another device. The public entrance is further dependent on the network and port access rules.

command docker compose ps Shows the state of the container. The working container does not yet prove the readiness of the game server: primary downloading of files and generating the world takes time. Look at the magazine to the end, especially reports about Java's version and free memory.

Backup and update

For a small company, the most understandable coordinated backup is to stop the server, copy all data, then run it:

docker compose stop minecraft

Once the shutdown is complete, save the folder data and compose.yaml outside the working directory. Only then do docker compose start minecraft. The copy should include measurements, settings and player files, not just a region directory.

First check the update on a copy of the server. Change VERSION, if necessary a Java tag, do docker compose pull and docker compose up -dI don't know. Open the world and check the entrance, the equipment, and the mechanics you need. Lowering the version of a modified world is not a reliable rebound: use a saved copy together with the old configuration to return.

Where to look for the cause of the error

Symptom Checkmark
WORLD Everyone Times New Right whether подключена ./data:/data and From какой Folders запущен Compose
Error versions class Java Соответствует whether The image tag требованиям Minecraft or bootloader
Server доступен локально, but not друзьям address, Publication порта, firewall and Network провайдера
Set Loot возвращается after запуска not задаётся whether She's Via переменную окружения образа

Useful for a home network without a direct incoming connection playit.gg guide. Several servers at one address are a separate task for Velocity.

Frequently asked questions

Will deleting a container delete the world?

With a correct bind mount, the data remains in the host folder. Before any deletion, check the actual path and whether there is a backup copy.

Is it possible to change VANILLA to a modpack in one line?

The type of launch is only part of the configuration. You need compatible server files, downloader, Java and customer assembly. Check a separate image instruction for the selected type.

Is an RCON port needed for normal connection?

No. The example publishes the game TCP port. Administrative interfaces should not be opened to the outside just for players to enter.

Sources

Read on

Network proxies and servers
5 min 3

Velocity: Set Loot сети Servers Minecraft

how соединить Lobby and EXPLORATION Via Velocity: адреса Servers, modern forwarding, General секрет and check входа Without обхода Proxy.