Installing Chef Habitat

Below you'll find installation instructions for each platform and their requirements. The Chef Habitat CLI is currently supported on Linux, Mac, and Windows.

Download and Install the Chef Habitat CLI Tool

From building packages to running services, everything in Chef Habitat is done through the hab command-line interface (CLI) tool. To get started using Chef Habitat, you need to download and install the hab CLI tool that corresponds to your workstation OS.

Chef Habitat for Linux

Chef Habitat for Linux requires a 64-bit processor with kernel 2.6.32 or later. On Linux, exporting your Chef Habitat artifact to a Docker image requires the Docker Engine supplied by Docker. Packages from distribution-specific or otherwise alternative providers are currently not supported.

Once you have downloaded the package, extract the hab binary with tar to /usr/local/bin or add its location to your PATH (e.g. tar -xvzf hab.tgz -C /usr/local/bin --strip-components 1).

Download Chef Habitat for Linux

Install Chef Habitat from the Command Line

Alternatively, you can install Chef Habitat via the command line by downloading and running the installation script:

curl | sudo bash

Install Chef Habitat for Linux Kernel 2.x from the Command Line

Please note that support for Linux Kernel 2.x is limited. Not all core plans are available for Kernel 2.x, nor are there plans to backport all of the existing core plans to Kernel 2.x. Kernel 2.x is legacy technology by definition, and its use should be viewed as a stop-gap to provide interim solutions for old systems, as they are upgraded to more recent versions of the Linux kernel.
curl | sudo bash -s -- -t x86_64-linux-kernel2

Chef Habitat for Mac

Requires 64-bit processor running 10.9 or later

Once you have downloaded the hab CLI, unzip it onto your machine. Unzipping to /usr/local/bin should place it on your PATH. In order to use the Chef Habitat Studio, you'll also need to install Docker for Mac.

Download Chef Habitat for MacDownload Docker for Mac

Install Chef Habitat Using Homebrew

Chef Habitat can also be installed with Homebrew, by running the following commands:

$ brew tap habitat-sh/habitat
$ brew install hab

Chef Habitat for Windows

Minimum Windows version supported: Windows Server 2008 R2 or Windows 7 64-bit

Chocolatey is a package manager for Windows. You can use it to easily install, configure, upgrade, and even uninstall Windows software packages. We recommend using Chocolatey for installing Chef Habitat.

Install Chef Habitat with Chocolatey, by running the following command:

$ choco install habitat

Install Chef Habitat using a Powershell install script

Alternatively, you can install Chef Habitat by downloading and running the installation script:

$ Set-ExecutionPolicy Bypass -Scope Process -Force
$ iex ((New-Object System.Net.WebClient).DownloadString(''))

Installing Habitat for Windows using the dowloaded Chef Habitat package.

Downloaded the hab CLI, unzip it onto your machine. We suggest unzipping to C:\habitat, so that the full path to Chef Habitat is similar to C:\habitat\hab-0.79.1-20190410221450-x86_64-windows. If you've downloaded a more recent version of Chef Habitat, you'll see a different set of numbers following hab-. Replace the package name used in these examples with the filename you see on your computer. Next, add that folder to your PATH variable so your computer will know where to find it. Here’s how to do that with Powershell:

$ $env:PATH += ";C:\habitat\hab-0.79.1-20190410221450-x86_64-windows\"

To use a Docker Chef Habitat Studio as an isolated environment, you'll also need to install Docker for Windows.

Docker for Windows requires 64-bit Windows 10 Pro, Enterprise, or Education editions (1607 Anniversary Update, Build 14393 or later) with Hyper-V enabled
Download Chef Habitat for WindowsDownload Docker for Windows

Accept the License

Please visit the license acceptance page on the Chef docs site for more information.

Configure Your Workstation

Once Chef Habitat has been installed, the hab CLI makes it easy to get your workstation configured by guiding through the setup process. To set up your workstation, run hab cli setup and follow the instructions.

screenshot of hab cli setup output in CLI

Setup asks you to create a new origin and a set of origin keys.

Optionally, you can also provide a Chef Habitat personal access token to upload packages to the public depot and share them with the Chef Habitat community. See the access token documentation for details on generating and using your access token.

For more information about using Chef Habitat Builder, see the section on Using Builder.

You will also be asked if you want to register Supervisor control gateway secret (see Remote Command-and-Control of Supervisors for further details).

During setup, you may elect to provide anonymous usage data of the hab CLI tool. This information is used by the Chef Habitat team to improve the CLI experience. For information on the types of data we gather and how we intend to use it, see Analytics in Chef Habitat.

You can change your settings at any time by re-running the hab cli setup command.

screenshot of completed hab cli setup in CLI

That's it. You're all set up and ready to use Chef Habitat to build and run packages!

Download and Install FAQ

This section tracks some questions that are frequently encountered when downloading and installing the hab binary.

Q: Can I just download a GitHub release of Chef Habitat?

A: While we do cut releases in GitHub as part of our release process those archives are going to be a .tar point in time of our source code. As the hab cli is written in Rust, if you follow this approach you'll need to compile the source for your platform.

Q: Compile for my platform? Does that mean there aren't any OS native packages of hab?

A: We publish compiled packages for OSX, Linux, and Windows. hab has a requirement of either a Linux kernel >= 2.6.32, OSX >= 10.9, or 64-bit Windows 10 Pro, Enterprise, or Education editions (1511 November update, build 10586 or later) with Hyper-V enabled.

Q: What if I need an old version of hab?

A: We've got you covered! The script we provide for doing curl-bash installations will allow you to specify a -v flag to pull down a specific version of Chef Habitat, eg:

curl \
| sudo bash -s -- -v 0.56.0

Q: Oh! A curl bash I (love||hate) those.

A: Indeed they are divisive, we know, that's why we provide a few different ways for you to download. If you'd like to take a look at the script before running it, you can find it in the core Chef Habitat repo.

If you're staunchly in the anti-curl-bash camp, you can get the latest packages from the download links listed previously.

Q: How do I install hab across my server fleet?

A: For the most part, we leave that up to you. You could just use the aforementioned curl-bash with your provisioner of choice. If your app was dockerized with Chef Habitat then you won't even need to ask this question, because you'll have everything you need inside your container. We are working on first class Mesosphere DC/OS, Cloud Foundry, and Kubernetes integrations - which you can keep up to date on in our best practices section and blog.