CoursesChefBeginner

The tools & workstation setup

chef-client, knife, Workstation.

Intermediate12 min · lesson 2 of 12

Chef has three environments to set up. The workstation is where you author cookbooks and run commands — you install Chef Workstation, which bundles the tools: chef for generating and running, knife for talking to the server, and Test Kitchen for testing. The Chef Infra Server is the hub. Nodes run chef-client (Chef Infra Client). For learning, chef-client can run locally in “zero” mode with no server at all.

terminal
# on the workstation
$ chef --version
Chef Workstation version: 24.x
$ knife --version
Chef Infra Client: 18.x
# run a recipe locally with no server (chef-zero / local mode)
$ chef-client --local-mode --runlist 'recipe[web]'

knife: the workstation-to-server tool

knife is the multi-tool for interacting with the Chef server: upload cookbooks, manage nodes and roles, edit data bags, bootstrap new machines. Bootstrapping is how a fresh server becomes a Chef node — knife installs chef-client on it, registers it with the server, and gives it an initial run-list. Authentication is via a private key tied to your user on the server, which is the credential you protect.

terminal
$ knife cookbook upload web # push a cookbook to the server
$ knife node list # what the server knows about
$ knife bootstrap 10.0.1.5 -N web1 \
--run-list 'recipe[web]' --ssh-user deploy --sudo # register a new node
The knife/client keys are your Chef identity
knife authenticates with a private key (client.pem / your user key); anyone holding it can act as you against the Chef server — upload cookbooks that run as root on every node, edit run-lists, read data bags. Protect these keys like SSH keys, never commit them, and rotate them if exposed. The pull model’s trust flows through these credentials.