1---
2title: Setup
3description: Point alchemy at a Docker daemon — the active CLI context and the DOCKER_BIN override.
4---
5
6Register the provider in your stack:
7
8```typescript
9// alchemy.run.ts
10import * as Docker from "alchemy/Docker";
11
12providers: Docker.providers(),
13state: Alchemy.localState(),
14```
15
16That's the whole registration. When Docker runs alongside a cloud
17provider, merge the layers:
18`providers: Layer.merge(Cloudflare.providers(), Docker.providers())`.
19
20## Prerequisites
21
22A Docker daemon reachable from the `docker` CLI is the only
23requirement. The provider shells out through the **active Docker CLI
24context**, so whatever `docker ps` talks to — Docker Desktop, a
25remote Docker host, an SSH context, a CI runner's daemon — is what
26alchemy provisions against. There is no login step and no
27stored token: this provider has no credentials of its own.
28
29## Binary override
30
31```sh
32DOCKER_BIN=/opt/homebrew/bin/docker bun alchemy deploy
33```
34
35The provider resolves the Docker binary from the `DOCKER_BIN`
36environment variable, falling back to `docker` on the `PATH`.
37
38## Registry credentials
39
40Registry auth is a per-resource prop, not global configuration.
41[`Image`](/providers/docker/image) and
42[`RemoteImage`](/providers/docker/remoteimage) accept a `registry`
43with `{ server, username, password }`, where `password` is a
44`Redacted` value:
45
46```typescript
47const image = yield* Docker.Image("app", {
48 name: "my-app",
49 build: { context: "./app" },
50 registry: {
51 server: "ghcr.io",
52 username: "octocat",
53 password: Config.Redacted("GITHUB_TOKEN"),
54 },
55});
56```
57
58Push deliberately skips `docker login`: the credentials are written
59into an isolated `DOCKER_CONFIG` that only the push command reads, so
60your global docker config, buildx builders, and `docker context`
61setup stay intact.
62
63## Next steps
64
65- [Docker overview](/docker) — resources and compositions.
66- [Run local services](/docker/local-services) — Postgres with a
67 network, volume, and healthcheck.
68- [Build and push an image](/docker/build-and-push) — Dockerfile
69 builds and registry push.