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:| Name | Description |
|---|---|
| canton-open-source | Canton open source sandbox / JAR |
| codegen | Java and Typescript codegen |
| damlc | The Daml compiler |
| daml-new | Daml new project templates |
| daml-script | Daml scripting and testing |
| upgrade-check | Smart Contract Upgrade (SCU) checker |
| scribe | Participant Query Store |
| daml-shell | Shell to interact with the Participant Query Store |
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
Next Steps
- Deployment Progression — Environment differences and promotion checklist
- CI/CD Integration — Using environment configuration in automated pipelines