What is Packer?
Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace Configuration Management (CM) like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image.
Install Packer
To install Packer on your Windows, Mac, or Linux operating system, the recommended method is to download and extract the executable binary. This method is regarded as a best practice, no matter which operating system you are using. After installing Packer, it is important to verify the version to ensure that the installation was successful. Since Packer is simply an executable binary, confirming the installation by checking the installed version is essential. For a detailed and comprehensive guide, we recommend referring to the official Packer documentation.
Windows
You can use the following commands to install Packer in the Windows operating system.
# Download Packer.
$ curl -LO https://releases.hashicorp.com/packer/1.15.0/packer_1.15.0_windows_amd64.zip --output-dir /tmp
# Extract Packer from archive.
$ unzip /tmp/packer_1.15.0_windows_amd64.zip -d /tmp
# Install Packer.
$ mv /tmp/packer.exe /usr/bin
# Check Packer version.
$ packer --version
Mac
You can use the following commands to install Packer in the Mac operating system.
AMD64 / X86-64 / X64
# Download Packer.
$ wget https://releases.hashicorp.com/packer/1.15.0/packer_1.15.0_darwin_amd64.zip -P /tmp
# Extract Packer from archive.
$ unzip /tmp/packer_1.15.0_darwin_amd64.zip -d /tmp
# Install Packer.
$ sudo mv /tmp/packer /usr/local/bin
# Check Packer version.
$ packer --version
ARM64
# Download Packer.
$ wget https://releases.hashicorp.com/packer/1.15.0/packer_1.15.0_darwin_arm64.zip -P /tmp
# Extract Packer from archive.
$ unzip /tmp/packer_1.15.0_darwin_arm64.zip -d /tmp
# Install Packer.
$ sudo mv /tmp/packer /usr/local/bin
# Check Packer version.
$ packer --version
Linux
You can use the following commands to install Packer in any Linux-based operating system.
AMD64 / X86-64 / X64
# Download Packer.
$ wget https://releases.hashicorp.com/packer/1.15.0/packer_1.15.0_linux_amd64.zip -P /tmp
# Extract Packer from archive.
$ unzip /tmp/packer_1.15.0_linux_amd64.zip -d /tmp
# Install Packer.
$ sudo mv /tmp/packer /usr/local/bin
# Check Packer version.
$ packer --version
ARM64
# Download Packer.
$ wget https://releases.hashicorp.com/packer/1.15.0/packer_1.15.0_linux_arm64.zip -P /tmp
# Extract Packer from archive.
$ unzip /tmp/packer_1.15.0_linux_arm64.zip -d /tmp
# Install Packer.
$ sudo mv /tmp/packer /usr/local/bin
# Check Packer version.
$ packer --version