Skip to content

Commit ef3fd89

Browse files
authored
Add docker compose server setup guide (#343)
1 parent 18edfb2 commit ef3fd89

1 file changed

Lines changed: 76 additions & 4 deletions

File tree

content/for-server-hosts/setup/containers.md

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ aliases:
99
## Obtaining a server binary
1010

1111
- The official image can be found [here](https://github.com/luanti-org/luanti/pkgs/container/luanti)
12-
- ghcr.io/luanti-org/luanti:latest - latest stable release
13-
- ghcr.io/luanti-org/luanti:\<tag> - a specific version (git tag)
14-
- ghcr.io/luanti-org/luanti:master - latest dev version
12+
- ghcr.io/luanti-org/luanti:latest - latest stable release
13+
- ghcr.io/luanti-org/luanti:\<tag> - a specific version (git tag)
14+
- ghcr.io/luanti-org/luanti:master - latest dev version
1515

1616
- [Warr1024's Docker image](https://hub.docker.com/r/warr1024/minetestserver).
1717

@@ -21,10 +21,82 @@ aliases:
2121

2222
It is recommended that you use [docker compose](https://docs.docker.com/compose) to set up, configure, and run your server
2323

24+
A simple `compose.yml` example:
25+
26+
```yml
27+
services:
28+
luanti_server:
29+
image: ghcr.io/luanti-org/luanti:latest
30+
restart: unless-stopped
31+
volumes:
32+
- ./config:/etc/minetest:ro
33+
- ./data:/var/lib/minetest
34+
- ./games:/var/lib/minetest/.minetest/games:ro
35+
- ./mods:/var/lib/minetest/.minetest/mods:ro
36+
ports:
37+
- "30000:30000/udp"
38+
```
39+
40+
Before starting the container:
41+
42+
- create the necessary directories:
43+
44+
```bash
45+
mkdir -p data/.minetest config games mods
46+
```
47+
48+
- change ownership of `data` to `minetest` user (UID 30000)
49+
50+
```bash
51+
sudo chown -R 30000:30000 data/
52+
```
53+
54+
- copy content of the [minetest.conf.example](https://github.com/luanti-org/luanti/blob/master/minetest.conf.example) file to `config/minetest.conf`
55+
56+
- install the game you want to play in `./games/`. Follow [this guide](https://content.luanti.org/help/installing/#installing-using-the-command-line). For example, to install `voxelibre` using `git`
57+
58+
```bash
59+
git clone https://git.minetest.land/VoxeLibre/VoxeLibre ./games/voxelibre/
60+
```
61+
62+
- start the container
63+
```bash
64+
docker compose up -d
65+
```
66+
67+
`./data/.minetest/` has the directory `worlds/`, where the world will be saved.
68+
69+
`./config/minetest.conf` has settings of the server.
70+
71+
If you have multiple games or worlds, you can specify which one to run in `compose.yml`. For example:
72+
73+
```yml
74+
services:
75+
luanti_server:
76+
image: ghcr.io/luanti-org/luanti:latest
77+
restart: unless-stopped
78+
volumes:
79+
- ./config:/etc/minetest:ro
80+
- ./data:/var/lib/minetest
81+
- ./games:/var/lib/minetest/.minetest/games:ro
82+
- ./mods:/var/lib/minetest/.minetest/mods:ro
83+
ports:
84+
- "30000:30000/udp"
85+
command: --config /etc/minetest/minetest.conf --gameid voxelibre --worldname world
86+
```
87+
88+
`--config /etc/minetest/minetest.conf` tells the server where to find the config file inside the container. Keep this flag as-is when using the volume mount from this guide.
89+
90+
To see available flags run:
91+
92+
```bash
93+
docker exec -it luanti_server luantiserver --help
94+
```
95+
2496
### Podman
2597

2698
It is recommend that you use [podman quadlets](https://www.redhat.com/en/blog/quadlet-podman) to set up, configure, and run your server
2799

28100
## Next Steps
29101

30-
Continue on to [next steps](/for-server-hosts/setup/#port-forwarding).
102+
Continue on to [next steps](/for-server-hosts/setup/#port-forwarding).

0 commit comments

Comments
 (0)