2015-09-12 00:01:02 +00:00
|
|
|
---
|
2020-03-20 21:04:10 +00:00
|
|
|
layout: docs
|
2020-02-06 23:45:31 +00:00
|
|
|
page_title: Installing Nomad
|
|
|
|
sidebar_title: Installing Nomad
|
|
|
|
description: Learn how to install Nomad.
|
2015-09-12 00:01:02 +00:00
|
|
|
---
|
|
|
|
|
2016-10-08 10:58:18 +00:00
|
|
|
# Installing Nomad
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-08-07 20:27:17 +00:00
|
|
|
Nomad is available as a pre-compiled binary or as a package for several
|
|
|
|
operating systems. You can also [build Nomad from source](#from-source).
|
2016-10-08 10:58:18 +00:00
|
|
|
|
2020-08-07 20:27:17 +00:00
|
|
|
-> If you are interested in trialing Nomad without installing it locally, see the
|
|
|
|
[Quickstart](/docs/install/quickstart) for options to get started with Nomad.
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-08-07 20:27:17 +00:00
|
|
|
<Tabs>
|
|
|
|
<Tab heading="Manual installation">
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-09-29 16:48:32 +00:00
|
|
|
You can download a [precompiled binary](/downloads) and
|
2020-08-07 20:27:17 +00:00
|
|
|
run it on your machine locally. You can also verify the binary using the
|
|
|
|
available SHA-256 sums. After downloading Nomad, unzip the package. Make sure
|
|
|
|
that the `nomad` binary is available on your `PATH` before continuing with the
|
|
|
|
other guides.
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-08-07 20:27:17 +00:00
|
|
|
You can check the locations available on your path by running this command.
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-08-07 20:27:17 +00:00
|
|
|
```shell-session
|
|
|
|
$ echo $PATH
|
|
|
|
|
|
|
|
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
|
|
|
|
```
|
|
|
|
|
|
|
|
The output is a list of locations separated by colons. You can make Nomad
|
|
|
|
available by moving the binary to one of the listed locations, or by adding
|
|
|
|
Nomad's location to your `PATH`.
|
|
|
|
|
|
|
|
-> **Tip (Linux-based or Mac):** Permanently add a new location to your path by
|
|
|
|
editing your shell's settings file (usually called something like `~/.bashrc`,
|
|
|
|
where the part of the file name after the `.` and before `rc` is the name of
|
|
|
|
your shell). In that file you will see a line that starts with `export PATH=`,
|
|
|
|
followed by a colon-separated list of locations. Add the location of the Consul
|
|
|
|
binary to that list and save the file. Then reload your shell's configuration
|
|
|
|
with the command `source ~/.bashrc`, replacing `bash` with the name of your
|
|
|
|
shell.
|
|
|
|
|
|
|
|
-> **Tip (Windows):** Add a location to your path via the GUI by navigating to
|
|
|
|
`Environment Variables` in your system settings, and looking for the variable
|
|
|
|
called `PATH`. You will see a semicolon-separated list of locations. Add the
|
|
|
|
Nomad binary's location to that list and then launch a new console window.
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
<Tab heading="Linux Packages">
|
|
|
|
|
|
|
|
HashiCorp officially maintains and signs packages for the following Linux
|
|
|
|
distributions.
|
|
|
|
|
|
|
|
<Tabs>
|
|
|
|
<Tab heading="Ubuntu/Debian">
|
|
|
|
|
|
|
|
Add the HashiCorp [GPG key][gpg-key].
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
|
|
|
|
```
|
|
|
|
|
|
|
|
Add the official HashiCorp Linux repository.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
|
|
|
|
```
|
|
|
|
|
|
|
|
Update and install.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo apt-get update && sudo apt-get install nomad
|
|
|
|
```
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
<Tab heading="CentOS/RHEL">
|
|
|
|
|
|
|
|
Install `yum-config-manager` to manage your repositories.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo yum install -y yum-utils
|
|
|
|
```
|
|
|
|
|
|
|
|
Use `yum-config-manager` to add the official HashiCorp Linux repository.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
|
|
|
|
```
|
|
|
|
|
|
|
|
Install.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo yum -y install nomad
|
|
|
|
```
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
<Tab heading="Fedora">
|
|
|
|
|
|
|
|
Install `dnf config-manager` to manage your repositories.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo dnf install -y dnf-plugins-core
|
|
|
|
```
|
|
|
|
|
|
|
|
Use `dnf config-manager` to add the official HashiCorp Linux repository.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
|
|
|
|
```
|
|
|
|
|
|
|
|
Install.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo dnf -y install nomad
|
|
|
|
```
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-08-07 20:27:17 +00:00
|
|
|
</Tab>
|
|
|
|
<Tab heading="Amazon Linux">
|
|
|
|
|
|
|
|
Install `yum-config-manager` to manage your repositories.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo yum install -y yum-utils
|
|
|
|
```
|
|
|
|
|
|
|
|
Use `yum-config-manager` to add the official HashiCorp Linux repository.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
|
|
|
|
```
|
|
|
|
|
|
|
|
Install.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ sudo yum -y install nomad
|
|
|
|
```
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
-> **TIP:** Now that you have added the HashiCorp repository, you can install
|
|
|
|
[Consul](https://learn.hashicorp.com/consul) and
|
|
|
|
[Vault](https://learn.hashicorp.com/vault) with the same command.
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
<Tab heading="Homebrew (macOS)">
|
|
|
|
|
2021-02-11 23:42:18 +00:00
|
|
|
[Homebrew](https://brew.sh) is a free and open source package management system
|
|
|
|
for Mac OS X. Install the official [Nomad
|
|
|
|
formula](https://github.com/hashicorp/homebrew-tap) from the terminal.
|
2020-12-07 22:04:11 +00:00
|
|
|
|
2021-02-11 23:42:18 +00:00
|
|
|
First, install the HashiCorp tap, a repository of all of the HashiCorp Homebrew
|
|
|
|
packages.
|
2020-08-07 20:27:17 +00:00
|
|
|
|
|
|
|
```shell-session
|
2021-02-11 23:42:18 +00:00
|
|
|
$ brew tap hashicorp/tap
|
2020-08-07 20:27:17 +00:00
|
|
|
```
|
|
|
|
|
2021-02-11 23:42:18 +00:00
|
|
|
Now, install Nomad with `hashicorp/tap/nomad`.
|
2020-08-07 20:27:17 +00:00
|
|
|
|
2021-02-11 23:42:18 +00:00
|
|
|
```shell-session
|
|
|
|
$ brew install hashicorp/tap/nomad
|
|
|
|
```
|
|
|
|
|
|
|
|
~> **NOTE:** This installs a signed binary and is automatically updated with
|
|
|
|
every new official release.
|
|
|
|
|
|
|
|
To update to the latest, run
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ brew upgrade hashicorp/tap/nomad
|
|
|
|
```
|
2020-08-07 20:27:17 +00:00
|
|
|
|
|
|
|
</Tab>
|
|
|
|
<Tab heading="Chocolatey (Windows)">
|
|
|
|
|
|
|
|
[Chocolatey](https://chocolatey.org/) is a free and open-source package
|
|
|
|
management system for Windows. Install the [Nomad
|
|
|
|
package](https://chocolatey.org/packages/nomad) from the command-line.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ choco install nomad
|
|
|
|
```
|
|
|
|
|
|
|
|
~> **NOTE:** Chocolatey and the Nomad package are **NOT** directly maintained
|
|
|
|
by HashiCorp. The latest version of Nomad is always available by manual
|
|
|
|
installation.
|
|
|
|
|
|
|
|
</Tab>
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
## Verify the Installation
|
|
|
|
|
|
|
|
To verify Nomad was installed correctly, try the `nomad` command.
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
$ nomad
|
|
|
|
```
|
|
|
|
|
|
|
|
You should see help output, similar to the following.
|
|
|
|
|
|
|
|
```plaintext
|
|
|
|
Usage: nomad [-version] [-help] [-autocomplete-(un)install] <command> [args]
|
|
|
|
|
|
|
|
Common commands:
|
|
|
|
run Run a new job or update an existing job
|
|
|
|
stop Stop a running job
|
|
|
|
status Display the status output for a resource
|
|
|
|
alloc Interact with allocations
|
|
|
|
job Interact with jobs
|
|
|
|
node Interact with nodes
|
|
|
|
agent Runs a Nomad agent
|
|
|
|
|
|
|
|
Other commands:
|
|
|
|
acl Interact with ACL policies and tokens
|
|
|
|
agent-info Display status information about the local agent
|
|
|
|
deployment Interact with deployments
|
|
|
|
eval Interact with evaluations
|
|
|
|
exec Execute commands in task
|
|
|
|
monitor Stream logs from a Nomad agent
|
|
|
|
namespace Interact with namespaces
|
|
|
|
operator Provides cluster-level tools for Nomad operators
|
|
|
|
quota Interact with quotas
|
|
|
|
sentinel Interact with Sentinel policies
|
|
|
|
server Interact with servers
|
|
|
|
system Interact with the system API
|
|
|
|
ui Open the Nomad Web UI
|
|
|
|
version Prints the Nomad version
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-03-26 20:21:24 +00:00
|
|
|
## Compiling from Source ((#from-source))
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2016-06-17 04:42:47 +00:00
|
|
|
To compile from source, you will need [Go](https://golang.org) installed and
|
|
|
|
configured properly (including a `GOPATH` environment variable set), as well
|
|
|
|
as a copy of [`git`](https://www.git-scm.com/) in your `PATH`.
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
1. Clone the Nomad repository from GitHub into your `GOPATH`:
|
2016-10-08 10:58:18 +00:00
|
|
|
|
2020-05-18 20:53:06 +00:00
|
|
|
```shell-session
|
2020-02-06 23:45:31 +00:00
|
|
|
$ mkdir -p $GOPATH/src/github.com/hashicorp && cd $_
|
|
|
|
$ git clone https://github.com/hashicorp/nomad.git
|
|
|
|
$ cd nomad
|
|
|
|
```
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
1. Bootstrap the project. This will download and compile libraries and tools
|
|
|
|
needed to compile Nomad:
|
2016-06-06 17:33:54 +00:00
|
|
|
|
2020-05-18 20:53:06 +00:00
|
|
|
```shell-session
|
2020-02-06 23:45:31 +00:00
|
|
|
$ make bootstrap
|
|
|
|
```
|
2016-06-17 04:42:47 +00:00
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
1. Build Nomad for your current system and put the
|
|
|
|
binary in `./bin/` (relative to the git checkout). The `make dev` target is
|
|
|
|
just a shortcut that builds `nomad` for only your local build environment (no
|
|
|
|
cross-compiled targets).
|
2016-10-08 10:58:18 +00:00
|
|
|
|
2020-05-18 20:53:06 +00:00
|
|
|
```shell-session
|
2020-02-06 23:45:31 +00:00
|
|
|
$ make dev
|
|
|
|
```
|
2015-09-12 00:01:02 +00:00
|
|
|
|
2020-08-07 20:27:17 +00:00
|
|
|
[consul-dev]: https://learn.hashicorp.com/consul/getting-started/agent#starting-the-agent
|
2020-09-29 16:48:32 +00:00
|
|
|
[consul-download]: https://www.consul.io/downloads
|
|
|
|
[destroy]: https://www.vagrantup.com/docs/cli/destroy
|
2020-08-07 20:27:17 +00:00
|
|
|
[gh-7865]: https://github.com/hashicorp/nomad/issues/7865
|
|
|
|
[gpg-key]: https://apt.releases.hashicorp.com/gpg 'HashiCorp GPG key'
|