github.com/mmcquillan/packer@v1.1.1-0.20171009221028-c85cf0483a5d/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 Packer
    14  
    15  Packer must first be installed on the machine you want to run it on. To make
    16  installation easier, Packer is distributed as a [binary package](/downloads.html)
    17  for all supported platforms and architectures. This page will not cover how to
    18  compile Packer from source, as that is covered in the
    19  [README](https://github.com/hashicorp/packer/blob/master/README.md) and is only
    20  recommended for advanced users.
    21  
    22  ## Installing Packer
    23  
    24  To install packer, first find the [appropriate package](/downloads.html) for
    25  your system and download it. Packer is packaged as a "zip" file.
    26  
    27  Next, unzip the downloaded package into a directory where Packer will be
    28  installed. On Unix systems, `~/packer` or `/usr/local/packer` is generally good,
    29  depending on whether you want to restrict the install to just your user or
    30  install it system-wide. On Windows systems, you can put it wherever you'd like.
    31  
    32  After unzipping the package, the directory should contain a single binary
    33  program called `packer`. The final step to
    34  installation is to make sure the directory you installed Packer to is on the
    35  PATH. See [this
    36  page](https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux)
    37  for instructions on setting the PATH on Linux and Mac. [This
    38  page](https://stackoverflow.com/questions/1618280/where-can-i-set-path-to-make-exe-on-windows)
    39  contains instructions for setting the PATH on Windows.
    40  
    41  ## Verifying the Installation
    42  
    43  After installing Packer, verify the installation worked by opening a new command
    44  prompt or console, and checking that `packer` is available:
    45  
    46  ```text
    47  $ packer
    48  usage: packer [--version] [--help] <command> [<args>]
    49  
    50  Available commands are:
    51      build       build image(s) from template
    52      fix         fixes templates from old versions of packer
    53      inspect     see components of a template
    54      push        push template files to a Packer build service
    55      validate    check that a template is valid
    56      version     Prints the Packer version
    57  ```
    58  
    59  If you get an error that `packer` could not be found, then your PATH environment
    60  variable was not setup properly. Please go back and ensure that your PATH
    61  variable contains the directory which has Packer installed.
    62  
    63  Otherwise, Packer is installed and you're ready to go!
    64  
    65  ## Alternative Installation Methods
    66  
    67  While the binary packages is the only official method of installation, there are
    68  alternatives available.
    69  
    70  ### Homebrew
    71  
    72  If you're using OS X and [Homebrew](http://brew.sh), you can install Packer by
    73  running:
    74  
    75      $ brew install packer
    76  
    77  ### Chocolatey
    78  
    79  If you're using Windows and [Chocolatey](http://chocolatey.org), you can
    80  install Packer by running:
    81  
    82      choco install packer
    83  
    84  ## Troubleshooting
    85  
    86  On some RedHat-based Linux distributions there is another tool named `packer`
    87  installed by default. You can check for this using `which -a packer`. If you get
    88  an error like this it indicates there is a name conflict.
    89  
    90      $ packer
    91      /usr/share/cracklib/pw_dict.pwd: Permission denied
    92      /usr/share/cracklib/pw_dict: Permission denied
    93  
    94  To fix this, you can create a symlink to packer that uses a different name like
    95  `packer.io`, or invoke the `packer` binary you want using its absolute path,
    96  e.g. `/usr/local/packer`.