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
- When the server shows Running, SSH in and confirm NATS is listening with
ss -tlnp | grep 4222. - Add an
authorizationoraccountsblock with users, tokens or NKeys to the server config, then reload. - Turn on persistence with a
jetstreamblock that setsstore_dirand storage limits. - 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.