Where Are Chef Config Files Located?
Chef workstation knife.rb and server client.rb locations, split between home and system.
Last updated
Chef splits configuration by role. Workstation tools read knife.rb from a .chef directory in your home, holding the server URL, client name and key paths for managing infrastructure. Managed nodes read client.rb from /etc/chef instead, pointing at the same server from the other side.
That split decides every file hunt. Human problems live in home, node problems live in /etc, and the server URL must agree in both. Keys deserve credential handling throughout: validator and client keys authenticate real infrastructure changes, not just preferences.
Where Chef stores this, by platform
~/.chef/knife.rb
Headline file is knife.rb with server URL and key paths. Managed nodes use /etc/chef/client.rb instead. Keep keys out of version control and copy the directory with no chef commands running.
Frequently asked questions
how do i move chef workstation config to a new pc
Copy ~/.chef to the new machine's home folder, including knife.rb and the validator and client keys. Re register the node with the Chef server afterwards if key formats changed between major versions.
knife.rb versus client.rb, which is which
No. knife.rb in ~/.chef configures your workstation for talking to the server, while client.rb in /etc/chef configures each managed node for checking in. One is per human, the other per machine, and mixing them up breaks both sides.
Notice an outdated path? Let us know.