NATS

Configuration

NKey generation

nats-nkey:
	nk -gen user -pubout

Server

This file should be available on the system running NATS. NATS should be started using the --config or -c flag pointing to the path of this file (eg. nats-server -c /path/to/this.conf

accounts: {
  $SYS: {
    users: [
      # generate using `nk-gen user -pubout`
      {nkey: "..."},
    ]
  }
}

authorization: {
  users: [
    # generate using `nk-gen user -pubout`
    {nkey: "..."},
  ]
}

cluster: {
  name: "example"
}

jetstream: {
  max_memory_store: 2GB
  max_file_store: 8GB
}

Docker

Image

Compose

The following starts NATS using the leanest image base (scratch) and with JetStream enabled:

Last updated