No TLS, No Credentials
The simplest LAN/dev setup: plain ws://, no username or password required.
1. Setup (nats-server.conf)
listen: 0.0.0.0:4222
http_port: 8222 # optional, HTTP monitoring (VARZ/CONNZ/... at :8222)
# WebSocket transport — required for the browser to connect at all.
websocket {
port: 8080
# LAN/dev-friendly default: no TLS, plain ws://.
no_tls: true
}
# JetStream — required for KV buckets and Streams.
jetstream {}
One-time nats-cli setup
nats context add tutorial-no-auth \
--server="nats://10.135.32.227:4222" \
--selectIn Connection section, enter:
- NATS server host
- 10.135.32.227
- WS port
- 8080
- TLS (wss)
- off
- Username
- (leave blank)
- Password
- (leave blank)
2. Creation of subject / KV bucket / stream
In the Subscriptions form: Type: Subject · Target: orders.>
No setup required — just add the subscription above.
In the Subscriptions form: Type: KV Bucket · Target: my-bucket
nats kv add my-bucketCreating the bucket requires JetStream, which is enabled by the empty `jetstream {}` block above.
In the Subscriptions form: Type: JetStream Stream · Target: ORDERS · Filter: orders.created (optional)
nats stream add ORDERS --subjects "orders.>" --storage file \
--retention limits --max-msgs=-1 --max-bytes=-1 --max-age=0 --defaultsThe viewer subscribes with its own ephemeral ordered consumer — no consumer setup needed on your end.
This configuration has no `accounts`/`system_account`, so $SYS.> system events are never published (the default global account does not publish advisories). See Tutorial 2 (No TLS, With Credentials) to enable system monitoring.
3. Message generation
nats pub orders.created '{"id": 1, "total": 42.5}'Each publish appears as a new card in the viewer’s Message feed.
nats kv put my-bucket hello worldnats pub orders.created '{"id": 1}'
nats pub orders.created '{"id": 2}'