Walkthrough Setup
We have provided Walkthroughs for you to try NATS (and JetStream) on your own. In order to follow along with the walkthroughs, the nats CLI tool must be installed, and a local NATS server must be installed (or alternatively you can use a remote server you have access to, or Synadia's NGS (or you could even use the demo server located at nats://demo.nats.io)).

Installing the nats CLI Tool

For macOS:
1
brew tap nats-io/nats-tools
2
brew install nats-io/nats-tools/nats
Copied!
For Arch Linux:
1
yay natscli
Copied!
Binaries are also available as GitHub Releases.

Installing the NATS server locally (if needed)

If you are going to run a server locally you need to first install it and start it. Alternatively if you are going to use a remote server you only need to pass the server URL to nats using the -s or preferably create a context using nats context add to specify the server URL(s) and credentials file containing your user JWT.

Installing via a Package Manager

On Mac OS:
1
brew install nats-server
Copied!
On Windows:
1
choco install nats-server
Copied!
On Linux:
1
yay nats-server
Copied!

Downloading a Release Build

You can find the latest release of nats-server here.
Download the zip file matching your systems architecture, and unzip. For this example, assuming version 2.6.2 of the server and a Linux AMD64:
1
curl -L https://github.com/nats-io/nats-server/releases/download/v2.0.0/nats-server-v2.6.2-linux-amd64.zip -o nats-server.zip
Copied!
1
unzip nats-server.zip -d nats-server
Copied!
which should output something like
1
Archive: nats-server.zip
2
creating: nats-server-v2.6.2-linux-amd64/
3
inflating: nats-server-v2.6.2-linux-amd64/README.md
4
inflating: nats-server-v2.6.2-linux-amd64/LICENSE
5
inflating: nats-server-v2.6.2-linux-amd64/nats-server
Copied!
and finally:
1
sudo cp nats-server/nats-server-v2.6.2-linux-amd64/nats-server /usr/bin
Copied!

1. Start the NATS server (if needed)

To start a simple demonstration server locally simply run:
1
nats-server
Copied!
(or nats-server -m 8222 if you want to enable the HTTP monitoring functionality)
When the server starts successfully, you will see the following messages:
1
[14524] 2021/10/25 22:53:53.525530 [INF] Starting nats-server
2
[14524] 2021/10/25 22:53:53.525640 [INF] Version: 2.6.1
3
[14524] 2021/10/25 22:53:53.525643 [INF] Git: [not set]
4
[14524] 2021/10/25 22:53:53.525647 [INF] Name: NDAUZCA4GR3FPBX4IFLBS4VLAETC5Y4PJQCF6APTYXXUZ3KAPBYXLACC
5
[14524] 2021/10/25 22:53:53.525650 [INF] ID: NDAUZCA4GR3FPBX4IFLBS4VLAETC5Y4PJQCF6APTYXXUZ3KAPBYXLACC
6
[14524] 2021/10/25 22:53:53.526392 [INF] Starting http monitor on 0.0.0.0:8222
7
[14524] 2021/10/25 22:53:53.526445 [INF] Listening for client connections on 0.0.0.0:4222
8
[14524] 2021/10/25 22:53:53.526684 [INF] Server is ready
Copied!
The NATS server listens for client connections on TCP Port 4222.
Last modified 10d ago