How To Install Consul on Ubuntu 20.04 LTS

Consul is a free & open-source tool.It is used for service discovery and configuration. It is a backend storage used for storing key & values & it stores Vault’s data. Consul provides high Availability ,health checks, load balancing & a service graph & a configuration key-value store.

Install Consul on Ubuntu

Update the System.

apt-get update

Download the consul file.


Extract the downloaded file.

apt-get install unzip

Move to extract download file to /usr/bin.

mv consul /usr/bin

Configure the SystemD service for Consul:

vim /etc/systemd/system/consul.service

Add the following lines:

ExecStart=/usr/bin/consul agent -server -ui -data-dir=/tmp/consul -bootstrap-expect=1 
-node=vault -bind=server-ip/ -config-dir=/etc/consul.d/
ExecReload=/bin/kill -HUP $MAINPID

Create a Consul.d folder.

mkdir /etc/consul.d/

Create a .json file.

vim /etc/consul.d/ui.json

Add the following lines:

  "addresses": {
    "http": ""

Reload the system & Start & Enable the Consul Service:

systemctl daemon-reload
systemctl start consul
systemctl enable consul

Check the Consul:

consul members

Here is the command output.

Node   Address             Status  Type    Build  Protocol  DC   Segment
vault  alive   server  1.3.0  2         dc1  <all>

open the 8500 port number on ufw firewall.

ufw allow 8500/tcp

Access Consul web-interface


Here is the output.


Fig 1

  • Click on Key/value option.
  • Click on Create.


Fig 2


  • Provide Key or Folder name.
  • Provide the code value.


Fig. 3


  • Unable the code option.
  • Provide the value.
  • Click on Save.


Fig. 4


  • Key has been added successfully.


Fig. 7


Leave a Reply