chef-automate is the single command-line tool used to install, configure, back up, upgrade and troubleshoot Chef Automate. Below is the full list of its subcommands, followed by the ones you will use most often, grouped by task, with runnable examples and fixes for common errors.
Usage:
chef-automate [command]
Available Commands:
airgap
applications Manage applications observability features
backup Chef Automate backup
config Chef Automate configuration
deploy Deploy Chef Automate
external-cert Manage Chef Automate's external certificate
gather-logs Gather system diagnostics and logs
help Help about any command
iam Chef Automate iam commands
info Info about Automate HA
infrastructure Chef Automate infrastructure
init-config Initialize default config
init-config-ha Initialize default config for Automate HA
internal-ca Manage Chef Automate's internal certificate authority
license Chef Automate license management
maintenance Put Chef Automate into or out of maintenance mode
migrate-from-v1 Migrate from Chef Automate v1
migrate-from-v1-status Watch the status of the migration to Chef Automate 2
preflight-check Perform preflight check
provision-infra Provision Automate HA infra.
restart-services restart deployment services
secrets Set secrets to Automate HA
service-versions Retrieve the versions of the individual Chef Automate services
ssh SSH into Automate HA servers
start Start Chef Automate
status Retrieve Chef Automate status
stop Stop deployment
system-logs Tail Chef Automate logs
test Run Automate HA smoke tests
uninstall Uninstall Chef Automate
upgrade upgrade automate to the latest version
version Show CLI version
workspace Set workspace env for Automate HA.
Code language: PHP (php)
What the chef-automate CLI manages
The listing above contains two kinds of commands. Most of them manage a standalone Chef Automate server. The rest, such as init-config-ha, provision-infra, info, ssh, test, secrets and workspace, only apply to Automate HA, where they run from a bastion host and manage a cluster of frontend and backend nodes. The exact list depends on the CLI version you have, so chef-automate --help is the authoritative reference on your own system.
| Task | Commands |
|---|---|
| Install and remove | init-config, preflight-check, deploy, uninstall |
| Check health | status, service-versions, version |
| Configure | config show, config patch, config set |
| Licensing and access | license, iam |
| Data protection | backup |
| Lifecycle | start, stop, restart-services, maintenance, upgrade, airgap |
| Troubleshooting | system-logs, gather-logs |
| Certificates and nodes | external-cert, internal-ca, infrastructure, applications |
| Legacy | migrate-from-v1, migrate-from-v1-status (Automate 1 is end-of-life) |
Note: Any command will print its own subcommands and flags if you add --help, for example chef-automate backup --help. The global --debug flag adds verbose output, which helps when a command fails without a clear message.
Download the CLI and deploy a standalone server
Chef Automate runs on a 64-bit Linux host with systemd. Run the commands as root or with sudo. Before you deploy, the preflight check makes sure the kernel settings and ports are correct.
# Download the CLI
curl https://packages.chef.io/files/current/latest/chef-automate-cli/chef-automate_linux_amd64.zip \
| gunzip - > chef-automate && chmod +x chef-automate
# Kernel settings the preflight check requires
sudo sysctl -w vm.max_map_count=262144
sudo sysctl -w vm.dirty_expire_centisecs=20000
# Check the host, then generate config.toml
sudo ./chef-automate preflight-check
sudo ./chef-automate init-config
# Deploy Automate (add --product infra-server to also install Chef Infra Server)
sudo ./chef-automate deploy config.toml --accept-terms-and-mlsaCode language: PHP (php)
init-config writes a config.toml that includes the FQDN, the TLS certificate settings and the deployment channel. Edit the fqdn before deploying if the host name is not the one users will browse to. When the deployment finishes, the admin username and password are stored in automate-credentials.toml in the current directory. Deploy also installs the CLI to /bin/chef-automate, so later commands no longer need ./.
Note: sysctl -w changes are lost on reboot. To keep them, add vm.max_map_count=262144 and vm.dirty_expire_centisecs=20000 to /etc/sysctl.conf or a file in /etc/sysctl.d/, then run sudo sysctl -p.
Check status and change configuration
chef-automate status # health of every internal service
chef-automate service-versions # package version of each service
chef-automate version # CLI and server versions
chef-automate license apply <LICENSE_STRING_OR_FILE>
chef-automate license statusCode language: PHP (php)
config show prints the current configuration. To change it, the safest command is config patch, which merges only the keys you supply. config set replaces the entire user configuration with the file you pass, so any setting left out of that file goes back to its default.
# patch.toml
[global.v1]
fqdn = "automate.example.com"Code language: PHP (php)
chef-automate config show > current-config.toml # keep a copy first
sudo chef-automate config patch patch.toml
chef-automate statusCode language: CSS (css)
Back up and restore
By default, backups go to /var/opt/chef-automate/backups. You can also set a filesystem or S3 location under [global.v1.backups] in the configuration. Each backup gets a timestamp ID.
sudo chef-automate backup create # prints the new backup ID
chef-automate backup list
chef-automate backup show <BACKUP_ID>
sudo chef-automate backup restore <BACKUP_ID>
sudo chef-automate backup delete <BACKUP_ID>Code language: HTML, XML (xml)
Restoring onto a new host needs the CLI and access to the backup directory or bucket. It also needs the /hab/svc/deployment-service/data/shared.tar bootstrap file from the original server, which holds secrets that are not stored in the backup itself. For a full walkthrough, including Chef Infra Server data, see Chef Infra Server & Chef Automate Backup and Restore.
Create API tokens and recover admin access
The iam command manages identity and access. The most common use is creating a token for knife, the data collector or a CI pipeline. Recovery is the other: if the built-in admin user is locked out, admin-access restore resets its password and policy membership.
# Token with full admin rights; the value is printed once, so store it securely
chef-automate iam token create ci-pipeline --admin
# Restore the default admin user and set a new password
sudo chef-automate iam admin-access restore 'NewStrongPassword!'Code language: PHP (php)
Note: Only use --admin tokens where you really need full access. For data collection or read-only dashboards, create a token without --admin and add it to a narrow IAM policy in the Automate UI.
Upgrades, maintenance mode and air-gapped installs
Automate can upgrade itself from its release channel. If you want to control when upgrades happen, set upgrade_strategy = "none" in config.toml and run upgrades by hand during a maintenance window. Maintenance mode makes the server return HTTP 503 to clients, so no data is written during the change.
sudo chef-automate backup create
sudo chef-automate maintenance on
sudo chef-automate upgrade run
chef-automate upgrade status
sudo chef-automate maintenance off
The listing above shows airgap without a description. Use it to build an offline installation bundle (.aib) on a machine that has internet access, copy the bundle to the isolated host, and deploy or upgrade from it there.
# On an internet-connected machine
./chef-automate airgap bundle create
# On the air-gapped host
sudo ./chef-automate deploy config.toml --airgap-bundle <BUNDLE>.aib --accept-terms-and-mlsa
sudo chef-automate upgrade run --airgap-bundle <NEW_BUNDLE>.aibCode language: PHP (php)
Troubleshooting and common errors
chef-automate system-logs # follow the Automate service journal
sudo chef-automate gather-logs # build a diagnostics tarball for support
sudo chef-automate restart-servicesCode language: PHP (php)
| Symptom | Likely cause | Fix |
|---|---|---|
Preflight fails on vm.max_map_count or vm.dirty_expire_centisecs | Kernel defaults are too low for the embedded search engine | Set them with sysctl -w and make them permanent in /etc/sysctl.d/ |
| Preflight reports a port in use | Another web server is listening on 443 or 80 | Stop or move that service, then rerun preflight-check |
| Permission or "must run as root" errors | The command was run as a normal user | Prefix the command with sudo |
status shows a service as unhealthy after a change | Bad config value or not enough memory or disk | Read system-logs, revert with config set current-config.toml, check free RAM and disk |
| Browser certificate warning | Default self-signed certificate | Add your own certificate and key under [[global.v1.frontend_tls]] and apply with config patch |
Automate HA commands at a glance
In an Automate HA deployment, you run the CLI on a bastion host. A typical flow is: init-config-ha generates the HA config (for AWS or existing infrastructure), then provision-infra creates cloud resources when you deploy on AWS, then deploy installs the cluster. After that, info shows the node addresses, ssh connects to a node, and test runs smoke tests. Run chef-automate init-config-ha --help to see which topologies your version supports. These commands do nothing useful on a standalone server.
Frequently asked questions
Where is the Chef Automate admin password after installation?
chef-automate deploy writes it to automate-credentials.toml in the directory you ran deploy from. If it is lost, reset it with sudo chef-automate iam admin-access restore <new-password>.
What is the difference between chef-automate config patch and config set?
config patch merges the keys you provide into the existing configuration. config set replaces the whole user configuration, so any setting missing from that file returns to its default.
How do I create an API token for knife or the data collector?
Run chef-automate iam token create <name>, adding --admin only if the token needs full rights. The token value is printed once, so save it in a secrets store straight away.
How do I stop Chef Automate from upgrading automatically?
Set upgrade_strategy = "none" in the deployment section of the configuration and apply it with config patch. Then run chef-automate upgrade run yourself when you choose to upgrade.
Can I use migrate-from-v1 today?
Only if you still have a Chef Automate 1 server to move to Automate 2. Automate 1 is end-of-life, so new installations never need this command.
Related tutorials
- Chef Tutorials: Chef Infra Server & Chef Automate Backup and Restore
- Chef Tutorials: knife command line reference
- What is Chef and use cases of Chef?
- More Chef tutorials
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals