BIENVENUE10valid for the first month only! on all offersView plans
Skip to content
← Knowledge base

Use your managed MongoDB database

MongoDB connection string, connect via Compass or a driver, create a user and backups.

Use your managed MongoDB database

Credentials and the full connection string are in the panel’s Database tab.

1. Connection string

Standard format:

mongodb://<user>:<password>@<host>:27017/<database>?authSource=admin

To enable TLS:

mongodb+srv://...?tls=true

Use the pre-generated string from the panel (it already includes the correct authSource and TLS).

2. Connect

MongoDB Compass (GUI)

Paste the connection string into New Connection → Paste connection string.

Official driver (Node.js)

import { MongoClient } from "mongodb"
const client = new MongoClient(process.env.MONGO_URL)
await client.connect()
const db = client.db("my_db")

mongosh (CLI)

mongosh "mongodb://<user>:<password>@<host>:27017/<database>?authSource=admin"

3. Allow your IP

Add your IP under Database → Allowed IPs. Otherwise the connection is refused.

4. Create an application user

db.createUser({
  user: "app",
  pwd: "password",
  roles: [{ role: "readWrite", db: "my_db" }]
})

5. Backups

Automatic daily backups are managed by onesubnet. Manual export:

mongodump --uri="<connection_string>" --out=./dump

References

Related products

oneSubnet

French hosting provider in Paris. High-performance game and voice servers.

SERVICES

Resources

LEGAL

All systems operational