Unkey

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

  1. Load configuration from unkey.json or flags
  2. Build Docker image from your application
  3. Push image to container registry
  4. Create deployment version on Unkey platform
  5. Monitor deployment status until active

Command Syntax

unkey deploy [flags]

Examples

Initialize new project configuration

unkey deploy --init

Initialize with custom location

unkey deploy --init --config=./my-project

Force overwrite existing configuration

unkey deploy --init --force

Standard deployment (uses ./unkey.json)

unkey deploy

Deploy from specific config directory

unkey deploy --config=./production

Override workspace from config file

unkey deploy --workspace-id=ws_production_123

Deploy with custom build context

unkey deploy --context=./api

Local development (build only, no push)

unkey deploy --skip-push

Deploy pre-built image

unkey deploy --docker-image=ghcr.io/user/app:v1.0.0

Verbose output for debugging

unkey deploy --verbose

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"