{"id":23104802,"url":"https://github.com/mayniklas/docker-minecraft","last_synced_at":"2026-04-24T12:04:32.214Z","repository":{"id":109060817,"uuid":"310025436","full_name":"MayNiklas/docker-minecraft","owner":"MayNiklas","description":"A simple minecraft docker container","archived":false,"fork":false,"pushed_at":"2021-04-02T11:30:33.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-22T11:07:05.445Z","etag":null,"topics":["docker","minecraft","minecraft-server"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MayNiklas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-04T14:24:01.000Z","updated_at":"2021-04-02T11:30:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"62c1fe90-7df3-45a0-b681-fbc8505c55d9","html_url":"https://github.com/MayNiklas/docker-minecraft","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MayNiklas/docker-minecraft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayNiklas%2Fdocker-minecraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayNiklas%2Fdocker-minecraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayNiklas%2Fdocker-minecraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayNiklas%2Fdocker-minecraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MayNiklas","download_url":"https://codeload.github.com/MayNiklas/docker-minecraft/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayNiklas%2Fdocker-minecraft/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261282322,"owners_count":23134939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","minecraft","minecraft-server"],"created_at":"2024-12-17T00:36:26.206Z","updated_at":"2026-04-24T12:04:32.133Z","avatar_url":"https://github.com/MayNiklas.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-minecraft\n\n---\n\n## Quick Start\n\n**NOTE**: The Docker command provided in this quick start is given as an example\nand parameters should be adjusted to your need.\n\nLaunch the minecraft docker container with the following command:\n```\ndocker run --rm -d \\\n    -p \"25565:25565/tcp\" \\\n    -v $(pwd)/data:/app \\\n    --name minecraft-server \\\n    mayniki/minecraft\n```\n\nWhere:\n  - `$(pwd)/data:/app`: This is where the application get's installed. In this case, your current directory is used.\n\n## Environment Variables\n\n| Variable       | Description                                  | Default |\n|----------------|----------------------------------------------|---------|\n|`serverurl`| Insert a download link to the server.jar file | 'NULL' |\n|`MC_RAM`| How much RAM is the java application allowed to use? | `2G` |\n|`UID`| ID of the user the application runs as.  See [User/Group IDs](#usergroup-ids) to better understand when this should be set. | `1000` |\n|`GID`| ID of the group the application runs as.  See [User/Group IDs](#usergroup-ids) to better understand when this should be set. | `1000` |\n\n## docker-compose.yml\n\nHere is an example of a `docker-compose.yml` file that can be used with\n[Docker Compose](https://docs.docker.com/compose/overview/).\n\nMake sure to adjust according to your needs.\n\nThe file can be found within the repository and is getting cloned within it.\nTherefore: docker-compose up should work out of the box.\n\n\n```\nversion: '3.0'\nservices:\n  minecraft-server:\n    container_name: minecraft-server\n    image: mayniki/minecraft\n    volumes:\n      - \"./data:/app\"\n    ports:\n      - \"25565:25565\"\n    environment:\n      - MC_RAM=2G\n      - serverurl=\n      - UID=1000 \n      - GID=1000\n    stdin_open: true\n    tty: true\n    restart: unless-stopped\n```\n\n### minecraft shell\nSometimes you need to get access to the servers shell.\n```bash\n# stop the server\ndocker-compose down\n\n# start the container with a modified entrypoint\ndocker run -p 25565:25565 -v $(pwd)/app/:/app -it --entrypoint=\"bash\" mayniki/minecraft\n\n# start minecraft under user java\ngroupadd java -g 1000\nuseradd -u 1000 -g 1000 java\nchown -R  java:java /app\nsu java -c 'java -Xmx4G -jar server.jar'\n\n# after being done in the shell\n/stop\nexit\n\n# now restart the server normally\ndocker-compose up -d\n```\n\n## Backup\nI personally use the following skript to backup my server before I migrate it to another system.\n```bash\n#!/bin/bash\n\ncd ~/docker/minecraft/\n\n# Pulling the new image for security reasons only\ndocker-compose pull\n\n# Creating a variable containing the date\nnow=`date +\"%Y-%m-%d-%H-%M\"`\necho \"${now}\"\n\n# Creating a backup folder\nmkdir backup\n\n# Stopping the minecraft server\ndocker-compose down\n\n# Creating a zip file\nzip -r backup/${now}-minecraft.zip app docker-compose.yml\n\n# Restart the minecraft server\ndocker-compose up -d\n```\n\n## Restoring backup\nThe container is written in a way, permissions are being handled while starting.\n```bash\n#!/bin/bash\n\ncd ~/docker/minecraft/\n\n# stopping the minecraft server\ndocker-compose down\n\n# it might be a good idea to create a backup first!\nnow=`date +\"%Y-%m-%d-%H-%M\"`\nzip -r backup/${now}-minecraft.zip app docker-compose.yml\n\n# I suggest completly deleting the old app folder\nrm -rf app/\n\n# unzip your backup\nunzip backup/2021-02-24-00-22-minecraft.zip\n\n# Restart the minecraft server\ndocker-compose up -d\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayniklas%2Fdocker-minecraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayniklas%2Fdocker-minecraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayniklas%2Fdocker-minecraft/lists"}