Miget is now Lyngbak. Same platform, same plans, same API.Why the name →

Startups get $300 or more in Lyngbak credits.Apply →

Moving production infrastructure? We migrate it for you, free.Talk to us →

PricingEnterpriseDashboard
Start for Free
← All templates

MongoDB Replica Set

3-node MongoDB 8 replica set (rs0) on the stock image - self-initiating, internal-only, Atlas-shaped without the Atlas bill.

3.1 GiB

4 services, 30 GB disk

$26.50/mo

flat resource

$0.047/h

Usage Billing

What is MongoDB Replica Set?

A single MongoDB container is fine until it restarts mid-write. A replica set is the unit of production MongoDB: automatic failover, rollback safety, and the topology that change streams and transactions actually require. This template runs a 3-member replica set (rs0) on the stock mongo image - the --replSet flags ride each service’s command, no custom build.

A tiny rs-init sidecar waits for the members, runs rs.initiate() exactly once (idempotent - re-runs detect the initialized set and skip), then idles at a hard 128 MiB cap. Each member keeps its data on its own 10 GB volume.

Everything is internal-only by design: this template ships without auth, so the project network is the security boundary - exactly like a VPC-peered Atlas cluster, minus the bill. Apps connect with the standard multi-host connection string and get driver-level failover for free.

What you get

  • MongoDB 8, 3-member replica set rs0 - transactions and change streams work
  • Stock mongo image with command passthrough; no custom image to maintain
  • Idempotent self-initialization (rs-init sidecar, 128 MiB)
  • Automatic primary election and driver failover on node loss
  • Per-member 10 GB persistent volumes
  • Internal-only: never exposed to the internet

How it runs on Lyngbak

ServiceRolePublic
mongo-1..3replica-set members (:27017)no
rs-initone-time rs.initiate(), then idlesno

Sizing and billing

1 GiB per member suits small-to-medium working sets; WiredTiger sizes its cache to the container limit. Grow volumes with your data - 10 GB each is the starting point.

Hobby resource$26.50/mo2 vCPU, 2 GiB + 1.5 GiB RAM add-on, 60 GiB disk, shared CPU
Pro resource$38/mo1 vCPU, 2 GiB + 2 GiB RAM add-on, 30 GiB disk incl. add-on, dedicated CPU
Usage Billing, shared CPU$0.047/h2 vCPU, 3.5 GiB reserved. $33.50/mo for a full month, billed by the second.
Usage Billing, dedicated CPU$0.19/h4 vCPU, 8 GiB reserved. $136/mo for a full month, billed by the second.

A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 29.3 GiB of volumes cost $0.15 per GiB a month ($4.40/mo) for as long as they exist. One workspace can use both. See pricing

Compared with the managed service

ServicePlanPriceIncludes
MongoDB AtlasM10 dedicated$57/mo3-node replica set, 2 GB RAM per node, 10-128 GB storage
MongoDB AtlasFlexUsage-basedusage-tiered, capped $8-30/mo - shared infrastructure, the pre-dedicated entry point

Prices from each vendor's pricing page, June 2026.

Run it locally first

The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.

Questions

How much cheaper is this than MongoDB Atlas?

Atlas prices dedicated clusters by tier; M10, its smallest, is one 2 GB node-equivalent cluster. This 3-member replica set fits a 4 GiB plan, with capacity left for the apps that use it.

Why a replica set instead of a single mongod?

Failover, durability, and features: multi-document transactions and change streams require a replica set. With three members, the set survives any single node failure with automatic primary election - your driver reconnects on its own.

How do applications connect?

From the same Lyngbak project: mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/?replicaSet=rs0. Listing all members lets the driver discover the topology and fail over automatically.

Is it safe to run MongoDB without authentication?

Only because nothing outside the project network can reach it: all members are private with no ingress route, the same trust model as a database inside a VPC. Never expose these services publicly; if you need cross-project access, add keyfile auth first.

Can I use this for transactions and change streams?

Yes - both require a replica set, which is exactly what this is. Point your ODM (Mongoose, Prisma, Spring Data) at the rs0 connection string and they work out of the box.

More in Databases

ClickHouse Cluster

3-node ClickHouse cluster - one shard, three replicas, embedded Keeper. Real replicated OLAP without ZooKeeper pods.

Open the template →

MariaDB

The community MySQL fork, as a single self-hosted node - drop-in compatible.

Open the template →

MariaDB Galera

3-node synchronous multi-primary MySQL-family HA on the official image - every node writes, any node can die.

Open the template →
MongoDB: 3-node replica set with Docker Compose | Lyngbak (formerly Miget)