Connecting to MongoDB on Layerbase Cloud

MongoDB-compatible workflows use the same URI shape that mongosh, Mongoose, Prisma, and the official drivers expect.

Best for: Document database applications, local-to-cloud migrations, and workloads that use MongoDB client tooling.

1

Open your database in the dashboard

Go to /cloud, click the database you just created, and the connection panel shows the host, port, username, password, and a ready-to-paste connection string for the engine.

Copy the generated MongoDB URI from Quick Connect so the auth database and TLS flags stay correct.

2

TLS is required, on by default

Add tls=true to the connection string.

MongoDB wire protocol over TLS on port 27017

3

Use any standard client

MongoDB works with the normal client family for that engine. Start with the dashboard snippet, then move the same URL and credentials into your app environment.

If your client has separate direct, pooled, TLS, or HTTP options, prefer the exact variant shown in Quick Connect.

bashMongoDB
mongosh "mongodb://layerbase:password@your-host.cloud.layerbase.dev:27017/app?tls=true"

MongoDB notes

  • If MongoDB is unavailable in your account, use FerretDB for a PostgreSQL-backed MongoDB-compatible option.
  • Check the create page for the current launch status before planning production use.