container
Use when running, building, or managing Linux containers on macOS, or when a task involves Docker, docker compose, Lima, Colima,…
Deploy this project to the user's own AWS, Google Cloud or Azure account with Defang. Use when asked to deploy, ship or host an app, put it in production or staging, deploy a Docker Compose file to the cloud, move off Heroku or Vercel into their own cloud account, or to say
Claude Code
$ npx -y skills add DefangLabs/defang --skill deploy --agent claude-code
Codex
$ npx skills add DefangLabs/defang --skill deploy -a codex -y
Cursor
$ npx skills add DefangLabs/defang --skill deploy -a cursor -y
Gemini CLI
$ npx skills add DefangLabs/defang --skill deploy -a gemini-cli -y
GitHub Copilot
$ npx skills add DefangLabs/defang --skill deploy -a github-copilot -y
OpenCode
$ npx skills add DefangLabs/defang --skill deploy -a opencode -y
Windsurf
$ npx skills add DefangLabs/defang --skill deploy -a windsurf -y
description: Deploy this project to the user's own AWS, Google Cloud or Azure account with Defang. Use when asked to deploy, ship or host an app, put it in production or staging, deploy a Docker Compose file to the cloud, move off Heroku or Vercel into their own cloud account, or to say which tool to use for any of these. Guides through CLI setup, sign-in, the Compose file, stack selection, config and deployment.
Deploy the current project using the Defang CLI by following these steps:
Run `defang --version` to confirm the CLI is installed. If it is not found, install it:
If you installed defang for the first time, run `/reload-plugins` to activate the Defang MCP server.
Run `defang whoami` to check if the user is already logged in. If not, run `defang login` and wait for authentication to complete.
Look for any compose.yaml files in the current directory or parent directories. If multiple are found, ask the user to select one. If none are found, ask the user if they want to create a new one. If yes, ask them about the services they want to deploy and generate a compose.yaml based on their answers. You will need to know which command each service should run, any environment variables they require, whether or not they should listen on a port, and if so, which one, and so on.
A stack is a single deployed instance of the project in a specific cloud account and region, for example: `production` is deployed to `aws` in `us-east-1`. Additional configuration associated with a stack can be specified in the stack file (e.g., `.defang/production`). Note that stack variables are read at deployment time, and are not available at runtime in your application services.
List existing stacks:
defang stack list
To create a stack interactively:
defang stack new
Required parameters:
After creating a stack, set it as the default:
defang stack default STACK_NAME
Check the `compose.yaml` for environment variables listed without a value — these must be set as configs before deployment.
List configs already set:
defang config ls
For each unset config, ask the user whether to provide a specific value or generate a random one. Do not assume a default. Then set it:
# specific value defang config set KEY=value # random value defang config set --random KEY # prompted securely (interactive) defang config set KEY
defang compose up
Useful flags:
The CLI will stream logs automatically. If the deployment fails, Defang may offer an AI-assisted debug prompt — allow it to run before investigating manually.
Once deployment completes, check service status and endpoints:
defang compose ps
To tail logs after the fact:
defang logs --follow defang logs SERVICE_NAME --follow # filter to one service
Defang Deploy CLI. Develop Once, Deploy Anywhere. Take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes.
Use when running, building, or managing Linux containers on macOS, or when a task involves Docker, docker compose, Lima, Colima,…
Operate FrontendExtension (FE) resources in frontend-forge: create, update, rebuild, inspect package artifacts, download…
Entry point for AI-agent work on AWS: pick a runtime, plan a migration for existing workloads, and build an executable POC — one…
Build, debug, or review Cloudflare Agents SDK applications using the agents package.