System requirements
NATS Server has minimal system requirements and can run on resource-constrained devices including Raspberry Pi.
- CPU: 1 core (2+ cores recommended for production)
- Memory: 128 MB RAM (varies based on workload)
- Disk: 50 MB for binary (additional storage needed for JetStream)
- OS: Linux, macOS, Windows, or any platform with Go support
- 4222: Client connections
- 6222: Cluster routing
- 8222: HTTP monitoring (when enabled)
- 5222: Gateway connections (for super-clusters)
Installation methods
- Docker
- Binary Download
- Package Managers
- Build from Source
Docker is the fastest way to get started with NATS Server.The Docker image includes:
Pull the official image
nats-server- The NATS Server binarynats- The NATS CLI toolnsc- The NATS Security CLI
Run the server
Exposed ports in Docker image
The official Docker image exposes these ports by default:The default Docker configuration file is located at
/nats/conf/nats-server.conf and includes basic settings for client and cluster ports.Docker Compose example
Post-installation steps
Verify installation
Check that NATS Server is installed correctly:Start the server
Start NATS Server with default settings:Configuration
Configuration file location
NATS Server looks for configuration files in these locations:- Docker:
/nats/conf/nats-server.conf - Linux:
/etc/nats/nats-server.conf(conventional) - macOS:
/usr/local/etc/nats-server.conf(conventional) - Windows:
C:\nats\nats-server.conf(conventional)
-c flag:
Basic configuration example
Create a basic configuration file:nats-server.conf
Simple configuration example from source
From the NATS Server repository:simple.conf
Running as a service
Linux (systemd)
Create a systemd service file at/etc/systemd/system/nats-server.service:
macOS (launchd)
Create a plist file at~/Library/LaunchAgents/io.nats.server.plist:
Command-line reference
Here’s an overview of common command-line options from the source:Server options
Logging options
JetStream options
Authorization options
TLS options
Cluster options
Next steps
Quickstart
Follow the quickstart guide to send your first message
Configuration
Learn about advanced configuration options
Security
Secure your NATS Server deployment
Monitoring
Set up monitoring and observability