2013-06-08 16:47:59 -04:00
|
|
|
---
|
|
|
|
layout: "docs"
|
2013-06-25 15:14:45 -04:00
|
|
|
page_title: "Install Packer"
|
2013-06-08 16:47:59 -04:00
|
|
|
---
|
|
|
|
|
2013-06-25 15:14:45 -04:00
|
|
|
# Install Packer
|
2013-06-08 16:47:59 -04:00
|
|
|
|
2013-06-25 15:14:45 -04:00
|
|
|
Packer must first be installed on the machine you want to run it on.
|
2013-06-25 15:16:49 -04:00
|
|
|
To make installation easy, Packer is distributed as a [binary package](/downloads.html)
|
2013-06-25 15:14:45 -04:00
|
|
|
for all supported platforms and architectures. This page will not cover how
|
|
|
|
to compile Packer from source, as that is covered in the
|
|
|
|
[README](https://github.com/mitchellh/packer/blob/master/README.md) and is only
|
|
|
|
recommended for advanced users.
|
|
|
|
|
|
|
|
## Installing Packer
|
|
|
|
|
2013-06-25 15:16:49 -04:00
|
|
|
To install packer, first find the [appropriate package](/downloads.html)
|
2013-06-25 15:14:45 -04:00
|
|
|
for your system and download it. Packer is packaged as a "zip" file.
|
|
|
|
|
|
|
|
Next, unzip the downloaded package into a directory where Packer will be
|
|
|
|
installed. On Unix systems, `~/packer` or `/usr/local/packer` is generally good,
|
|
|
|
depending on whether you want to restrict the install to just your user
|
2013-07-03 05:55:25 -04:00
|
|
|
or install it system-wide. On Windows systems, you can put it wherever you'd
|
2013-06-25 15:14:45 -04:00
|
|
|
like.
|
|
|
|
|
|
|
|
After unzipping the package, the directory should contain a set of binary
|
|
|
|
programs, such as `packer`, `packer-build-amazon-ebs`, etc. The final step
|
|
|
|
to installation is to make sure the directory you installed Packer to
|
|
|
|
is on the PATH. See [this page](http://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux)
|
|
|
|
for instructions on setting the PATH on Linux and Mac.
|
|
|
|
[This page](http://stackoverflow.com/questions/1618280/where-can-i-set-path-to-make-exe-on-windows)
|
|
|
|
contains instructions for setting the PATH on Windows.
|
|
|
|
|
|
|
|
## Verifying the Installation
|
|
|
|
|
|
|
|
After installing Packer, verify the installation worked by opening
|
|
|
|
a new command prompt or console, and checking that `packer` is available:
|
|
|
|
|
2014-10-20 13:55:16 -04:00
|
|
|
```text
|
2013-06-25 15:14:45 -04:00
|
|
|
$ packer
|
|
|
|
usage: packer [--version] [--help] <command> [<args>]
|
|
|
|
|
|
|
|
Available commands are:
|
|
|
|
build build image(s) from template
|
2014-10-20 13:55:16 -04:00
|
|
|
fix fixes templates from old versions of packer
|
2013-10-01 21:45:11 -04:00
|
|
|
inspect see components of a template
|
2013-06-25 15:14:45 -04:00
|
|
|
validate check that a template is valid
|
|
|
|
```
|
|
|
|
|
|
|
|
If you get an error that `packer` could not be found, then your PATH
|
|
|
|
environmental variable was not setup properly. Please go back and ensure
|
2013-06-30 16:22:32 -04:00
|
|
|
that your PATH variable contains the directory which has Packer installed.
|
2013-06-25 15:14:45 -04:00
|
|
|
|
|
|
|
Otherwise, Packer is installed and you're ready to go!
|
2013-08-03 19:44:30 -04:00
|
|
|
|
|
|
|
## Alternative Installation Methods
|
|
|
|
|
2013-08-07 18:32:09 -04:00
|
|
|
Installation from binary packages is currently the only officially supported
|
|
|
|
installation method. The binary packages are guaranteed to be the latest
|
|
|
|
available version and match the proper checksums. However, in addition to
|
|
|
|
the official binaries, there are other unofficial 3rd party methods of
|
|
|
|
installation managed by the Packer community:
|
2013-08-03 19:44:30 -04:00
|
|
|
|
|
|
|
### Homebrew
|
|
|
|
|
|
|
|
If you're using OS X and [Homebrew](http://brew.sh), you can install Packer by
|
2013-08-07 18:32:09 -04:00
|
|
|
adding the `binary` tap. Remember that this is updated by a 3rd party, so
|
|
|
|
it may not be the latest available version.
|
2013-08-03 19:44:30 -04:00
|
|
|
|
2014-10-20 13:55:16 -04:00
|
|
|
```text
|
2013-08-03 19:44:30 -04:00
|
|
|
$ brew tap homebrew/binary
|
|
|
|
$ brew install packer
|
|
|
|
```
|