NATS uses cookies to ensure you get the best experience on our website. Continuing to use this site assumes compliance with our Privacy Policy.

The Snap initiative spearheaded by Canonical, Dell, Samsung, Intel, The Linux Foundation and others, enables a single binary to run securely on any Linux system (desktop, mobile, cloud, IoT - you name it) – a standard approach providing flexibility, simplicity, and security. Moreover, all of the various Snap-enabled applications need to communicate with a multitude of devices and systems.

NATS is a messaging system all about simplicity, security, and performance. It’s a single binary with no external dependencies, and just a few MB in size. It’s lightweight footprint, security, and scalability made it a great fit for the Snap initiative, and we’re happy to share that a Snap for NATS Server is now available via the command line (``` sudo snap install nats-server

What is interesting about snaps as a technology offering, is how they have decided to make policy a first class citizen from the start.

For example, let's take a look at its YAML definition for the latest release of the server (which is available at [](

name: nats-server
version: "0.9.4"
summary: "High-Performance server for NATS"
description: "High-Performance server for NATS, the cloud native messaging system"
confinement: strict

    command: gnatsd-v0.9.4-linux-amd64/gnatsd
    plugs: [network-bind]

    plugin: dump

We can notice an entry plugs: [network-bind] entry being explicitly declared and for a reason: the NATS server requires being able to listen on a port.

If we take out that declaration for example…

    command: gnatsd-v0.9.4-linux-amd64/gnatsd
#    plugs: [network-bind]

…and try to start the server again we’ll be getting the following:


[1707] 2016/12/13 08:30:48.319522 [INF] Starting nats-server version 0.9.4
[1707] 2016/12/13 08:30:48.319576 [INF] Listening for client connections on
[1707] 2016/12/13 08:30:48.320145 [FTL] Error listening on port:, "listen tcp socket: permission denied"

If we uncomment again on the other hand, the server will be able to start and we connect to it without issues:

/snap/bin/nats-server &
[1] 1753

[1753] 2016/12/13 08:37:45.072217 [INF] Starting nats-server version 0.9.4
[1753] 2016/12/13 08:37:45.072263 [INF] Listening for client connections on
[1753] 2016/12/13 08:37:45.072545 [INF] Server is ready

telnet 4222
Connected to
Escape character is '^]'.
INFO {"server_id":"KIWGx86ug3TDKpDNVCCBDj","version":"0.9.4","go":"go1.6.3","host":"","port":4222,"auth_required":false,"ssl_required":false,"tls_required":false,"tls_verify":false,"max_payload":1048576}

You can find the official NATS snap by running:

snap install nats-server

Back to Blog