github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/install/index.mdx (about)

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