daml.yaml, environment variables, and authentication setup.
DPM Configuration
DPM is Daml’s package manager.dpm can be configured through a config file and environment variables simultaneously. Environment variables take precedence over the config file.
Config file
The config file lives at${DPM_HOME}/dpm-config.yaml:
registry— Override the default location wheredpmpulls SDKs and SDK components. Defaults toeurope-docker.pkg.dev/da-images/publicfor stable releases. Useeurope-docker.pkg.dev/da-images/public-unstablefor unstable releases.registry-auth-path— Override the default auth file for the registry.insecure— Allowdpmto pull from insecure (HTTP) registries.
Environment variables
These override the corresponding config file settings:DPM_REGISTRY— Registry location for SDK pullsDPM_REGISTRY_AUTH— Auth file for registry accessDPM_INSECURE_REGISTRY— Allow insecure registry connectionsDPM_LOG_LEVEL— Log level for commands likedpm installanddpm version(debug,info,error,warn)DAML_PACKAGE— Rundpmcommands in a package context without being in its directory (e.g.,DAML_PACKAGE=/path/to/package)DPM_SDK_VERSION— Override the SDK version globally. This overrides thesdk-versionin alldaml.yamlfiles. It does not affectdpm install.
Project Configuration
daml.yaml
Each Daml package has adaml.yaml that specifies the SDK version, package name, source location, and dependencies. The dpm build command uses this file to resolve dependencies and compile the project.
multi-package.yaml
For projects with multiple connected Daml packages,multi-package.yaml tells dpm how to find and build them:
dpm builds these packages in topological order based on their dependencies.
Environment variable interpolation
Bothdaml.yaml and multi-package.yaml support environment variable interpolation on all string fields. Use ${MY_VARIABLE} syntax:
\ prefix: \${NOT_INTERPOLATED}.
This is useful for extracting common values like SDK version and package version into .envrc files or build system variables. It also allows passing dependency DARs through environment variables, which is helpful when a build system manages DAR artifacts in a cache.
Per-Environment Settings
Each environment typically needs different values for a small set of configuration points. Here’s a pattern for managing them.LocalNet
LocalNet is self-contained. The cn-quickstart Makefile and Docker Compose configuration handle most settings:app-user, app-provider, sv).
DevNet / TestNet / MainNet
For shared networks, you configure connection details and authentication:.envrc.devnet, .envrc.testnet, .envrc.mainnet) and load the appropriate one.
Authentication Configuration
Canton validators protect the Ledger API with JWT-based authentication. Your application needs a valid token to submit commands and read transactions.LocalNet with Keycloak
The cn-quickstart LocalNet includes a pre-configured Keycloak instance. Obtain tokens through the Keycloak token endpoint:Production environments
On DevNet, TestNet, and MainNet, your validator’s auth provider issues tokens. The exact mechanism depends on your validator’s IAM setup, but the flow is the same: your application obtains a JWT and includes it in Ledger API requests as a Bearer token. For gRPC clients, set the token as a call credential. For HTTP/JSON requests, include it in theAuthorization header.
dpm Components
This functionality is available in dpm version 1.0.17 or later (or
bundled with SDK 3.5.1 or later)
dpm supports letting you be explicit about the default and optional dpm components used, and lets you specify them in a single and/or a
multi-package project instead of relying on an sdk-version bundle.
You can use default components that are traditionally part of dpm SDKs, or optional components you create and publish to extend the CLI. See Publishing Components to author your own extensions.
You can find out the available versions for components in the public da-images registry,
or by running dpm tags (see the Listing tags docs for details)
Example of using dpm tags to find the avaliable versions of damlc in the public da-images registry:
daml.yaml project file which can be used to pin default component:
multi-package.yaml which would implicitly be used by all the downstream Daml projects:
SDK components
The following components that are bundled by default can be explicitly specified:in single-package projects
The following examples show how to specify components for different usecases:- Specifying default components sourced from public da-images registry:
- Specifying a component from an external OCI registry
- Specifying a component from a local filesystem
in multi-package projects
For multi-package projects, you should specify thecomponents yaml
object in multi-package.yaml. This applies the specified components to
all packages.
daml.yaml components over the ones specified in multi-package.yaml. In the following example:
./daml-pkg-1 directory will use damlc:3.5.2 instead of the damlc:3.5.1 specified in the parent multi-package.yaml
You can optionally also specify the components field in a package’s individual daml.yaml, giving you the flexibility to have
different components for different packages in the multi-package project.
Adding and updating components via dpm add / dpm update
dpm add, dpm update, and support for oci:// components that have @sha256 or rolling tags is available in DPM version 1.0.20 or later (or
bundled with SDK 3.5.2 or later)oci:// component to your project via:
daml.yaml or multi-package.yaml for you (depending on where you run the command from):
Example configuration before running dpm add component oci://example.com/some/path/foo:latest
dpm add component oci://example.com/some/path/foo:latest
:latest), run:
daml.yaml / multi-package.yaml, as well as applying/updating SHAs, by making changes to the file and saving the file
Example configuration before running dpm update with a rolling tag specified:
dpm update:
Installation
Components specified incomponents must be installed by running
daml.yaml or multi-package.yaml
For the following example:
dpm install package in the directory containing the daml.yaml will download and save the component artifacts locally
Beginning with SDK version 3.5, the
override-components field has been
deprecated in favor of the components field.Remote Dars
Support for remote dar dependencies from an OCI repository is available in DPM version
1.0.20 or later (or
bundled with SDK 3.5.2 or later)daml.yaml:
dpm add dar command using a specified version or rolling tag (ie. my-package:latest):
daml.yaml
daml.yaml
daml.yaml’s dependencies or data-dependencies field (see the Building and Packaging docs for details on these two fields)
To know what version tags are available for a dar, see Listing tags.
To install any missing remote dars specified in your daml.yaml, you can run:
:latest) in your project via:
oci:// dars
Git Dars
Git DAR dependencies are available in dpm 1.1.0 or later. The structured mapping needs SDK 3.6 or later, because that is the first
damlc that can read a mapping in dependencies and data-dependencies. The git: one-liner works on earlier SDKs..dar stored in a public git repository. Git is another remote source, like OCI. Put the location under dependencies or data-dependencies.
A git DAR is either a one-liner or a YAML mapping. Both name a file in the repository, or a GitHub release asset.
One-liner
The canonical form is:<ref>is a branch, a tag, or a commit SHA.?path=is required, relative to the repo root, and must end in.dar.- A trailing
.giton the repo is optional. - HTTPS only. SSH clone URLs are not supported. The repository must be public.
dpm add dar:
<ref> is rewritten to a commit SHA. You can pass --dependencies instead of --data-dependencies.
Resulting daml.yaml:
?release= is supported on github.com only. Omit &asset= to expand the entry into one line per .dar on that release. On other hosts, use #<ref>?path= instead. Release lines are not rewritten to a commit SHA.
Structured mapping
The same fields can be a mapping. Pinning rewritesref and leaves the mapping in place:
dpm install:
url is the repository (host/owner/repo). An https:// prefix is accepted and dropped when dpm rewrites the entry.
For a file in the repository, set ref and path. For a GitHub release asset, set release and, optionally, asset:
asset to expand the entry into one mapping per .dar on that release. release cannot be combined with ref or path. asset requires release. Any other key under git is rejected.
main-package-id may sit beside git. It is the only other key allowed on the entry:
dpm refuses an SDK command when the package contains a structured git dependency and the SDK that command would run is older than 3.6. The version it checks is DPM_SDK_VERSION when that is set, otherwise sdk-version in daml.yaml, otherwise the version in multi-package.yaml. An empty version is refused as well. The error tells you to use a git: one-liner.dpm install, dpm install package, dpm update, and dpm resolve still fetch, pin, and resolve a structured entry on an older SDK. The check runs when dpm is about to hand daml.yaml to damlc.The check does not run when daml.yaml or multi-package.yaml selects tools with components:, or when a multi-package command is started from the project root. In those cases damlc reports the mapping itself. The check applies to structured mappings only.dpm add dar keeps the mapping and writes the new SHA into ref.
Shared repository URL
To reuse one repository URL for several DARs, name it underartifact-locations and refer to it as @alias. The alias is only the repo URL. #ref and ?path= (or ?release= and &asset=) stay on the dependency line. A location URL that already contains # or ? is rejected. After dpm install, the alias is replaced by a full git: line.
dpm add dar also accepts a browser raw/blob URL to a .dar and writes the canonical line into daml.yaml. Do not paste a browser URL into daml.yaml yourself.
dependencies vs data-dependencies.
Next Steps
- Deployment Progression — Environment differences and promotion checklist
- CI/CD Integration — Using environment configuration in automated pipelines