To use a HashiCorp Enterprise product, you need a valid HashiCorp license. This tutorial will guide you on the steps to enable your enterprise license to start the server. By the end of this tutorial, you will have a server instance with enterprise features enabled. If you don't have a license, you can request a 30-day trial license. See the Request a license section.
NOTE: This guidance for enabling an enterprise license applies to both production and development environments.
This tutorial is applicable to the following HashiCorp enterprise product versions or greater. Nomad v1.1.0, Consul v1.10.0, and Vault v1.8.0
Each server needs to register the enterprise license as described below. In previous versions of HashiCorp enterprise products, one server could distribute a license to other servers via the Raft protocol. This will no longer work since each server must be able to find a valid license during the startup process.
The tutorial below describes the most basic steps needed to register a license. You may need to design other steps to integrate this process into your build pipelines (such as building private disk images with Packer or using a configuration management system to distribute and install the enterprise binary and license file to your compute instances).
»Install the enterprise binary
You need to install the enterprise binary before continuing with the tutorial. All HashiCorp binaries are in releases.hashicorp.com, look for a binary that has
+ent in the suffix of the filename.
You can find installation tutorials for each HashiCorp product in learn.hashicorp.com
»Request a trial license
You can download a 30-day free trial license for any HashiCorp enterprise product. Follow the links below and agree to the terms of service. Upon completing the form, you will observe a license key on the screen and receive an email containing the license. Copy the license key to your system's clipboard as you will use it in the next step.
NOTE: If you are an existing HashiCorp enterprise customer you may contact your organization's customer success manager (CSM) or email email@example.com for information on how to get your organization's enterprise license.
»Enable the license
You have three options for enabling an enterprise license.
- You can provide the enterprise license as a string in an environment variable.
- You can save the license string to a file and reference the path with an environment variable.
- You may place the license string in a file and specify the path to the file in the server's configuration file.
»Add an environment variable (optional)
You can set the enterprise license for Consul by using an environment variable.
Use the the enterprise license you received in the previous step and set the environment variable
CONSUL_LICENSE to the license key value.
$ export CONSUL_LICENSE=02MV4UU43BK5....
»Read from a file (optional)
The enterprise license can be read from a file. If you add the enterprise license to a file, you have two options for how to point the server instance to the file location. The two options are an environment variable or a server instance configuration file.
Use the the enterprise license key you received in the previous step and create a file that will hold the enterprise license.
You can use the
echo command to copy the content from your system's clipboard into a file.
$ echo "02MV4UU43BK5..." >> license.hclic
Verify the content copied correctly to the specified file before you move onto the next step.
$ cat license.hclic02MV4UU43BK5...
The environment variable name is
Use the license file you created earlier and set the environment variable
CONSUL_LICENSE_PATH to the license key path.
$ export CONSUL_LICENSE_PATH=/etc/consul.d/license.hclic
NOTE: The file path provided must be an absolute path. Shell variables like
$HOME can be used but relative paths like
~/ cannot be used.
»Validating the server
Start the Consul server instance.
$ consul agent -dev==> Starting Consul agent... Version: '1.10.0+ent' Node ID: '93a230f3-888e-7fd7-81ea-04f6d43ab199' Node name: 'defaultNode' Datacenter: 'dc1' (Segment: '<all>') Server: true (Bootstrap: false) Client Addr: [127.0.0.1] (HTTP: 8500, HTTPS: -1, gRPC: 8502, DNS: 8600) Cluster Addr: 127.0.0.1 (LAN: 8301, WAN: 8302) Encrypt: Gossip: false, TLS-Outgoing: false, TLS-Incoming: false, Auto-Encrypt-TLS: false ==> Log data will now stream in as it occurs:
If the server instance started successfully, then you will receive a message stating the Consul agent started.
Look for the lines
Server: true and
Version: 1.10.0+ent to verify that an enterprise server is running.
The server instance will notify you if the enterprise license key is not found. If you encounter the error message below or similar, please revisit the steps above.
$ consul agent -dev...2021-06-03T07:29:30.220-0700 [ERROR] agent: Error starting agent: error="server agents require a license to be loaded via the configuration"2021-06-03T07:29:30.220-0700 [INFO] agent: Exit code: code=1
In this tutorial, you deployed a server instance for an enterprise HashiCorp product using a valid enterprise license key. You may now continue exploring other enterprise tutorials for Consul, Nomad, or Vault.