MongoDB Setup
Cyrus Panel requires a MongoDB connection URI to store user accounts, server definitions, node allocations, vouchers, and billing records.
Option 1: MongoDB Atlas Cloud (Recommended)
MongoDB Atlas is the easiest and most reliable method. It provides a permanently free managed cloud cluster (M0 Free Tier) that includes automated backups and requires zero server maintenance.
Step 1: Create an Account & Deploy a Free Cluster
- Go to MongoDB Atlas and sign up or log in.
- In your dashboard, click "Build a Database" (or "Create").
- Under the plan options, select the M0 Free (Shared) tier.
- Choose a Cloud Provider (AWS, Google Cloud, or Azure) and select the Region geographically closest to your panel server.
- Leave the cluster name as
Cluster0(or name it as you prefer) and click "Create Deployment" (or "Create Cluster").
Step 2: Create a Database User
- In the left navigation sidebar under Security, click Database & Network Access.
- Click the "Add New Database User" button.
- Select Password as the authentication method.
- Enter a Username (e.g.
cyrus). - Enter a strong password or click "Autogenerate Secure Password".
- Under Database User Privileges, ensure it is set to "Read and write to any database" (or Atlas Admin on M0).
- Click "Add User" and save your password in a safe place.
Step 3: Configure Network Access (IP Whitelist)
Atlas blocks all inbound traffic by default until you configure network permissions:
- In the left navigation sidebar under Security, click Database & Network Access.
- Select IP Access List under Network Access in the navigation sidebar.
- Click the green "Add IP Address" button.
- Type one of the following in the Access List Entry Input box:
- Allow Access from Anywhere (
0.0.0.0/0): Recommended if your server has a dynamic IP or you connect from multiple locations. - Your Panel Server's IP: Enter your host server's static public IPv4 address for maximum security.
- Allow Access from Anywhere (
- Click "Confirm". It will take a few seconds to apply.
Step 4: Get Your Connection String
- In the left sidebar under Database, click Clusters.
- On your cluster card, click the "Connect" button.
- In the modal, select "Drivers" under Connect your application.
- Ensure the driver is set to Node.js.
- Copy the provided connection string (starts with
mongodb+srv://):
mongodb+srv://<username>:<password>@cluster0.xxxxxxx.mongodb.net/?retryWrites=true&w=majority
MongoDB Atlas may automatically pre-fill the username in the connection string with an auto-created user or the first database user it detects (for example, testuser_db_user). Ensure you replace it with the actual user you created in Step 2 (e.g. cyrus).
Step 5: Format the URI for Cyrus Panel
- Replace
<username>(or any prefilled username liketestuser_db_user) with your database username (e.g.cyrus). - Replace
<password>with your user's actual password. - Add
/cyrusright before the?query parameters to set the database name:
mongodb+srv://cyrus:YOUR_SECURE_PASSWORD@cluster0.xxxxxxx.mongodb.net/cyrus?retryWrites=true&w=majority
If your password contains special characters (such as @, :, /, ?, #, [, ]), they must be URL-encoded. For example, @ becomes %40 and # becomes %23. Alternatively, use an alphanumeric password.
Paste this final string into the Cyrus Panel CLI Setup Wizard or into your .env under MONGO_URI.
Option 2: Docker Container (Local Self-Hosted)
If you prefer keeping the database on your own host without cloud services, running MongoDB inside a Docker container is the fastest self-hosted method.
Run the following command to start an isolated MongoDB container bound only to 127.0.0.1:
docker run -d \
--name cyrus-mongodb \
--restart unless-stopped \
-p 127.0.0.1:46666:27017 \
-e MONGO_INITDB_ROOT_USERNAME=cyrus \
-e MONGO_INITDB_ROOT_PASSWORD='your_secure_password' \
-v cyrus-mongodb-data:/data/db \
mongodb/mongodb-community-server:latest
Replace 'your_secure_password' with your own strong database password before executing the command.
Resulting Connection URI
Based on the command above, your local MongoDB connection URI will be:
mongodb://cyrus:your_secure_password@127.0.0.1:46666/cyrus?authSource=admin
When starting Cyrus Panel (npm run start), the interactive setup wizard will automatically test your MongoDB URI to verify that authentication and network access succeed before saving.