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

NATS Cluster

3-node cloud-native messaging - pub/sub, request/reply, and JetStream streams - at ~30 MB per node.

0.8 GiB

3 services, 15 GB disk

$5.75/mo

flat resource

$0.027/h

Usage Billing

What is NATS Cluster?

NATS is messaging stripped to its fast, essential core: subject-based pub/sub, request/reply, and - via JetStream - persistent streams, work queues, and key-value/object stores. It is astonishingly light (tens of megabytes per node) and astonishingly quick, which is why it underpins so much cloud-native infrastructure.

This template runs a 3-node cluster on the stock image, configured entirely with command flags (the same no-custom-build approach as the mongodb replica set). All three nodes share one all-peers routes list - NATS ignores its own self-route - so the mesh forms by gossip with no seed asymmetry, and JetStream replicates across all three.

Internal-only by design: it speaks raw TCP on 4222, and apps in the project connect there directly.

What you get

  • Pub/sub, request/reply, and queue groups
  • JetStream: persistent streams, work queues, KV and object stores
  • 3-node cluster via flags - stock image, no custom build
  • Replication factor 3 across per-node volumes
  • Monitoring endpoint + health checks on :8222
  • Apache-2.0; ~30 MB per node

How it runs on Lyngbak

ServiceRolePublic
nats-0..2cluster nodes (client :4222, cluster :6222, monitor :8222)no

Sizing and billing

Nodes idle in tens of megabytes; 256 MiB each is generous. JetStream volume size is the dial - raise it as streams retain more.

Hobby resource$5.75/mo1 vCPU, 1 GiB, 15 GiB disk incl. add-on, shared CPU
Pro resource$25.75/mo1 vCPU, 2 GiB, 15 GiB disk incl. add-on, dedicated CPU
Usage Billing, shared CPU$0.027/h1.5 vCPU, 1.5 GiB reserved. $19.50/mo for a full month, billed by the second.
Usage Billing, dedicated CPU$0.14/h3 vCPU, 6 GiB reserved. $102/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 14.65 GiB of volumes cost $0.15 per GiB a month ($2.20/mo) for as long as they exist. One workspace can use both. See pricing

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

NATS, Kafka, or RabbitMQ?

NATS for low-latency cloud-native messaging and lightweight persistent streams with the smallest footprint; Kafka/Redpanda for high-throughput, long-retention event logs; RabbitMQ for classic AMQP work queues with mature routing. All are in this catalogue - NATS is the one you reach for when simplicity and latency matter most.

Is JetStream production-ready in this setup?

Yes - three nodes give JetStream a quorum for replication-factor-3 streams, surviving any single node loss. Each node persists to its own volume; declare streams with R3 and writes are durable across the cluster.

How do apps connect?

From the same project: nats://nats-0:4222 (any node accepts connections; list all three for failover). The client port is raw TCP and never exposed publicly. Add --user/--pass flags if you need auth.

More in Streaming & Messaging

Apache Kafka

3-broker Apache Kafka cluster in KRaft mode (no ZooKeeper) with Kafbat UI - durable defaults, official images, env-only config.

Open the template →

RabbitMQ

3-node RabbitMQ 4.x cluster, quorum-queue ready, with the management UI - clusters itself on first boot.

Open the template →

Redpanda

3-broker Redpanda cluster - Kafka-compatible streaming without the JVM or ZooKeeper, plus Redpanda Console.

Open the template →
NATS Cluster: a NATS cluster with Docker Compose | Lyngbak (formerly Miget)