How To Install Hashicorp Vault on Ubuntu 18.04 LTS

Install Hashicorp Vault on Ubuntu 18.04 LTS

In this tutorial we will show you how to install Hashicorp Vault on Ubuntu 18.04 LTS. For those of you who didn’t know, Vault is an open-source tool that provides a secure, reliable way to store and distribute secrets like API keys, access tokens, and passwords. Software like Vault can be critically important when deploying applications that require the use of secrets or sensitive data.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Hashicorp Vault on an Ubuntu 18.04 Bionic Beaver server.

Install Hashicorp Vault on Ubuntu 18.04 LTS Bionic Beaver

Step 1. First, make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

Step 2. Installing Consul.

First, go to the Consul downloads page.  Right-click the link for Linux 64-bit and select ‘copy link address’ or whatever the similar option is for your browser:

Next, run Consul as a service so we need to configure a SystemD service for Consul:

Next we need to add some configuration so that we can access the Consul GUI from our network:

Then, create a new file /etc/consul.d/ui.json and add the following file:

Now we are ready to start the Consul Service:

Verify that our Consul Service:

Step 3. Installing Vault on Ubuntu 18.04.

First, go to the Vault Downloads page and copy the URL just like we did for Consul:

Next, Create a configuration directory /etc/vault:

Then, Create a new file /etc/vault/config.hcl with the following contents:

Now we need to create the SystemD Service for vault:

Next, we need to start the Vault Service:

To enable the CLI to connect to our Vault service run this command:

After Vault starts we need to initialize it. This only has to be done once or when you change storage backends for some reason:

Congratulation’s! You have successfully installed Vault. Thanks for using this tutorial for installing Hashicorp Vault in Ubuntu 18.04 LTS system. For additional help or useful information, we recommend you to check the official Vault web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!