Notes on Running a Minecraft Server in an Incus Container
2025/10/13
These are rough notes for myself, but you might find them useful.
- Create an incus instance with a debian trixie image.
- Create a bridge network on setup. Disable default firewall rules from incus. Add routing rules so that you can access the internet appropriately. When exposing to the public internet, harden rules beforehand (i.e. don't allow the container access to any local devices, only the gateway; only allow https dns dhcp etc ports).
- Since you are running an older minecraft server, you need the Java 8 runtime. Debian doesn't package it anymore in stable, so get it off from this repo.
- Follow through standard setup as you would with an ordinary minecraft server.
- Set a static ip address using something like
incus network set incusbr0 ipv4.address=192.168.1.0, but replace the ip addr with a valid one in the network's subnet (check usingincus network show). - You will need to setup a
proxy
device so that your external network can access your
server through your computer. Minecraft uses
TCP so use something along the following setup:
For reference,
# incus config device add $INSTANCENAME $DEVICENAME_OF_CHOICE proxy listen=tcp:$EXTERNAL_IP_ADDR:$PORT connect=tcp:$INTERNAL_IP_ADDR:$PORT bind=host nat=true
connectshould link to your container's ip address & port, whilelistenshould link to your computer's ip address & port on your LAN or whatnot.