Manage CLI contexts
A context stores a Coolify URL and API token under a name such as production or staging. Contexts let one CLI installation connect to Coolify Cloud and multiple self-hosted instances without repeating connection details.
The configuration file contains API tokens in plain text and is created with permissions limited to your user. Do not commit, share, or print the file.
Add a context
Create a self-hosted context with the full instance URL without /api/v1:
coolify context add production https://coolify.example.com <api-token>Add --default to make the new context the default:
coolify context add --default staging https://staging-coolify.example.com <api-token>The first context added to an otherwise empty configuration becomes the default even without --default.
For Coolify Cloud, update the preconfigured cloud context by following Authentication.
Select a context
List saved contexts and select the default used by subsequent commands:
coolify context list
coolify context use productionUse another context for one command without changing the default:
coolify --context staging app listVerify a context
coolify context verify
coolify context versioncontext verify checks the selected URL and authentication. context version prints the Coolify version returned by the selected instance.
Update a context
Change one or more saved properties:
coolify context update production --name primary
coolify context update primary --url https://new-coolify.example.com
coolify context set-token primary <replacement-api-token>Renaming a context fails when the new name already exists. The URL must start with http:// or https://.
Remove a context
coolify context delete stagingDeleting the default context makes the first remaining context the new default. Deleting a context removes only the locally saved URL and token; it does not revoke the token in Coolify. Revoke unused credentials under Keys & Tokens > API Tokens.
Configuration file location
Run coolify config to print the active path.
| Platform | Default path |
|---|---|
| Linux and macOS | ~/.config/coolify/config.json |
| Windows | %APPDATA%\coolify\config.json |
Follow Uninstall if you also want to delete all saved contexts after removing the CLI.
