> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canton.network/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# Canton Docker Operations

> Obtain and run Canton Docker images

## Obtaining the Docker Images

(See [Install With Docker](#work-with-the-docker-containers) for instructions on running the Canton Docker images.)

You can download the Canton docker images using:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
docker pull \
    europe-docker.pkg.dev/da-images/public/docker/canton-base:3.5.19
docker pull \
    europe-docker.pkg.dev/da-images/public/docker/canton-participant:3.5.19
docker pull \
    europe-docker.pkg.dev/da-images/public/docker/canton-sequencer:3.5.19
docker pull \
    europe-docker.pkg.dev/da-images/public/docker/canton-mediator:3.5.19
```

Download Canton docker images by network:

> [tab] DevNet
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-base:devnet
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-participant:devnet
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-sequencer:devnet
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-mediator:devnet
> ```

> [tab] TestNet
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-base:testnet
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-participant:testnet
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-sequencer:testnet
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-mediator:testnet
> ```

> [tab] MainNet
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-base:mainnet
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-participant:mainnet
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-sequencer:mainnet
> docker pull \
>     europe-docker.pkg.dev/da-images/public/docker/canton-mediator:mainnet
> ```

Visit `https://europe-docker.pkg.dev/v2/da-images/public/docker/canton-participant/tags/list` to see available tags.

These docker images are published starting with Canton version 3.4.8.

Snapshot releases are available at `/da-images/public-unstable/docker/` instead of `/da-images/public/docker/`, but they are not recommended for any production usage and they are periodically cleaned up.

## Work With the Docker Containers

### Using the Participant Image

As a convenience, we provide a pre-configured participant image that can be used to start a Canton participant with sensible defaults.

Using this image requires setting several environment variables:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
docker run \
    -e AUTH_TARGET_AUDIENCE="audience" \
    -e AUTH_JWKS_URL="fake.com/jwks" \
    -e CANTON_PARTICIPANT_POSTGRES_SERVER="canton-postgres" \
    -e CANTON_PARTICIPANT_POSTGRES_PORT="5432" \
    -v "$(pwd)/bootstrap.sc:/app/bootstrap.sc" \
    --rm -it \
    europe-docker.pkg.dev/da-images/public/docker/canton-participant:mainnet
```

Note that you'll need a valid postgres instance.

This image requires you to initialize the participant via a bootstrap script. See [Manual identity initialization](https://docs.canton.network/global-synchronizer/deployment/identity-management.md#initializing-node-identity-manually) for more details.

To see all configuration defaults and possible env vars, run

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cid=$(docker create europe-docker.pkg.dev/da-images/public/docker/canton-participant:mainnet) && docker cp "$cid":/app/app.conf ./app.conf && docker rm "$cid"
cat app.conf
```

### Logging

Logs are JSON encoded and sent to stdout. The log level is set via `-e LOG_LEVEL_STDOUT=INFO`. It defaults to DEBUG.

### Bound Ports

`canton-participant` image binds:

* Ledger API port: 5001
* Admin API port: 5002
* HTTP Ledger API port: 7575
* GRPC Health Server port: 5061

`canton-mediator` image binds:

* Admin API port: 5007
* GRPC Health Server port: 5061

`canton-sequencer` image binds:

* Public API: 5008
* Admin API: 5009
* GRPC Health Server port: 5061

### Supplying custom configuration and DARs

To supply custom configuration, either

1. add it via `ADDITIONAL_CONFIG` environment variable, or
2. mount `/app/additional-config.conf` into the container.

Dars must be added dynamically. This is done via remote console or the admin API.

To run a participant console with custom configuration:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
docker run -e ADDITIONAL_CONFIG="canton.participants.participant {
      storage.type = memory
      admin-api.port = 5012
      ledger-api.port = 5011
      http-ledger-api.server.port = 5013
    }" \
    -e AUTH_TARGET_AUDIENCE="audience" \
    -e AUTH_JWKS_URL="fake.com/jwks" \
    --rm -it \
    europe-docker.pkg.dev/da-images/public/docker/canton-participant:mainnet \
    --console
```

The `--console` flag starts canton in interactive console mode.
