Skip to content

Guide · Open source

How to use NSQ: install, run and send your first message

Updated · written with AI from the project's own documentation and checked against our catalogue data

NSQ is an open-source realtime distributed messaging platform. One part of a system sends messages and another receives them, without the two connecting directly. This guide explains what NSQ is built for, how to get it, how it is configured, and when a simpler tool would serve you better.

NSQnsqio/nsq · ★ 25.8k · MIT

Quick start

  1. 1Read the README and docs. Start at nsq.io to understand NSQ's features and guarantees before deploying.
  2. 2Get the code or a binary. Clone the repository with git clone, or download a binary release for your platform.
  3. 3Pick a stable version. Because master is a development branch that may not be stable, choose a stable release rather than the latest master code.
  4. 4Set parameters on the command line. Pass all configuration as command-line parameters, as the README describes.
  5. 5Connect a client library. Use the official Go or Python client, or another client from the list, to send and receive messages.
  6. 6Plan for self-deployment. Remember that NSQ is self-deployed, so you are responsible for running and operating the nodes.

What is NSQ and what is it designed for?

NSQ is a messaging platform designed to operate at scale, which the README says means handling billions of messages per day. It promotes distributed and decentralized topologies without single points of failure, aiming for fault tolerance and high availability with a reliable message delivery guarantee.

The project is written in Go and is licensed under MIT. Its messages can be JSON, MsgPack, Protocol Buffers, or any other format, because NSQ is agnostic to data format.

Install NSQ from binaries or Docker

The README says the project publishes binary releases for Linux, Darwin, FreeBSD and Windows, and an official Docker image. The listed install commands in the source are for cloning the repository. Check the project's installation documentation at nsq.io for the exact steps for your platform.

The README lists no prerequisites. Compiled binaries are described as having no runtime dependencies.

  • Download a binary release for your operating system
  • Or use the official Docker image
  • Or clone the repository to build from source
git clone https://github.com/nsqio/nsq

Configure NSQ on the command line

NSQ is described as easy to configure and deploy because all parameters are specified on the command line. You do not need to maintain large configuration files to get started.

Official Go and Python client libraries are available, and many other client libraries exist. If you want to write your own client, the project provides a protocol spec.

  • All settings are passed as command-line parameters
  • Official client libraries: Go and Python
  • Protocol spec available for building your own client

Decide whether NSQ fits your project

NSQ suits backend teams that pass many messages between components in real time, and engineers who want a self-hosted queue without a hosted cloud service. It is a good match for operators who prefer simple command-line configuration.

It is not a good fit for small projects with light messaging needs, where a simpler queue or database table would be enough. The README covers self-deployment only, so it is not a fully managed service. The README also warns that master is a development branch and may not always be stable.

  • Good fit: high-volume real-time messaging between backend components
  • Good fit: self-hosted queue with no hosted service dependency
  • Poor fit: light messaging needs
  • Poor fit: teams wanting a fully managed service

Get help and follow the project

The README lists a mailing list (nsq-users on Google Groups), an IRC channel (#nsq on freenode), the issue tracker on GitHub, and the documentation at nsq.io. Use the issue tracker to report problems.

What people use it for

  • Passing high volumes of messages between backend services in real time
  • Running a self-hosted messaging layer instead of a hosted cloud queue
  • Letting Go or Python services exchange JSON or Protocol Buffers messages
  • Building a custom client using the published TCP protocol spec

Frequently asked questions

Is NSQ free to use?

NSQ is released under the MIT licence, according to the project's listing. You can use, modify and distribute it under that licence, subject to its terms.

What are the requirements to run NSQ?

The README lists no prerequisites. Compiled binaries are described as having no runtime dependencies, and all settings are passed on the command line.

How do I install NSQ?

The project publishes binary releases for Linux, Darwin, FreeBSD and Windows, plus an official Docker image. The source lists a git clone of the repository as the install command, so you can also build from source.

Is NSQ a good alternative to Kafka or RabbitMQ?

The comparable projects listed for NSQ are Apache Kafka, RabbitMQ and NATS. NSQ is built for realtime, distributed, high-volume messaging without single points of failure, so compare it against those on your own workload.

Why is my NSQ build unstable?

The README warns that master is a development branch and may not be stable at all times. Try a stable release instead of master, and use the project's issue tracker or mailing list if problems persist.

Is there a managed NSQ service?

The README covers self-deployment only and does not describe a managed hosted service. If you need no operations work, consider a fully managed alternative.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

NSQ suits teams running high-volume, real-time messaging between backend services who want to self-host and configure everything from the command line. Small projects with light messaging needs, or anyone wanting a fully managed service, should choose a simpler queue or a hosted option instead.

Install options & downloads