Giter VIP home page Giter VIP logo

minecraft-docker's Introduction

Minecraft Docker

A dockerized application designed to run a Minecraft server automatically on startup.

The advantages of Dockerizing a Minecraft server:

  • Run the server on any operating system that supports Docker
  • Easily run multiple servers with altering Java versions
  • Automatically launch your servers on system startup
  • More consistent software conditions, making troubleshooting easier

Requirements

Setup

1. Clone the repository

git clone https://github.com/ignwombat/minecraft-docker

2. Download the desired Java version

Minecraft servers require Java to be installed on the system to run. You need to download a version of java into the docker folder

  • To run Minecraft on version 1.19.x, Java 17 is required
  • Other versions, such as modded 1.12.2 use Java 8 instead

To avoid any issues, make sure to download the tar.gz Linux x64 archive

Do not extract the archive!

3. Rename the Java archive

By default, the Docker Compose File searches for java.tar.gz. Rename the archive to this.

4. Download a server jarfile

Save the jarfile as server.jar into the docker folder

5. Add extra content

All files inside the data folder get copied to the root directory of the server. Any additional configuration of the server, such as plugins, mods or scripts should be added here.

If you want to use a custom world, add the save in the root directory, and make sure the name corresponds with level-name in server.properties. The default name is "world".

This is also where you can edit the server.properties file.

Note: if you place a "world" or "config" folder in the data directory, these will be ignored, as they are accessed in root.

6. Start the server with docker compose

Make sure the terminals current working directory (CWD) is in the root folder.

If it's the first time launching the server, or any changes have been made to the files, run the following command:

docker compose up -d

Otherwise, run the following command:

docker compose start -d

To send a command to the server:

docker compose exec -d minecraft say hello

To gracefully shut down the server:

docker compose exec -d minecraft stop
docker compose stop

Changing the server port

Because minecraft.env doesn't load before docker compose, you must either change the Docker Compose File directly, or add a file named .env with the following contents:

MINECRAFT_SERVER_PORT=25566

Plugin configs

If you're using plugins that require configuration files, the config folder will be available in the root folder after the first launch, similar to the world folder.

minecraft-docker's People

Contributors

ignwombat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.