Running Modmail on Docker / Docker Compose
Installing Docker Engine
Docker has their own installation page for popular Linux-based distros, read them by visiting the link below:
![drawing](https://www.docker.com/wp-content/uploads/2023/04/cropped-Docker-favicon-32x32.png)
If you're on a desktop environment, refer to the "Desktop" section of their documentation as Docker Desktop also comes with nice GUI that you manage your deployments with.
For VPS and servers, refer to the "Server" section as you will be needed to learn the CLI commands to run Modmail with Docker.
After the installation process has finished, you can try running the commands below in your terminal to see if Docker and Docker Compose has been installed successfully:
docker --version
docker compose version
Running with Docker
Pull the image from the registry and run the bot as Docker container with the following command:
docker run -d --name modmail \
--env-file .env \
--pull=always \
--restart always ghcr.io/raidensakura/modmail:stable
Make sure to have your .env
file in the current directory and all the necessary environment variables inside.
Refer to the Getting Started page for instructions on how to setup your environment.
After deploying, you can view the logs of your currently running Modmail container with the following command:
docker logs modmail
Running with Docker Compose
Make sure to have your .env
file in the current directory and all the necessary environment variables inside.
The default Docker compose setup runs Modmail alongside a MongoDB instance, so you don't have to specify CONNECTION_URI
.
docker compose up -d
Updating on Docker
The internal auto-update is disabled when running on Docker as container state is not persistent across restart.
Update, stop, remove and update your bot container with:
docker stop modmail && \
docker rm modmail && \
docker run -d --name modmail \
--env-file .env \
--pull always \
--restart always ghcr.io/raidensakura/modmail:stable
To automate this process on Docker, you can look into running Watchtower (opens in a new tab) which will auto-update your containers whenever a new image is pushed on the remote repository. Please refer to their documentation for guide and configuration.