Deploy
Deploy a new version or initialize configuration
Build and deploy a new version of your application, or initialize configuration.
The deploy command handles the complete deployment lifecycle: from building Docker images to deploying them on Unkey's infrastructure. It automatically detects your Git context, builds containers, and manages the deployment process with real-time status updates.
Initialization Mode
Use --init to create a configuration template file. This generates an unkey.json file with your project settings, making future deployments simpler and more consistent across environments.
Deployment Process
- Load configuration from unkey.json or flags
- Build Docker image from your application
- Push image to container registry
- Create deployment version on Unkey platform
- Monitor deployment status until active
Command Syntax
Examples
Initialize new project configuration
Initialize with custom location
Force overwrite existing configuration
Standard deployment (uses ./unkey.json)
Deploy from specific config directory
Override workspace from config file
Deploy with custom build context
Local development (build only, no push)
Deploy pre-built image
Verbose output for debugging
Flags
--config
Directory containing unkey.json config file
- Type: string
--init
Initialize configuration file in the specified directory
- Type: boolean
- Default:
false
--force
Force overwrite existing configuration file when using --init
- Type: boolean
- Default:
false
--workspace-id
Workspace ID
- Type: string
- Environment:
UNKEY_WORKSPACE_ID
--project-id
Project ID
- Type: string
- Environment:
UNKEY_PROJECT_ID
--context
Build context path
- Type: string
--branch
Git branch
- Type: string
- Default:
"main"
--docker-image
Pre-built docker image
- Type: string
--dockerfile
Path to Dockerfile
- Type: string
- Default:
"Dockerfile"
--commit
Git commit SHA
- Type: string
--registry
Container registry
- Type: string
- Default:
"ghcr.io/unkeyed/deploy"
- Environment:
UNKEY_REGISTRY
--skip-push
Skip pushing to registry (for local testing)
- Type: boolean
- Default:
false
--verbose
Show detailed output for build and deployment operations
- Type: boolean
- Default:
false
--control-plane-url
Control plane URL
- Type: string
- Default:
"http://localhost:7091"
--auth-token
Control plane auth token
- Type: string
- Default:
"ctrl-secret-token"