-
If
imagein your Wrangler config is a path to a Dockerfile, start Docker ↗ or another Docker-compatible engine. Specify the Dockerfile itself, not its directory. Ifimageis a registry reference (Cloudflare Registry, Docker Hub, Amazon ECR, or Google Artifact Registry), you do not need Docker at deploy time. Refer to Image management. -
From your project directory, run:
npx wrangler deployyarn wrangler deploypnpm wrangler deploy -
Wait for the command to finish.
wrangler deploy uploads and activates your Worker before it processes the container configuration. For a Dockerfile image, Wrangler then builds and pushes the image when needed. For a registry image, it uses the configured image reference. These steps are not transactional: an image build, image push, or rollout error can happen after the new Worker is already live.
For an existing container application, Wrangler starts a rollout when the effective container configuration changes. The command does not wait for every container instance to be replaced, so new Worker code may briefly talk to containers that still run the previous image. The first deploy creates the container application directly, and a deploy with no effective container changes starts no rollout.
For rollout flags and step configuration, refer to Rollouts.
Workers Builds runs the build and deploy commands you configure for the Worker that is connected to your Git repository.
| Git branch | Default deploy command | Containers |
|---|---|---|
| Production branch | npx wrangler deploy |
Publishes the image when needed and rolls out container instances. Dockerfile builds can run in the Workers Builds environment. |
| Other branches (if non-production branch builds are enabled) | npx wrangler versions upload |
Uploads Worker code only. Does not publish a new image or roll out container instances. |
-
In the Cloudflare dashboard, go to Workers & Pages, open the Worker you want to deploy, then go to Settings > Builds.
Go to Workers & Pages ↗ -
Set Deploy command to
npx wrangler deploy, or to a package script that runs a full deploy. -
Keep your Wrangler config and Dockerfile or image reference under the Workers Builds root directory.
-
Push to your production branch.
-
Confirm the build succeeds, then check the deploy.
To connect a repository, refer to Workers Builds.
wrangler deploypublishes container images (when needed) and rolls out container instances for the Worker you deploy.wrangler versions upload(the default non-production branch deploy command in Workers Builds) uploads a new Worker version only. It does not publish a new image or roll out container instances.- Preview URLs are not generated for Workers that implement Durable Objects, which includes Containers Workers. A successful non-production Workers Builds run still creates a Worker version, but not a full-app preview URL.
| Goal | What to do |
|---|---|
| Change Worker and container together on your machine | Local development with wrangler dev |
| Share a deployed environment with its own image and container instances | A Wrangler environment or a separate Worker, each connected to Workers Builds with a full deploy command such as npx wrangler deploy --env staging. Refer to Workers Builds and Wrangler environments. |
| Update production | Merge to the production branch (or run wrangler deploy locally) |
After wrangler deploy or a production Workers Builds deploy:
-
Confirm the new Worker deployment is active in the dashboard.
-
Send a request that must reach the container and confirm the behavior you expect.
-
Optionally run
Go to Containers ↗npx wrangler containers listandnpx wrangler containers images list, or open the Containers dashboard:
For gradual steps, grace periods, and rollout modes, refer to Rollouts.
| Problem | What to do |
|---|---|
| Non-production Workers Builds run succeeds but you cannot fully preview the app | Use local development or a staging Worker or environment with wrangler deploy. Refer to Before production. |
| Deploy or Workers Builds run succeeds but container instances look unchanged | A gradual rollout may still be running, or the command did not update containers (versions upload or --containers-rollout=none). Refer to Rollouts. |
| Deploy fails because Docker is missing | Required only when image is a Dockerfile path. Start Docker, use Workers Builds, switch to a registry image, or use --containers-rollout=none for a Worker-only deploy. |
| First deploy: Worker works, container routes error | Wait several minutes for provisioning, then check logs. |