Getting Started

Install Consul

The first thing you need to do in order to use Consul is install it. In a production deployment you would install Consul on every node where you want to register services, but in this guide you will install it locally so that you can use it to explore Consul's core capabilities. Consul is distributed as a binary package.

Installing Consul

To install Consul, find the appropriate package for your system and download it. Consul is packaged as a zip archive.

After downloading Consul, unzip the package. Consul runs as a single binary named consul. Any other files in the package can be safely removed and Consul will still function.

Make sure that the consul binary is available on your PATH. You can check the locations available on your path by running this command.

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

The output is a list of locations separated by colons. You can make Consul available by moving the binary to one of the listed locations, or by adding Consul's location to your PATH.

Verifying the Installation

After installing Consul, verify that the installation worked by opening a new terminal session and running the command consul.

$ consul
usage: consul [--version] [--help] <command> [<args>]

Available commands are:
    agent          Runs a Consul agent
    event          Fire a new event

...

If you get an error that consul could not be found, your PATH environment variable was not set up properly. Make sure that your PATH variable contains the directory where you installed Consul.

Summary

In this guide you installed Consul on your local machine. Continue to the next guide where you will learn how to run the Consul agent.