github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/install/index.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: Installing Nomad
     4  description: Learn how to install Nomad.
     5  ---
     6  
     7  # Installing Nomad
     8  
     9  Nomad is available as a pre-compiled binary or as a package for several
    10  operating systems. You can also [build Nomad from source](#from-source).
    11  
    12  -> If you are interested in trialing Nomad without installing it locally, see the
    13  [Quickstart](/docs/install/quickstart) for options to get started with Nomad.
    14  
    15  <Tabs>
    16  <Tab heading="Manual installation">
    17  
    18  You can download a [precompiled binary](/downloads) and
    19  run it on your machine locally. You can also verify the binary using the
    20  available SHA-256 sums. After downloading Nomad, unzip the package. Make sure
    21  that the `nomad` binary is available on your `PATH` before continuing with the
    22  other guides.
    23  
    24  You can check the locations available on your path by running this command.
    25  
    26  ```shell-session
    27  $ echo $PATH
    28  
    29  /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
    30  ```
    31  
    32  The output is a list of locations separated by colons. You can make Nomad
    33  available by moving the binary to one of the listed locations, or by adding
    34  Nomad's location to your `PATH`.
    35  
    36  -> **Tip (Linux-based or Mac):** Permanently add a new location to your path by
    37  editing your shell's settings file (usually called something like `~/.bashrc`,
    38  where the part of the file name after the `.` and before `rc` is the name of
    39  your shell). In that file you will see a line that starts with `export PATH=`,
    40  followed by a colon-separated list of locations. Add the location of the Nomad
    41  binary to that list and save the file. Then reload your shell's configuration
    42  with the command `source ~/.bashrc`, replacing `bash` with the name of your
    43  shell.
    44  
    45  -> **Tip (Windows):** Add a location to your path via the GUI by navigating to
    46  `Environment Variables` in your system settings, and looking for the variable
    47  called `PATH`. You will see a semicolon-separated list of locations. Add the
    48  Nomad binary's location to that list and then launch a new console window.
    49  
    50  </Tab>
    51  <Tab heading="Linux Packages">
    52  
    53  HashiCorp officially maintains and signs packages for the following Linux
    54  distributions.
    55  
    56  <Tabs>
    57  <Tab heading="Ubuntu/Debian">
    58  
    59  Add the HashiCorp [GPG key][gpg-key].
    60  
    61  ```shell-session
    62  $ curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
    63  ```
    64  
    65  Add the official HashiCorp Linux repository.
    66  
    67  ```shell-session
    68  $ sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
    69  ```
    70  
    71  Update and install.
    72  
    73  ```shell-session
    74  $ sudo apt-get update && sudo apt-get install nomad
    75  ```
    76  
    77  </Tab>
    78  <Tab heading="CentOS/RHEL">
    79  
    80  Install `yum-config-manager` to manage your repositories.
    81  
    82  ```shell-session
    83  $ sudo yum install -y yum-utils
    84  ```
    85  
    86  Use `yum-config-manager` to add the official HashiCorp Linux repository.
    87  
    88  ```shell-session
    89  $ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
    90  ```
    91  
    92  Install.
    93  
    94  ```shell-session
    95  $ sudo yum -y install nomad
    96  ```
    97  
    98  </Tab>
    99  <Tab heading="Fedora">
   100  
   101  Install `dnf config-manager` to manage your repositories.
   102  
   103  ```shell-session
   104  $ sudo dnf install -y dnf-plugins-core
   105  ```
   106  
   107  Use `dnf config-manager` to add the official HashiCorp Linux repository.
   108  
   109  ```shell-session
   110  $ sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
   111  ```
   112  
   113  Install.
   114  
   115  ```shell-session
   116  $ sudo dnf -y install nomad
   117  ```
   118  
   119  </Tab>
   120  <Tab heading="Amazon Linux">
   121  
   122  Install `yum-config-manager` to manage your repositories.
   123  
   124  ```shell-session
   125  $ sudo yum install -y yum-utils
   126  ```
   127  
   128  Use `yum-config-manager` to add the official HashiCorp Linux repository.
   129  
   130  ```shell-session
   131  $ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
   132  ```
   133  
   134  Install.
   135  
   136  ```shell-session
   137  $ sudo yum -y install nomad
   138  ```
   139  
   140  </Tab>
   141  </Tabs>
   142  
   143  -> **TIP:** Now that you have added the HashiCorp repository, you can install
   144  [Consul](https://learn.hashicorp.com/consul) and
   145  [Vault](https://learn.hashicorp.com/vault) with the same command.
   146  
   147  </Tab>
   148  <Tab heading="Homebrew (macOS)">
   149  
   150  [Homebrew](https://brew.sh) is a free and open source package management system
   151  for Mac OS X. Install the official [Nomad
   152  formula](https://github.com/hashicorp/homebrew-tap) from the terminal.
   153  
   154  First, install the HashiCorp tap, a repository of all of the HashiCorp Homebrew
   155  packages.
   156  
   157  ```shell-session
   158  $ brew tap hashicorp/tap
   159  ```
   160  
   161  Now, install Nomad with `hashicorp/tap/nomad`.
   162  
   163  ```shell-session
   164  $ brew install hashicorp/tap/nomad
   165  ```
   166  
   167  ~> **NOTE:** This installs a signed binary and is automatically updated with
   168  every new official release.
   169  
   170  To update to the latest, run
   171  
   172  ```shell-session
   173  $ brew upgrade hashicorp/tap/nomad
   174  ```
   175  
   176  </Tab>
   177  <Tab heading="Chocolatey (Windows)">
   178  
   179  [Chocolatey](https://chocolatey.org/) is a free and open-source package
   180  management system for Windows. Install the [Nomad
   181  package](https://chocolatey.org/packages/nomad) from the command-line.
   182  
   183  ```shell-session
   184  $ choco install nomad
   185  ```
   186  
   187  ~> **NOTE:** Chocolatey and the Nomad package are **NOT** directly maintained
   188  by HashiCorp. The latest version of Nomad is always available by manual
   189  installation.
   190  
   191  </Tab>
   192  </Tabs>
   193  
   194  ---
   195  
   196  ## Verify the Installation
   197  
   198  To verify Nomad was installed correctly, try the `nomad` command.
   199  
   200  ```shell-session
   201  $ nomad
   202  ```
   203  
   204  You should see help output, similar to the following.
   205  
   206  ```plaintext
   207  Usage: nomad [-version] [-help] [-autocomplete-(un)install] <command> [args]
   208  
   209  Common commands:
   210      run         Run a new job or update an existing job
   211      stop        Stop a running job
   212      status      Display the status output for a resource
   213      alloc       Interact with allocations
   214      job         Interact with jobs
   215      node        Interact with nodes
   216      agent       Runs a Nomad agent
   217  
   218  Other commands:
   219      acl             Interact with ACL policies and tokens
   220      agent-info      Display status information about the local agent
   221      deployment      Interact with deployments
   222      eval            Interact with evaluations
   223      exec            Execute commands in task
   224      monitor         Stream logs from a Nomad agent
   225      namespace       Interact with namespaces
   226      operator        Provides cluster-level tools for Nomad operators
   227      quota           Interact with quotas
   228      sentinel        Interact with Sentinel policies
   229      server          Interact with servers
   230      system          Interact with the system API
   231      ui              Open the Nomad Web UI
   232      version         Prints the Nomad version
   233  ```
   234  
   235  ---
   236  
   237  ## Compiling from Source ((#from-source))
   238  
   239  To compile from source, you will need [Go](https://golang.org) installed and
   240  configured properly (including a `GOPATH` environment variable set), as well
   241  as a copy of [`git`](https://www.git-scm.com/) in your `PATH`.
   242  
   243  1. Clone the Nomad repository from GitHub into your `GOPATH`:
   244  
   245     ```shell-session
   246     $ mkdir -p $GOPATH/src/github.com/hashicorp && cd $_
   247     $ git clone https://github.com/hashicorp/nomad.git
   248     $ cd nomad
   249     ```
   250  
   251  1. Bootstrap the project. This will download and compile libraries and tools
   252     needed to compile Nomad:
   253  
   254     ```shell-session
   255     $ make bootstrap
   256     ```
   257  
   258  1. Build Nomad for your current system and put the
   259     binary in `./bin/` (relative to the git checkout). The `make dev` target is
   260     just a shortcut that builds `nomad` for only your local build environment (no
   261     cross-compiled targets).
   262  
   263     ```shell-session
   264     $ make dev
   265     ```
   266  
   267  [consul-dev]: https://learn.hashicorp.com/consul/getting-started/agent#starting-the-agent
   268  
   269  [consul-download]: https://developer.hashicorp.com/consul/downloads
   270  
   271  [destroy]: https://www.vagrantup.com/docs/cli/destroy
   272  
   273  [gh-7865]: https://github.com/hashicorp/nomad/issues/7865
   274  
   275  [gpg-key]: https://apt.releases.hashicorp.com/gpg "HashiCorp GPG key"