BytesOfProgress

Wiki


Simple Minecraft Server with Crafty

This method is tested on Debian 12.

We are going to set up a simple Minecraft server with a web interface for administration. After that we will make it accessable for other players WITHOUT forwarding ANY port. This also works if you do not have a static public IPv4 or a public IPv4 at all.

We will have an unlimited amount of player slots and the ability to install plugins. The only restrictions to this would be the used hardware. I run this on a machine with 8 GiB RAM, with 6 GiB dedicated to the Minecraft server itself.

Installation

Step 1: Set up a debian server with a static local IPv4.

Step 2: Install docker and docker-compose.


  # apt install docker-compose docker.io -y
    

Step 3: Create a docker-compose file in a new folder.


  # mkdir crafty && cd crafty
    


  # touch docker-compose.yml
    

Step 4: Paste this contents inside your docker-compose.yml.

Note: yml is indentation sensitive!

  version: '3'
  services:
    crafty:
      container_name: crafty_container
      image: registry.gitlab.com/crafty-controller/crafty-4:latest
      restart: always
      environment:
        - TZ=Etc/UTC
      ports:
          - "8000:8000" # HTTP
          - "8443:8443" # HTTPS
          - "8123:8123" # DYNMAP
          - "19132:19132/udp" # BEDROCK
          - "25500-25600:25500-25600" # MC SERV PORT RANGE
      volumes:
          - ./docker/backups:/crafty/backups
          - ./docker/logs:/crafty/logs
          - ./docker/servers:/crafty/servers
          - ./docker/config:/crafty/app/config
          - ./docker/import:/crafty/import

Step 5: First test run.


  # docker-compose up
    

Test if you can access the webinterface on https://x.x.x.x:8443

Step 6: First login.

I was not able to find the working default login password for "Admin", but there is another way:

Click on "Forgot Password". Now you will get temporary login details displayed in the docker-output in your command-line or terminal.

Use this to log in, go to settings, change the password for user "Admin".

Step 7: Restart in "daemon" mode. First, press CTRL+C, while being in your terminal. Then restart it with the "-d" flag:


  # docker-compose up -d
    

Step 8: Access webinterface, log in, create a minecraft server and start it. This works just like in the typical mc-server cloud providers.

Note: If you want to make this server public, or use plugins, create a purpur or paper server. I recommend purpur.


If you only want to use this server locally, when all other players are in your network, you are ready to play! You should be able to connect to it already!


Making it public (optional)

To prevent the need to open any ports and giving your public IPv4 to others, or if you do not have a public IPv4, we are going to use PlayIt.gg.

It is fairly simple: Sign up for an account, create a tunnel/agent, download it as a plugin and paste the plugin into your plugins folder.

After that you should restart or reload the server, and have a look at the output from the console, because it might give you some further instructions or links to make it work.




back