Skip to main content
NATS Server is distributed as a single, self-contained binary with no external dependencies. This makes it easy to download, install, and run on any platform.

Download Locations

Official NATS Server binaries are available from:

Latest Version

Download the latest stable release:
Replace v2.10.0 with the actual latest version number from the releases page.

Platform-Specific Installation

Linux

Quick Installation

Manual Installation

Package Managers

macOS

Manual Installation

Windows

Manual Installation

  1. Download the Windows ZIP from GitHub Releases
  2. Extract the ZIP file
  3. Move nats-server.exe to a directory in your PATH (e.g., C:\Windows\System32)
  4. Verify installation:

Chocolatey

Scoop

Running NATS Server

Basic Usage

Start NATS with default settings:
The server will:
  • Listen on port 4222 for client connections
  • Listen on 0.0.0.0 (all interfaces)
  • Run in the foreground

With Configuration File

Command Line Options

Common options:
  • -p, --port - Client connection port (default: 4222)
  • -a, --addr - Network address to bind (default: 0.0.0.0)
  • -m, --http_port - HTTP monitoring port
  • -c, --config - Configuration file path
  • -l, --log - Log file path
  • -D, --debug - Enable debug logging
  • -V, --trace - Enable trace logging
  • -js - Enable JetStream
  • --sd - JetStream storage directory

Enable JetStream

Running as a Service

systemd (Linux)

Create a systemd service file:
/etc/systemd/system/nats-server.service
Set up the service:

launchd (macOS)

Create a launch agent:
~/Library/LaunchAgents/io.nats.nats-server.plist
Load the service:

Windows Service

Use NSSM (Non-Sucking Service Manager):

Updating and Upgrading

Manual Update

  1. Download the new version
  2. Stop the running server
  3. Replace the binary
  4. Restart the server

Package Manager Updates

Zero-Downtime Updates

For clustered deployments, update nodes one at a time:

Verifying Installation

Check Version

Test Configuration

The -t flag validates configuration without starting the server.

Test Connection

Security Considerations

Always run NATS Server as a non-root user in production environments.

File Permissions

Firewall Rules

Allow necessary ports:

Best Practices

Use Configuration Files

Store configuration in files rather than using command-line flags for better maintainability.

Run as Service

Use systemd, launchd, or Windows services for automatic restarts and proper lifecycle management.

Regular Updates

Keep NATS Server updated to benefit from security patches and new features.

Monitor Logs

Configure proper logging and monitor logs for errors and performance issues.

Troubleshooting

Binary Not Found

Ensure the binary is in your PATH:

Permission Denied

Port Already in Use

Check what’s using port 4222:

Service Won’t Start

Check service logs:

Next Steps

Configuration

Learn about configuration options and best practices

Docker Deployment

Explore containerized deployment options