Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto

NATS Server on a VPS

NATS Server is a fast, single-binary message broker for pub/sub, request-reply and queue groups, with JetStream adding persistence, streams and key-value storage.

1 GBMinimum memory
Ubuntu 24.04 LTSBase image
4222/tcp, 6222/tcp, 8222/tcpPorts
Apache-2.0License

About NATS Server

NATS is a CNCF messaging system built in Go under the Apache-2.0 license. Clients publish to subjects, subscribe with wildcards and share work through queue groups; JetStream, in the same binary, adds durable streams and key-value storage.

One small process carries a lot of traffic, so a modest CloudSat plan can act as the message hub for many services. Servers in several regions join into a cluster or link as leaf nodes.

Clients connect on port 4222. Upstream defaults accept anonymous connections, so add authorization before real traffic arrives, and enable JetStream when you need persistence.

What you get with NATS Server

  • Subjects with wildcards, request-reply and queue groups
  • JetStream streams, consumers and replay
  • Key-value and object stores
  • Clusters, superclusters and leaf nodes
  • Tokens, users, NKeys or JWT accounts
  • WebSocket and MQTT listeners

NATS Server use cases

  • Connect microservices without a heavy broker
  • Collect IoT telemetry over MQTT
  • Spread events and work queues across regions

After you deploy NATS Server

  1. When the server shows Running, SSH in and confirm NATS is listening with ss -tlnp | grep 4222.
  2. Add an authorization or accounts block with users, tokens or NKeys to the server config, then reload.
  3. Turn on persistence with a jetstream block that sets store_dir and storage limits.
  4. Allow 4222 only from your services in the CloudSat firewall, keep monitoring on 8222 private, and add TLS for clients across the internet.

NATS Server ports

Open these in your firewall if you use one: 4222/tcp client connections, 6222/tcp cluster routes (when clustered), 8222/tcp HTTP monitoring (when enabled).

NATS Server FAQ

Do I still need Kafka if I run NATS?

Often not. JetStream covers durable streams, replay and work queues for most service workloads; Kafka still fits very large, retention-heavy pipelines.

How do I test the server?

Install the nats CLI on any machine, run nats sub demo in one terminal and nats pub demo hello in another, adding --server nats://<server IP>:4222 and your credentials.

Disclaimer. The NATS Server project has no affiliation with CloudSat and does not endorse it. Names and logos belong to their owners and appear only to identify the software.

NATS Server on your own server.
Ready in under 5 minutes.

Pick a region and a size; the console shows the address as soon as it is up.

Every server delivered in under 5 minutesPay with crypto14-day money-back