Getting started¶
Familiarize yourself with NATS Tower and its features by reading through the concept.
To get started with NATS Tower, you can either run it as a standalone application or deploy it to your container runtime of choice.
Standalone Application¶
Download the latest version of NATS Tower and run the following command to start it:
./your/path/to/nats-tower serve --http 127.0.0.1:8099
Docker¶
docker run -p 8099:8099 ghcr.io/nats-tower/nats-tower:v0.1.0 serve --http 0.0.0.0:8099
Next, open your browser and navigate to http://localhost:8099 to access the NATS Tower interface.
The default user has the email address
user@test.org
and the default password istesttest
.
The default admin has the email addressadmin@test.org
and the default password istesttest
. Please change each user after first login using the admin-account
You can manage teams and users by using the admin interface at http://localhost:8099/_/
.
Bootstrap a NATS installation¶
Prerequisites:
You need to have the NATS server binary installed.
You need to have the NATS cli installed.
You followed the NATS Tower installation instructions and have a running NATS Tower instance.
Steps to add a new NATS installation:
- Login as an admin at
http://localhost:8099/
. (Default admin:admin@test.org
, password:testtest
) - Create the NATS installation in NATS Tower by clicking on the
+ Add installation
button. - Set the URL to
nats://localhost:4222
and give it a description and click onAdd installation
. (If using docker, please use the IP of your host instead oflocalhost
) - Select the newly created NATS installation and click on the
Settings
icon next to the URLs. - Click on
Copy as NATS Config
. - Switch to the console and create a new file called
operator.conf
and paste the copied content into it. - Create a new file called
nats-server.conf
in the same folder and paste the following content into it.port: 4222 http_port: 8222 server_name: n1 include operator.conf resolver: { type: full # Directory in which account jwt will be stored dir: '/tmp/nats/storage/jwt-n2' # In order to support jwt deletion, set to true # If the resolver type is full delete will rename the jwt. # This is to allow manual restoration in case of inadvertent deletion. # To restore a jwt, remove the added suffix .delete and restart or send a reload signal. # To free up storage you must manually delete files with the suffix .delete. allow_delete: true # Interval at which a nats-server with a nats based account resolver will compare # it's state with one random nats based account resolver in the cluster and if needed, # exchange jwt and converge on the same set of jwt. interval: "2m" # limit on the number of jwt stored, will reject new jwt once limit is hit. limit: 1000 } jetstream: { store_dir: /tmp/nats/storage/n1 }
- Start the NATS server with the following command in this directory:
nats-server -c nats-server.conf
- Switch to the web UI and navigate to accounts view using the navigation bar on the left.
- Add a new account by clicking on the
+ Add account
button in the top right corner. - Fill in the account name and description, select the default limit and click on
Add account
. - Click on
Manage Users
to manage the users for the account. - Add a new NATS user by clicking on the
+ Add user
button in the top right corner. - Fill in the username and description and click on
Add user
to create the new user. - Click on
View credentials
for the newly created user to view the credentials. - Copy the
Creds
section to a file callednats.creds
- Open a new terminal in the same directory as your
nats.creds
file and run the CLI command from the user credentials dialog. - You should see a message like
No Streams defined
in the terminal. - Congratulations! You have successfully created a new NATS installation, an account and a new user.