github.com/ratanraj/packer@v1.3.2/website/source/intro/getting-started/install.html.md (about)

     1  ---
     2  layout: intro
     3  sidebar_current: intro-getting-started-install
     4  page_title: Install Packer - Getting Started
     5  description: |-
     6    Packer must first be installed on the machine you want to run it on. To make
     7    installation easier, Packer is distributed as a binary package for all supported
     8    platforms and architectures. This page will not cover how to compile Packer
     9    from source, as that is covered in the README and is only recommended for
    10    advanced users.
    11  ---
    12  
    13  # Install Options
    14  
    15  Packer may be installed in the following ways:
    16  
    17  1. Using a [precompiled binary](#precompiled-binaries); We release binaries
    18    for all supported platforms and architectures. This method is recommended for
    19    most users.
    20  
    21  2. Installing [from source](#compiling-from-source) This method is only
    22    recommended for advanced users.
    23  
    24  3. An unoffical [alternative installation method](#alternative-installation-methods)
    25  
    26  ## Precompiled Binaries
    27  
    28  To install the precompiled binary, [download](/downloads.html) the appropriate
    29  package for your system. Packer is currently packaged as a zip file. We do not
    30  have any near term plans to provide system packages.
    31  
    32  Next, unzip the downloaded package into a directory where Packer will be
    33  installed. On Unix systems, `~/packer` or `/usr/local/packer` is generally good,
    34  depending on whether you want to restrict the install to just your user or
    35  install it system-wide. If you intend to access it from the command-line, make
    36  sure to place it somewhere on your `PATH` before `/usr/sbin`. On Windows
    37  systems, you can put it wherever you'd like. The `packer` (or `packer.exe` for
    38  Windows) binary inside is all that is necessary to run Packer. Any additional
    39  files aren't required to run Packer.
    40  
    41  After unzipping the package, the directory should contain a single binary
    42  program called `packer`. The final step to
    43  installation is to make sure the directory you installed Packer to is on the
    44  PATH. See [this
    45  page](https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux)
    46  for instructions on setting the PATH on Linux and Mac. [This
    47  page](https://stackoverflow.com/questions/1618280/where-can-i-set-path-to-make-exe-on-windows)
    48  contains instructions for setting the PATH on Windows.
    49  
    50  ## Compiling from Source
    51  
    52  To compile from source, you will need [Go](https://golang.org) installed and
    53  configured properly as well as a copy of [`git`](https://www.git-scm.com/)
    54  in your `PATH`.
    55  
    56  1.  Clone the Packer repository from GitHub into your `GOPATH`:
    57  
    58      ``` shell
    59      $ mkdir -p $(go env GOPATH)/src/github.com/hashicorp && cd $_
    60      $ git clone https://github.com/hashicorp/packer.git
    61      $ cd packer
    62      ```
    63  
    64  2.  Build Packer for your current system and put the
    65      binary in `./bin/` (relative to the git checkout). The `make dev` target is
    66      just a shortcut that builds `packer` for only your local build environment (no
    67      cross-compiled targets).
    68  
    69      ``` shell
    70      $ make dev
    71      ```
    72  
    73  ## Verifying the Installation
    74  
    75  After installing Packer, verify the installation worked by opening a new command
    76  prompt or console, and checking that `packer` is available:
    77  
    78  ```text
    79  $ packer
    80  usage: packer [--version] [--help] <command> [<args>]
    81  
    82  Available commands are:
    83      build       build image(s) from template
    84      fix         fixes templates from old versions of packer
    85      inspect     see components of a template
    86      validate    check that a template is valid
    87      version     Prints the Packer version
    88  ```
    89  
    90  If you get an error that `packer` could not be found, then your PATH environment
    91  variable was not setup properly. Please go back and ensure that your PATH
    92  variable contains the directory which has Packer installed.
    93  
    94  Otherwise, Packer is installed and you're ready to go!
    95  
    96  ## Alternative Installation Methods
    97  
    98  While the binary packages is the only official method of installation, there are
    99  alternatives available.
   100  
   101  ### Homebrew
   102  
   103  If you're using OS X and [Homebrew](http://brew.sh), you can install Packer by
   104  running:
   105  
   106      $ brew install packer
   107  
   108  ### Chocolatey
   109  
   110  If you're using Windows and [Chocolatey](http://chocolatey.org), you can
   111  install Packer by running:
   112  
   113      choco install packer
   114  
   115  ## Troubleshooting
   116  
   117  On some *RedHat*-based Linux distributions there is another tool named `packer`
   118  installed by default. You can check for this using `which -a packer`. If you get
   119  an error like this it indicates there is a name conflict.
   120  
   121      $ packer
   122      /usr/share/cracklib/pw_dict.pwd: Permission denied
   123      /usr/share/cracklib/pw_dict: Permission denied
   124  
   125  To fix this, you can create a symlink to packer that uses a different name like
   126  `packer.io`, or invoke the `packer` binary you want using its absolute path,
   127  e.g. `/usr/local/packer`.
   128  
   129  On *Arch* Linux there is a package named `packer` in the main
   130  repository and in the AUR. The package `packer` in the AUR is an old
   131  name for a package management tool for Arch, it's not Hashicorp
   132  Packer.