MongoDB
This guide explains how to install and configure a MongoDB database server to use as a database host in the Calagopus Panel. Once set up, your users will be able to create MongoDB databases for their game servers directly from the panel.
INFO
The panel connects using a connection string and a privileged account to provision databases and users on demand. Each game server then receives its own isolated credentials.
WARNING
MongoDB starts without authentication enabled by default. This guide walks you through creating a superuser first and then enabling authentication - do not skip this step.
Installation
Create a directory for the service and enter it:
mkdir mongodb && cd mongodbCreate a compose.yaml with the following content. Authentication is intentionally disabled at first so you can create the initial superuser:
services:
mongodb:
image: mongo:11
restart: unless-stopped
volumes:
- ./data:/data/db
ports:
- "0.0.0.0:27017:27017"Start the service:
docker compose up -dOpen a mongosh shell inside the container:
docker compose exec mongodb mongoshCreating the Superuser
Before enabling authentication, you must create an admin account. Inside the mongosh shell:
DANGER
This account can connect from any IP address. Use a long, randomly generated password - a weak password on an exposed port is a critical security risk.
use admin
db.createUser({
user: "calagopus",
pwd: "<strong-password>",
roles: [
{ role: "userAdminAnyDatabase", db: "admin" },
{ role: "dbAdminAnyDatabase", db: "admin" },
{ role: "readWriteAnyDatabase", db: "admin" }
]
})Exit the shell:
exitEnabling Authentication
With the superuser created, restart MongoDB with authentication enforced.
Update your compose.yaml to pass the --auth flag:
services:
mongodb:
image: mongo:11
restart: unless-stopped
command: ["--auth"]
volumes:
- ./data:/data/db
ports:
- "0.0.0.0:27017:27017"Restart the service:
docker compose up -dVerify that authentication is working:
mongosh --username calagopus --password --authenticationDatabase adminConfiguring Remote Access
By default, MongoDB only listens on 127.0.0.1. To accept connections from the panel and Wings nodes, update the bind address.
INFO
If you used Docker Compose, the ports entry already handles exposure - skip this section.
Edit /etc/mongod.conf:
net:
bindIp: 0.0.0.0Restart MongoDB:
sudo systemctl restart mongodAdding the Host to the Panel
The panel uses a connection string to connect to MongoDB.
- Go to Admin → Database Hosts → Create.
- Select MongoDB as the database type.
- Enter the connection string:
mongodb://calagopus:<strong-password>@<host>:27017/?authSource=adminReplace <strong-password> with the password you set and <host> with the IP address or hostname of the database server.

- Click Save. You will be able to verify the connection afterwards.
Making the Database Host Show Up for Users
By default, new database hosts are not visible to any client API endpoints, to fix this, we need to add the database host to the Locations Database Host List.
- Go to Admin → Locations and click on the location you want to add the database host to.
- Click the Database Hosts tab at the top.
- Click Add and select the database host you just created from the dropdown, then submit.

INFO
For further reference on MongoDB configuration and user management, see the official MongoDB documentation.