Agent · CLI

CLI reference

Commands you run on the host. For flags on your installed binary, fleet --help is always current.

Typical flow: install → fleet register → sudo fleet start. See install and lifecycle.

Setup

Link this host to your Fleet workspace.

fleet register <registration-token>

Register this host with Fleet

Links the machine to your workspace using the token from the dashboard. Does not start the agent — run fleet start after.

  • -f, --force — Replace an existing registration without asking
example
fleet register <your-token>

sudo fleet deregister

sudo

Remove this agent from Fleet

Stops the agent on this host and removes it from your workspace. Local registration is cleared so you can register again later.

  • -f, --force — Skip the confirmation prompt
example
sudo fleet deregister

Lifecycle

Start, stop, and restart the agent.

sudo fleet start

sudo

Start the agent

Starts the agent and keeps it running across reboots. Use this after register on a normal Linux host.

example
sudo fleet start

sudo fleet stop

sudo

Stop the agent

Stops the agent on this host. It stays stopped until you start it again.

example
sudo fleet stop

sudo fleet restart

sudo

Restart the agent

Stops then starts the agent. Useful after an upgrade.

example
sudo fleet restart

Inspect

Check status, logs, and local info.

fleet status

Show whether the agent is running

Prints running state and basic health for this host.

example
fleet status

fleet logs [-f]

Show agent logs

Prints recent agent logs. Use -f to follow live output. Requires the agent to have been started once.

  • -f, --follow — Stream new log lines as they appear
example
fleet logs
fleet logs -f

fleet info

Show agent and path info

Prints version, whether the agent looks connected, and where Fleet stores data on this host.

example
fleet info

fleet version

Print the agent version

Shows the version of the installed fleet binary.

example
fleet version

Advanced

Occasional maintenance.

fleet gc

Clean up old deploy files

Frees disk space from old deploy leftovers on this host. Safe to run when the agent is running and disk is getting full.

example
fleet gc
Fleet docs