This is the abridged developer documentation for Distr
# What is Distr?
> Distr is an open source software distribution platform. Software vendors use it to distribute, deploy and manage their software in self-managed, BYOC, air-gapped and edge environments, with visibility and control for both the vendor and the end customer.
Distr is an open source software distribution platform. Software and AI companies use it to get their applications and artifacts into environments their customers control. It covers [self-managed](/docs/use-cases/fully-self-managed/), [BYOC](/docs/use-cases/byoc-bring-your-own-cloud/), [air-gapped](/docs/use-cases/air-gapped-deployments/) and [edge](/docs/use-cases/edge-deployments/) deployments. Throughout the application lifecycle, vendors can see which version runs where, whether it is healthy and who downloaded which artifact. ## Why is Distr needed? Most software runs in a single cloud environment that the vendor controls, next to the vendor’s own container registry, deployment pipelines and observability tools. The vendor can reach every part of that stack and troubleshoot a problem while it is happening. Once a customer wants to run the application in their own environment, that tooling no longer reaches it, and shipping updates, keeping the application stable and debugging it all get harder. Distr brings that tooling to self-managed environments, with a small footprint in the customer’s infrastructure. ## Architecture  ## Distr in short | Feature | Description | | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Distribution models | Fully self-managed, assisted self-managed, BYOC, air-gapped and edge deployments. | | Works with your tools | Integrates with Docker, Helm, [OpenTofu and Terraform](/docs/controllers/infrastructure-controllers/), any OCI-compliant tool and [GitHub Actions](/docs/integrations/gh-action/). | | Built for enterprise security | Air-gapped installations and [token-based](/docs/integrations/personal-access-token/) access to the private registry. | | Package formats | Docker Compose files, Helm charts and any other OCI artifact. | | Visibility across customers | Deployment status, versions and health of every customer environment in one place. | | Hosting options | Use Distr as a managed SaaS or [host it yourself](/docs/self-hosting/). | | Two portals | A Vendor Portal for your team and a [white-labeled](/docs/platform/branding/) Customer Portal for your customers. | ## Who is Distr for? * Software vendors that distribute applications and artifacts to environments their customers control * AI companies that deploy AI components in different deployment scenarios * Enterprise platform teams that distribute software internally * Operations teams that need to see what is deployed where Vendors such as [Ozgar AI](/case-studies/ozgar-ai/), [Weave](/case-studies/weave/) and [Basedash](/case-studies/basedash/) run their self-hosted offerings on Distr in production. More stories are collected in the [case studies](/case-studies/). ## What can I do with Distr? With Distr you can: * Distribute software to any environment, from a customer’s cloud account to an air-gapped network * Manage deployments, both those you operate and those your customers operate, and see all of them in one place * Restrict licenses to specific application versions and control access to individual artifacts by tag * Track the health of your deployments and the download counts of your applications and artifacts per customer * Brand the Customer Portal as your own and onboard customers quickly ## Where do I start? The [quickstart guide](/docs/quickstart/) walks you through your first tutorials. If you are comparing Distr with another distribution platform, see [Distr vs Replicated](/compare/replicated/) and [Distr vs Nuon](/compare/nuon/).
# Core Concepts
> Distr's core concepts, including the distribution models it supports, the vendor and customer portals, the artifact registry, deployment controllers, and extensibility through the Distr REST API and SDK.
Distr is built around a few concepts that work together to enable flexible software distribution. Understanding them will help you get the most out of the platform. ## Distribution Scenarios Distr supports five distinct deployment models to meet different customer requirements: * **[Fully Self-Managed](/docs/use-cases/fully-self-managed/)**: For customers who maintain complete control over their infrastructure, the Distr [Artifact Registry](/glossary/oci-container-artifact-registry/) for artifact distribution is the main feature used. * **[Assisted Self-Managed](/docs/use-cases/assisted-self-managed/)**: End customers retain full control over their environment access but delegate application deployment to [Distr controllers](/docs/controllers/), which simplify initial installation, updates, and ongoing maintenance. * **[Bring Your Own Cloud (BYOC)](/docs/use-cases/byoc-bring-your-own-cloud/)**: Fully vendor-managed deployments within customer-owned environments. Ideal for end customers who want to offload infrastructure and software maintenance to the vendor while keeping deployments within their own environment, for compliance, cost management or use of pre-contracted cloud resources. [Infrastructure controllers](/docs/controllers/infrastructure-controllers/) provision the customer’s cloud infrastructure, and the deployment controllers run your application on it. * **[Air-Gapped Environments](/glossary/air-gapped-meaning/)**: For high-security scenarios with physical or logical network isolation, offering secure artifact delivery through whitelisted connections, jump servers or physical media. * **[Edge Deployments](/docs/use-cases/edge-deployments/)**: For vendor-managed deployments to edge locations, IoT devices, or remote hardware. ## Key Components ### Vendor Portal The [Vendor Portal](/docs/vendor-portal/) is the central UI of Distr. It’s where vendors manage customers, users, applications, and where you’ll find the Artifacts Registry UI. The portal includes monitoring and observability features, integrates with your CI/CD pipelines, and lets you customize the customer portal. ### Customer Portal The [Customer Portal](/docs/platform/customer-portal/) is a simplified, white-labeled UI built for end customers. It gives them control over deployments and access to the registry UI. ### Distr Registry [Distr Registry](/docs/registry/) is an [OCI-compliant artifact registry](/glossary/oci-container-artifact-registry/) that stores Docker images, [Helm charts](/glossary/helm-chart/), and other OCI artifacts. It tracks artifact usage across customer environments and provides end customers with a private registry containing only the artifacts they’re licensed to use. Unlike other artifact registries, Distr’s includes a [UI](/docs/registry/) available in both the vendor and customer portals, making it easy to browse artifacts and inspect versions. ### Distr Controllers [Distr Controllers](/docs/controllers/) are lightweight deployment controllers that run in the customer’s target environment. They pull configurations from Distr, execute deployment operations locally, and report status back to the vendor and customer portal. [Infrastructure controllers](/docs/controllers/infrastructure-controllers/) such as the OpenTofu controller are deployed by them like any other application and provision cloud infrastructure from an OpenTofu or Terraform configuration. ### Distr License Management [Distr License Management](/docs/platform/license-management/) gives you fine-grained control over what your customers can access and use. Application Entitlements control which application versions customers can deploy via controllers. Artifact Entitlements control registry access. License Keys let you issue signed JWT tokens your application can verify to enforce usage limits, seat counts, and feature flags, with no runtime dependency on Distr. ## API and Extensibility Distr provides programmatic access through: * **REST API**: For integration with external systems * **SDK**: For embedding Distr functionality in other applications The [API](/docs/integrations/api/) and [SDK](/docs/integrations/sdk/) use the same underlying systems as the web interface, ensuring consistent behavior regardless of access method.
# Quickstart
> Complete three interactive tutorials to set up your registry, deploy your first application, and onboard your first customer.
## Getting Started with Platform Tutorials The fastest way to learn how to use Distr is through the interactive tutorials available directly on the platform. When you first create an account, you’ll have access to three guided tutorials that cover the core capabilities:  ### 1. Artifact Registry This tutorial walks you through setting up your organization’s [registry](/docs/registry/) slug, creating a personal access token and logging in, pushing and pulling artifacts from your own private artifact registry. ### 2. Controllers, Applications and Deployments Tutorial In this tutorial, you’ll learn how to download and install a [Distr controller](/docs/controllers/), deploy a sample hello-distr application, verify and monitor deployment statuses, and automate future releases. ### 3. Invite Your First Customer Tutorial This tutorial guides you through setting up your [Customer Portal](/docs/platform/customer-portal/) and inviting a customer. You’ll learn how to customize the portal name and the getting started instructions, send the customer invite email, and preview the portal from the end customer’s perspective. ## Accessing the Tutorials To access these tutorials: 1. Create your **free** [Distr account](https://app.distr.sh/login) 2. Navigate to the Dashboard 3. Go to the Tutorials section 4. We recommend completing the tutorials in order for the best learning experience ## After Completing Tutorials Upon completion, you’ll be ready to: 1. **Create Your Own Applications:** Add your [Docker Compose or Helm chart-based applications](/docs/controllers/application/) to Distr 2. **Push Your Artifacts:** Store your artifacts in your private [registry](/docs/registry/) 3. **Invite Customers:** Invite new [customers](/docs/platform/rbac/#inviting-customer-organization-users) into your organization ### Next, explore the Use cases section Visit the [Use cases](/docs/use-cases/fully-self-managed/) section to identify the scenario that best fits your end customers and begin implementing the most appropriate deployment model for them.
# Deployment Controllers
> Overview of Distr deployment controllers: what they are, how they work, and how to manage them from the Vendor Portal.
Deployment controllers run inside customer environments alongside vendor applications. They connect Distr to deployment targets and manage the full deployment lifecycle while requiring minimal access to customer infrastructure. Distr provides two deployment controllers: * **[Docker Controller](/docs/controllers/docker-controller/)**: manages Docker Compose deployments on any Linux host. Handles updates, environment variables, container health, and supports Docker Swarm mode. * **[Kubernetes Controller](/docs/controllers/kubernetes-controller/)**: manages Helm chart deployments in Kubernetes clusters. Supports cluster- and namespace-scoped permissions, value overrides, and migration of existing releases. For [BYOC](/docs/use-cases/byoc-bring-your-own-cloud/) and other Terraform use cases, the [infrastructure controllers](/docs/controllers/infrastructure-controllers/) provision the infrastructure your application runs on. They are not a third deployment target type: you release one as a regular Distr application, and the Docker or Kubernetes controller deploys it. ## Controller Section in the Vendor Portal The Controllers section of the Vendor Portal has two parts. ### Applications  The Applications section is where you define your software offerings: Docker Compose files or Helm charts, environment variable templates, and application versions. This is the foundation for all deployments. * [Create an Application](/docs/controllers/application/): set up Docker and Helm applications * [Create a Deployment](/docs/controllers/deployment/): deploy applications to customer environments ### Deployments  The Deployments section is the central health and management dashboard for all deployment targets. Use it to monitor real-time deployment status, view logs, and track state across all customer environments. For status indicators, log collection, and metrics, see [Logs & Metrics](/docs/controllers/logs-and-metrics/). ### Deployment Target Menu Each deployment target card has a **⋮** (vertical ellipsis) menu in its top-right corner: * **Edit**: rename the target or change its configuration * **Update Controller**: apply a pending controller version update (only shown when an update is available). See [Controller Updates](#controller-updates) for details. * **Notes**: add internal notes visible to your team * **Controller Logs**: open the controller log viewer. See [Logs & Metrics](/docs/controllers/logs-and-metrics/#controller-logs) for details. * **Reconnect**: generate a new connection command (only shown when the controller has connected at least once and no reconnect is pending). See [Reconnect](/docs/controllers/logs-and-metrics/#reconnect) for details. * **Cancel reconnect**: discard the command of a pending reconnect and keep the current secret (only shown while a reconnect is pending). See [Cancel a pending reconnect](/docs/controllers/logs-and-metrics/#cancel-a-pending-reconnect) for details. * **Delete**: remove the deployment target ### Controller Updates Every deployment target runs a specific controller version, and each Distr instance ships the controller version that matches it. When a target is on an older version, the **Update Controller** action assigns it the version of that instance. The controller notices the change the next time it polls Distr and updates itself. Updating a controller does not restart the deployed application. Controllers can also update themselves without any interaction. When **automatic controller updates** are enabled for a target, Distr assigns it the current controller version on every start, so upgrading Distr updates those controllers along with it. The option can be set per target when creating a deployment, in the target settings, and in the **Update Controller** dialog. It is enabled by default for new deployment targets and disabled for targets that existed before the option was introduced.
# Alerts
> Monitor deployments and receive email notifications when status changes or resource usage exceeds thresholds.
Alerts notify selected users by email when a monitored deployment becomes unhealthy or when host resource usage exceeds a configured threshold. ## Vendor Alerts and Customer Alerts By default, alerts are vendor-managed: you configure alert rules and choose who gets notified. Under **Customers** in the [Vendor Portal](/docs/vendor-portal/), you can enable alert management per customer organization (see [Customer Management](/docs/platform/customer-management/)). This supports two scenarios: **Vendor-managed deployments**: You monitor deployments and receive alerts directly, potentially before the customer notices an issue. **Customer-managed deployments**: Customers configure their own alerts and choose who in their organization gets notified.  ## How to Configure Alerts In the sidebar, navigate to **Notifications** > **Alerts**. 1. Click **Alert Notification**. 2. Optionally enter a name for the configuration. 3. Enable one or more **triggers** (see [Trigger Types](#trigger-types) below). 4. Select one or more deployments to monitor. 5. Select the users who should receive email notifications. Each configuration can be toggled on or off without deleting it. **Notifications** > **History** shows previously triggered alerts. The page lists what your own organization has configured. **Show customer alerts** leads to the same page for one of your customers, where a configuration belongs to that customer: it monitors their deployments and notifies users of their organization. ## Trigger Types Each alert configuration requires at least one trigger. You can combine multiple triggers in a single configuration. ### Deployment status changes Triggers when a monitored deployment transitions between health states: | From | To | | -------------------------- | ---------------------- | | **Running** or **Healthy** | **Stale** or **Error** | An error while a new version is being rolled out is reported as **Update failed** and tells whether the last applied version is still running. A recovery notification is also sent when a deployment returns to a healthy state (**Running** or **Healthy**) after being degraded, including when another version is applied in place of a failed update. For the full list of deployment statuses, see [Deployment Status](/docs/controllers/logs-and-metrics/#deployment-status). For details on how **Running** vs. **Healthy** is determined, see [Healthchecks](/docs/controllers/logs-and-metrics/#healthchecks). ### Resource usage thresholds Triggers when a host metric exceeds a percentage threshold you define. Three resource metrics are available: | Trigger | What it monitors | | ---------------- | --------------------------------------------------------- | | **CPU usage** | Overall CPU utilization on the host or cluster | | **Memory usage** | Overall memory utilization on the host or cluster | | **Disk usage** | Disk utilization per mount point (Docker controller only) | For each trigger, set a threshold between 1% and 100%. When usage crosses above the threshold, an alert email is sent. A recovery email is sent when usage drops back below the threshold. ## Notification Emails All alert notifications are sent by email to the users selected in the configuration. Each email includes: * The affected deployment target and customer organization * The trigger type (status change, CPU, memory, or disk) * For resource alerts: the configured threshold and the current usage percentage * Whether it is an alert or a recovery notification ## Custom alerting with Prometheus For more advanced alerting workflows beyond the built-in email notifications, Distr exposes deployment status metrics via a [Prometheus-compatible endpoint](/docs/self-hosting/prometheus/). These metrics can be combined with tools like [Alertmanager](https://github.com/prometheus/alertmanager) or [Grafana Alerts](https://grafana.com/docs/grafana/latest/alerting/) to route notifications to Slack, PagerDuty, or other channels.
# Application
> Learn how to create Docker and Helm applications in Distr, add versions, and manage your application templates.
This guide walks you through creating applications in Distr. You can create two types of applications: **Docker** applications (using Docker Compose) and **Helm** applications (using Kubernetes Helm charts). ## Creating a new Application In the Distr web interface, navigate to the **Applications** section in the sidebar and click on the **Add application** button in the top right corner. You will be asked to enter a name and select the type of the application (Docker or Kubernetes/Helm). * Docker ### Prerequisites In Distr, a Docker app consists of versions, each defined by a [Docker Compose](https://docs.docker.com/compose/) file. Therefore, if you want to onboard a new Docker App, you need to have a Docker Compose file of your software ready. ### Creating a new Docker App In the Distr web interface, navigate to the **Applications** section in the sidebar and click on the **Add application** button in the top right corner. You will be asked to enter a name and select the type of the application:  After you have clicked on the **Create Application** button, you will be redirected to the detailed view of this application. In this view you can manage the versions of the application.  ### Creating a first version To add a first version to your Docker App, enter the version name and your Docker Compose file in the “New Version” form. In this example we will upload a file containing Gitea and a Postgres database, whose source can be found [here](https://github.com/docker/awesome-compose/blob/master/gitea-postgres/compose.yaml) (we additionally pin the version to `1.23.1` and make the password an environment variable). You can optionally add a template for the environment variables that your Docker Compose file uses. The template will be shown to the user when they deploy this version to a deployment environment. In this example we enter a reminder for the user to set the database password, as the deployment would fail otherwise.  Click on the **Create New Version** button to add the version to your Docker App. ### Adding further versions After you have created the version, you can see it in the list of versions:  You can use the **Copy from** button to create a new version based on the existing one. If you are looking for a more automated and integrated experience in creating new versions, take a look at our [GitHub Action](/docs/integrations/gh-action/) or [SDKs](/docs/integrations/sdk/). * Helm ### Prerequisites In Distr, a Helm app consists of versions, each defined by a publicly available [Helm chart](/glossary/helm-chart/). Therefore, if you want to onboard a new Helm App, you need to have a Helm chart of your software ready. You should also have access to a [Kubernetes](/glossary/kubernetes/) cluster and a namespace where you can deploy the Helm chart. ### Creating a new Helm App In the Distr web interface, navigate to the **Applications** section in the sidebar and click on the **Add application** button in the top right corner. You will be asked to enter a name. Change the type of the application **Kubernetes**:  After you have clicked on the **Create** button, the list of applications will show your new app. ### Creating a first version To add a new version to your Helm App, click on the **Manage versions** button in the application list. A modal will open where you can add a new version by entering a name and the corresponding data about the Helm chart:  **Base Values and Template** You can provide a base values file and a template file for the [Helm chart](/glossary/helm-chart/). The base values file is a YAML file that contains the default values for the Helm chart. The template file is a file that contains the template for the Helm chart. The template will also be shown later on in the deployment process, so the user can adjust the values before deploying the Helm chart. Both files are optional. Click on the **Create** button to add the version to your Helm App. ### Adding a new version After you have created the version, you can see it in the list of versions:  You can use the **Copy from** button to create a new version based on the existing one. If you are looking for a more automated and integrated experience in creating new versions, take a look at our [SDKs](/docs/integrations/sdk/). ## Versioning Strategy Every application has a versioning strategy, which determines how its versions are sorted and which version is considered the latest: * **Semantic versioning** orders versions by [SemVer](https://semver.org/) precedence. Every version name has to be a valid SemVer version, so `1.10.0` is newer than `1.9.0` and `2.0.0` is newer than `2.0.0-rc.1`. Distr rejects a version name that is not valid SemVer and one that resolves to a version the application already has, `1.0.0` and `v1.0.0` being the same version. * **Chronological versioning** orders versions by the time they were created, whatever they are named. Pick this when your versions are dates, build numbers or channel names. You pick the strategy when creating an application and can change it later on the application detail page. Switching to semantic versioning is only possible while every existing version name, including the archived ones, is a valid SemVer version. Applications created before strategies existed keep **Legacy versioning**, which orders by SemVer while every name happens to parse and by creation date otherwise. It cannot be selected, and an application has to move off it to use automatic updates. ## Automatic Updates With **Allow automatic updates** enabled on an application, a deployment of it can be set to follow the application’s latest version instead of being updated by hand or by a release pipeline. See [Automatic updates](/docs/controllers/deployment/#automatic-updates) for what this does to a deployment. The setting only makes the feature available. Whether an individual deployment follows the latest version is decided per deployment, by you or by the customer. Automatic updates are part of the Business plan and need a versioning strategy other than legacy versioning. ## Additional Resources Each application version can include additional resources: named markdown documents such as release notes, upgrade instructions, or troubleshooting tips. To attach them, use the **Add Resource** button in the “New Version” form and provide a name and the markdown content for each resource. Resources marked as **Visible to customers** are shown to your customers in the Customer Portal when they select that version in the deployment form, so they always see the information matching the version they are deploying. Additional resources can also be attached automatically as part of your release pipeline when creating versions with the [GitHub Action](/docs/integrations/gh-action/#attaching-additional-resources). ## Renaming Applications and Versions You can rename an application or any of its versions at any time from the application detail page. Click the edit icon next to the application name, or click a version name in the versions table, to edit it inline and save. Renaming only changes the display name shown in Distr - it does not affect existing deployments or the underlying artifacts. ## Next Steps Once you’ve created your application and added versions, you’re ready to create deployments. See the [Create Deployment](/docs/controllers/deployment/) guide for instructions on deploying your applications to customer environments.
# Application Links
> Create dynamic links to deployed applications using environment variables and Helm values as template variables.
Distr allows you to define dynamic application links that automatically resolve to the correct URL after deployment. This enables users to quickly access their deployed applications directly from the Distr interface. This guide explains how to configure application links using Go template syntax with deployment-specific values. ## What are Application Links? Application links are templated URLs that point to your deployed application. Instead of hardcoding a URL, you can use template variables that get replaced with actual values from the deployment’s environment variables and configuration. For example, if your application’s URL depends on a custom hostname configured during deployment, you can create a template like:
```plaintext
https://{{ .Env.HOSTNAME }}
```
When the deployment is created with `HOSTNAME=app.example.com`, the link automatically becomes `https://app.example.com`. ## How to Configure an Application Link Application links are configured when creating or editing an application version in Distr. 1. Navigate to the **Applications** section in the Distr web interface 2. Select your application or create a new one 3. When creating or editing a version, enter the **Application Link** in the designated field 4. Use Go template syntax with available template variables The link will be displayed in the deployment card with an “Open” button when the link is non-empty. ## Available Template Variables Application links support two categories of template variables: ### Environment Variables (`.Env`) Access environment variables defined in the deployment’s `.env` file:
```plaintext
{{ .Env.VARIABLE_NAME }}
```
**Example**: If your `.env` file contains `APP_HOST=myapp.example.com`, you can use:
```plaintext
https://{{ .Env.APP_HOST }}
```
### Helm Values (`.Values`) For Kubernetes deployments, access values from the Helm values YAML:
```plaintext
{{ .Values.path.to.value }}
```
**Example**: If your `values.yaml` contains:
```yaml
ingress:
enabled: true
host: myapp.example.com
```
You can use:
```plaintext
https://{{ .Values.ingress.host }}
```
## Template Syntax Examples Application links use Go’s [`text/template`](https://pkg.go.dev/text/template) syntax, which supports various operations: ### Basic Variable Substitution
```plaintext
https://{{ .Env.HOST }}:{{ .Env.PORT }}
```
With `.env`:
```dotenv
HOST=localhost
PORT=8080
```
Result: `https://localhost:8080` ### Nested Values For accessing nested YAML structures, use dot notation for nested objects, and use the `index` function when you need to access array elements by position. For example, to access the first host entry, use:
```plaintext
https://{{ index .Values.app.ingress.hosts 0 "host" }}
```
With `values.yaml`:
```yaml
app:
ingress:
hosts:
- host: myapp.example.com
```
Result: `https://myapp.example.com` ### Conditionals Use `if` statements to handle optional configurations:
```plaintext
https://{{ if .Values.ingress.enabled }}{{ .Values.ingress.host }}{{ else }}localhost{{ end }}
```
With `values.yaml`:
```yaml
ingress:
enabled: true
host: production.example.com
```
Result: `https://production.example.com` If `ingress.enabled` is `false`, it would use `https://localhost`. ## Best Practices 1. **Use descriptive variable names**: Make it clear what each variable represents in your environment template 2. **Test your templates**: Deploy the application to verify the link resolves correctly 3. **Provide defaults**: Use conditionals to provide sensible defaults when optional values are missing 4. **Document requirements**: In your application description, document which environment variables or Helm values are required for the link to work 5. **Handle protocols**: Include the protocol (http/https) in the template or as a variable ## Error Handling If a template fails to parse or execute, Distr will: * Log the error for debugging * Keep the original template string as the link * Continue processing other deployments Missing or undefined variables will render as `` in the final URL. Caution Ensure all required variables are set in the environment or Helm values to avoid broken links with `` placeholders. ## Updating Application Links When you update an application link in an application version: * The change applies to **new deployments** of that version * Existing deployments **are not automatically updated** * Users can redeploy to pick up the updated link template To update links for existing deployments, users need to trigger a redeployment of the application.
# Deployment
> Learn how to create deployments for Docker and Helm applications, including the updated deployment flow with customer selection and entitlement management.
This step-by-step guide shows you how to create deployments for Docker and Helm applications in Distr. Before creating a deployment, make sure you’ve already [created an application](/docs/controllers/application/) with at least one version. The deployment flow guides you through selecting a customer, choosing an application, configuring deployment settings, and obtaining the command to install both the Distr controller and your application. * Docker ## Docker Deployment ### Step 1: Select Customer Navigate to **Deployments** under **Controllers** in the sidebar and click on the **+ New Deployment** button. The first step is to select the customer organization that will receive this deployment. If you haven’t created any customers yet, you’ll need to do that first. See [Onboarding a New Customer](/docs/platform/rbac/#inviting-customer-organization-users) for instructions.  ### Step 2: Select Application After selecting a customer, choose the Docker application and version you want to deploy.  ### Step 3: Deployment Configuration Give your deployment a descriptive name. This name will help you identify and manage the deployment later.  ### Step 4: Application Configuration Configure the environment variables for your Docker Compose application. These variables will be passed to the `docker compose` process via the `--env-file` argument.  The entered environment variables will be passed unmodified to the `docker compose` process via the `--env-file` argument. For more information on how to use them, please refer to [our guide on working with environment variables](/docs/controllers/docker-env/). You can also enable Docker Swarm mode for deployments that should run in swarm mode. See [Docker Swarm](/docs/controllers/docker-controller/#docker-swarm) for more details. Additionally, you can enable container log collection to view application logs directly in the portal. Learn more about [Container Logs](/docs/controllers/logs-and-metrics/#container-logs). ### Step 5: Deploy Review your configuration and click **Create Deployment** to proceed to the deployment page.  Caution **Important**: This command will automatically install the Distr controller, which will then automatically install your application. The controller runs in the customer’s environment and manages the full lifecycle of your application deployment. ## Verifying Your Deployment was successful After running the command, you can check the deployment status in the **Deployments** section. Click on the status label to see the latest status of each revision, or on the **Inspect** button to view the [logs](/docs/controllers/logs-and-metrics/#log-viewer) of the deployment. * Helm ## Helm Deployment ### Step 1: Select Customer Navigate to **Deployments** under **Controllers** in the sidebar and click on the **+ New Deployment** button. The first step is to select the customer organization that will receive this deployment. If you haven’t created any customers yet, you’ll need to do that first. See [Onboarding a New Customer](/docs/platform/rbac/#inviting-customer-organization-users) for instructions.  ### Step 2: Select Application After selecting a customer, choose the Helm application and version you want to deploy.  ### Step 3: Deployment Configuration Give your deployment a descriptive name and specify the Kubernetes namespace where it should be deployed. Make sure the namespace exists in your cluster before proceeding. You can also enable cluster-scoped permissions. When enabled, the controller will have cluster-wide access; otherwise, it will be limited to a specific namespace. See [Kubernetes Controller](/docs/controllers/kubernetes-controller/) for more details about cluster-scoped vs namespace-scoped controllers.  ### Step 4: Application Configuration Configure the Helm values for your application. You can adjust the values from the base values file you provided when creating the application version.  ### Step 5: Deploy Review your configuration and click **Create Deployment** to proceed to the deployment page.  Caution **Important**: This command will automatically install the Distr controller, which will then automatically install your application. The controller runs in the customer’s Kubernetes cluster and manages the full lifecycle of your Helm deployment. Make sure the namespace exists in your Kubernetes cluster before executing the command. ## Verifying Your Deployment was successful After running the command, you can check the deployment status in the **Deployments** section. Click on the status label to see the latest status of each revision, or on the **Inspect** button to view the [logs](/docs/controllers/logs-and-metrics/#log-viewer) of the deployment. ## Using Existing Deployment Targets If you already have a deployment environment of type `docker` or `kubernetes`, you can use it to deploy your application. Simply navigate to the **Deployments** section and click on the **+ Deploy App** button next to the deployment target you want to use.  This will show you the same flow as above, where you can select your application and version to deploy, configure the deployment settings, and get the command to install both the controller and application. ## Automatic Updates A deployment can follow its application’s latest version instead of being updated by hand or by a release pipeline. Distr then creates a new revision for it whenever the latest version changes, which is when a version is created, when an archived version is brought back, when the application’s [versioning strategy](/docs/controllers/application/#versioning-strategy) changes and when an entitlement starts covering a newer version. Open the actions menu on a deployment and select **Enable automatic updates**, or tick **Enable automatic updates** while creating or updating the deployment. Both a vendor and a customer can do this. Enabling it deploys the latest version right away, which is also why the version cannot be chosen while it is on. A deployment is only ever moved forward. Archiving a version or narrowing an entitlement does not roll a deployment back to an older one, and neither does a version that the strategy orders below the one currently deployed. A deployment whose values no longer apply to the new version is left on the version it runs, rather than being updated into a failing state. The same happens when the deployment is not entitled to the newer version. The option requires **Allow automatic updates** on the application and is part of the Business plan. ## Deployment History Distr keeps a full history of every deployment. Each time a deployment’s version or configuration changes, a new revision is recorded, so you can always see what was deployed, when, and by whom. On the **Deployments** page, open the actions menu on a deployment and select **Deployment history**. A timeline opens listing every revision, newest first, with the application version, the user or organization that made the change, and the timestamp. The active revision is marked **(current)**. Select any revision to inspect its full configuration: * **Docker**: the environment variables and deployment mode used for that revision. * **Helm**: the values file, release name, and Helm options (wait strategy, rollback on failure, cleanup on failure, and force conflicts). This makes it easy to review how a customer’s deployment was configured in the past and to troubleshoot changes over time. ## Related Guides * [Create an Application](/docs/controllers/application/) - Learn how to create Docker and Helm applications * [Application Entitlements](/docs/platform/application-entitlements/) - Control which applications customers can access * [Docker Environment Variables](/docs/controllers/docker-env/) - Configure environment variable templates * [Helm Chart Registry Auth](/docs/controllers/helm-registry-auth/) - Set up authenticated image pulls * [Docker Blue-Green Deployments](/docs/controllers/docker-blue-green-deployments/) - Roll out new versions without downtime
# Run Distr Controllers on macOS
> To run Distr controllers on macOS, configure Docker Desktop and reset the Docker context to default. Docker Swarm deployments also need a change to your Docker config.
Distr can run on a variety of operating systems. Most enterprise environments run on Linux-based VMs, but there are exceptions. For example, you might choose macOS as the target for running Distr controllers during testing. If you’re using Windows or Linux, the [Quickstart guide](/docs/quickstart/) should cover everything you need. But if you’re setting up Distr on macOS, follow these steps. ## Prerequisites ### 1. Install Docker Desktop First, install [Docker Desktop for Mac](https://docs.docker.com/desktop/setup/install/mac-install/). Follow the installation instructions provided by Docker. #### 1.1 Delete Distr volume on Docker Desktop If you’ve already tried to install Distr on Docker Desktop and failed to deploy an application, a volume named `distr_scratch` has been created. This volume is used to store the Distr controller’s data. If it exists, you need to delete it. **Delete the volume, run:**
```sh
docker volume rm distr_scratch
```
### 2. Set the Docker Context to `default` When Docker Desktop runs on macOS, it creates a lightweight Linux VM, and the `desktop-linux` context points to the Docker daemon within this VM. However, Distr expects to connect to the `default` Docker socket (`/var/run/docker.sock`). This mismatch can cause connectivity issues, especially when pulling or deploying container images. Setting the context to `default` aligns the Docker CLI with the expected Docker endpoint, ensuring Distr can interact with the Docker daemon properly. **Set the current Docker context to `default`, run:**
```sh
docker context use default
docker context ls
```
**Verify the current Docker context is set to `default`:**
```text
NAME DESCRIPTION DOCKER ENDPOINT
default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock
desktop-linux Docker Desktop unix:///Users/you/.docker/run/docker.sock
```
**Alternative: configure the endpoint on the deployment target** Instead of switching contexts, you can tell the controller which socket to use. Check **Use a custom Docker endpoint** on the deployment target and enter the endpoint of the context you want to use, for example `unix:///Users/you/.docker/run/docker.sock` for `desktop-linux`. See [Custom Docker Endpoint](/docs/controllers/docker-controller/#custom-docker-endpoint). ### 3. Docker Swarm only: disable `credsStore` Docker Compose deployments pull images with credentials the Distr controller keeps itself, so they need no change here. Restarting a Docker Swarm service, however, reads your Docker config, which on macOS points to the macOS credential manager (`credsStore`) that the controller cannot reach. For Docker Swarm, remove the `credsStore` entry, so that Docker keeps registry credentials in the config file instead. **Open the config file in a text editor** Use `open -e` to edit the Docker configuration in your text editor:
```shell
open -e ~/.docker/config.json
```
**Remove the `credsStore` line** Inside the file, find the line that contains:
```text
"credsStore": "desktop"
```
Delete this line entirely, ensuring you **don’t leave a trailing comma** that could cause JSON parsing errors. After editing, your file should look something like this:
```json
{
"auths": {}
}
```
Remember to save and close the file. ### 4. Test the Setup To verify everything is configured correctly, try [creating a deployment](/docs/controllers/deployment/) through Distr. If there are no errors related to Docker socket access, your setup is good to go. *** After these steps, your macOS environment should be ready to run Distr controllers. If you run into problems, [get help](https://github.com/distr-sh/distr/discussions) in our community forum or email us at . ## Common Issues As the Distr controller is primarily designed for Linux server environments, macOS support is limited and for demo purposes only. Deployment logs are collected as on Linux, but metrics are not. ### Metrics collection must be disabled Metrics collection is not supported on macOS due to Docker Desktop’s virtualized filesystem not supporting the required mount propagation. When creating or editing a deployment target for macOS, make sure to **disable metrics collection** in the deployment target settings.
# Run Distr Controllers on Windows with WSL2
> Run Distr's Docker controller on Windows by using WSL2 and Docker Engine inside WSL, with optional Windows port forwarding for web-facing applications.
Distr’s Docker-based controller can run on Windows through WSL2. In this setup, the Distr controller and your application containers run inside Linux/WSL. ## Requirements You need: * Windows with [WSL2 installed](https://learn.microsoft.com/windows/wsl/install) * A Linux distribution installed in WSL, for example Ubuntu * [Docker Engine installed inside WSL](https://docs.docker.com/engine/install/ubuntu/) * The [Docker Compose plugin](https://docs.docker.com/compose/install/linux/) installed inside WSL * `docker compose` available inside WSL * PowerShell Administrator access if the application exposes a UI or another inbound service outside WSL * Optional: inbound access to the application UI port, usually port `80` and `443`, if the deployed application exposes a web UI Caution If you run this on a cloud VM, for example a Windows VM on AWS EC2, the VM must support virtualization or nested virtualization for WSL2 to work. ## What is different on Windows Compared with a regular Linux Docker host, the important differences are: * Run the Distr connect command inside WSL, not in PowerShell. * Web-facing services can usually be reached from Windows at `localhost`, but traffic to the Windows machine’s LAN or public IP may need a Windows `portproxy` rule. * The WSL IP address can change after reboot or after `wsl --shutdown`, so `portproxy` rules may need to be recreated. * Windows Firewall must allow inbound traffic to the application UI port if the application needs to be reachable from outside the Windows host. If you use Docker Desktop instead of Docker Engine inside WSL, make sure your Docker CLI inside WSL talks to the Docker daemon that runs your containers. This guide assumes Docker Engine is installed directly inside the WSL distribution. ## Check Docker inside WSL Enter WSL:
```powershell
wsl
```
Start Docker if it is not already running:
```sh
sudo service docker start
```
Verify Docker:
```sh
docker run hello-world
docker compose version
docker ps
```
If those commands succeed, you can run the Distr connect command exactly as Distr generates it. If any of them fail with a permission error on `/var/run/docker.sock`, see [Docker permission denied](#docker-permission-denied) in the troubleshooting section, then re-run the verification commands above. ## Configure mount propagation Before running the Distr connect command, configure mount propagation inside WSL:
```sh
sudo mount --make-rshared /
```
The Distr controller needs this for disk metrics and other host-mounted Docker resources. Without it, the controller may fail with this error:
```text
path / is mounted on / but it is not a shared or slave mount
```
This change is not persistent and will be lost on reboot or after `wsl --shutdown`. To re-apply it automatically each time WSL starts, add a boot command to `/etc/wsl.conf` inside your WSL distribution:
```ini
[boot]
command = mount --make-rshared /
```
Then restart WSL from PowerShell with `wsl --shutdown` for the change to take effect. ## Run the Distr connect command Create a deployment in Distr and copy the generated connect command from the deployment target. Run it inside WSL:
```sh
curl -fsSL "https:///api/v1/connect?targetId=&targetSecret=" | docker compose -f - up -d
```
If this fails with a permission error on `/var/run/docker.sock`, configure Docker access without `sudo` as described in [Check Docker inside WSL](#check-docker-inside-wsl) and re-run the command. ## Check the deployment in Distr After running the connect command, check the deployment status in Distr. The deployment target should connect, and the deployment should report healthy resources once the containers have started. You can optionally check the containers directly inside WSL:
```sh
docker ps -a
```
If the application exposes a web UI, you can also test it from inside WSL:
```shell
curl -I http://localhost
```
## Optional: expose a web UI outside WSL Skip this section if the deployed application does not expose a UI or another inbound service. If users must reach the application through the Windows machine’s LAN or public IP, open the Windows Firewall port from PowerShell as Administrator:
```powershell
New-NetFirewallRule -DisplayName "Allow HTTP 80" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow
```
Optional for HTTPS:
```powershell
New-NetFirewallRule -DisplayName "Allow HTTPS 443" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
```
WSL2 often exposes services on Windows `localhost`, but not automatically on the Windows machine’s LAN or public IP. To forward traffic to WSL, get the WSL IP inside WSL:
```sh
hostname -I
```
Use the first IP address, then run this in PowerShell as Administrator:
```powershell
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=80 connectaddress= connectport=80
```
Test the forwarded port from PowerShell, where `` is the Windows machine’s LAN or public IP:
```powershell
curl.exe -I http://
```
## Troubleshooting ### Docker permission denied If Docker reports a permission error for `/var/run/docker.sock`, add your Linux user to the `docker` group:
```shell
sudo usermod -aG docker $USER
exit
```
Then restart WSL from PowerShell:
```powershell
wsl --shutdown
wsl
```
### UI works on localhost but not on the host IP For web-facing applications, if Windows `localhost` works but the LAN or public host IP does not, the missing piece is usually the Windows Firewall rule or the WSL `portproxy` rule:
```powershell
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=80 connectaddress= connectport=80
```
### WSL IP changed after restart WSL IPs can change after reboot or after `wsl --shutdown`. If a forwarded service stops working, get the new WSL IP inside WSL:
```sh
hostname -I
```
Then delete and recreate the `portproxy` rule in PowerShell as Administrator:
```powershell
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=80
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=80 connectaddress= connectport=80
```
# Docker Blue-Green Deployments
> Ship downtime-free deployments on Docker. Run two versions of an application side by side on one deployment target, shift traffic between them by weight and roll back instantly.
Blue-green deployments update an application without downtime. The new version starts next to the one that currently serves traffic and only receives requests once it is healthy. No request fails during the switch, and the old version keeps running until you no longer need it. Rolling back means sending the traffic back, which causes no downtime either. With Distr you set this up on any Docker deployment target by splitting the application into several deployments: a [reverse proxy](/glossary/reverse-proxy/), a database and two slots of your application called **blue** and **green**. A single controller manages all of them, so every step of a rollout is an ordinary deployment update in Distr. ## How the blue-green setup is structured  | Service | Deployment | Role | | ---------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `caddy` | Proxy | Receives all requests and splits them between the slots by weight. Its deployment creates the Docker network the other deployments join. | | `routing` | Proxy | Hands Caddy new weights without restarting it. | | `postgres` | Database | Holds the data both slots share. It stays deployed for the lifetime of the setup. | | `backend` | Backend with `SLOT=blue` | One slot, running one version of your application. | | `backend` | Backend with `SLOT=green` | The other slot, running the next version during a rollout. | The blue and green slots are two deployments of the same Distr application, each on its own version. Distr runs every deployment as a Docker Compose project of its own, so the deployments reach each other through a shared Docker network that the proxy deployment creates and the others declare as `external`. [Docker Multi App Networking](/docs/controllers/docker-multi-app-networking/) explains this pattern in general. The proxy in this guide is [Caddy](https://caddyserver.com/docs/), which supports weighted load balancing and health checks per slot. Any reverse proxy with weighted upstreams works the same way. The application in the slots is the backend of [hello-distr](https://github.com/distr-sh/hello-distr), our example application. ## Prerequisites * A Docker deployment target. See [Create a Deployment](/docs/controllers/deployment/). To run your own application in the slots instead of the hello-distr backend, it needs an endpoint that answers with a 2xx status once the application is ready to serve requests. It must not publish host ports or set `container_name` either, since both slots run on the same host at the same time. Only the proxy publishes ports. ## Step 1: Create the proxy application Create a Docker application named **Proxy** in Distr and add a version with the following Compose file and environment template. The Caddyfile tab shows the Caddy configuration that the Compose file embeds as the `caddyfile` config. * docker-compose.yaml
```yaml
services:
caddy:
image: 'caddy:2.11.9-alpine'
restart: unless-stopped
command: >-
sh -c 'until [ -f /etc/caddy/routing/Caddyfile ]; do sleep 1; done &&
exec caddy run --config /etc/caddy/routing/Caddyfile --adapter caddyfile'
ports:
- '80:80'
volumes:
- 'routing:/etc/caddy/routing'
networks:
- hello-distr
routing:
image: 'caddy:2.11.9-alpine'
restart: unless-stopped
init: true
# Compose recreates a container when its environment changes, but not when only the content of a config does.
environment:
BLUE_WEIGHT: ${BLUE_WEIGHT}
GREEN_WEIGHT: ${GREEN_WEIGHT}
command: >-
sh -c 'cp /Caddyfile /etc/caddy/routing/Caddyfile.tmp &&
mv /etc/caddy/routing/Caddyfile.tmp /etc/caddy/routing/Caddyfile &&
until caddy reload --config /etc/caddy/routing/Caddyfile --adapter caddyfile; do sleep 1; done &&
touch /tmp/reloaded &&
exec sleep infinity'
configs:
- source: caddyfile
target: /Caddyfile
volumes:
- 'routing:/etc/caddy/routing'
healthcheck:
test: ['CMD', 'test', '-f', '/tmp/reloaded']
interval: 10s
configs:
caddyfile:
content: |
# Caddyfile
volumes:
routing:
networks:
hello-distr:
name: hello-distr
```
* Caddyfile
```txt
{
admin unix//etc/caddy/routing/admin.sock
}
:80 {
reverse_proxy backend-blue:5000 backend-green:5000 {
lb_policy weighted_round_robin ${BLUE_WEIGHT} ${GREEN_WEIGHT}
health_uri /health
health_interval 2s
}
}
```
* .env
```dotenv
BLUE_WEIGHT=100
GREEN_WEIGHT=0
```
What each part does: * `networks.hello-distr.name` gives the shared network a fixed name. Without it, Compose prefixes the network name with the project name. Distr sets a different project name for every deployment, so the other deployments would not find the network. Replace `hello-distr` with a name unique to your application. * `caddy` is the proxy. It waits until the Caddyfile is in the `routing` volume, then serves it and never restarts while you shift traffic. * `routing` writes the Caddyfile into the `routing` volume, tells Caddy to reload it through the admin socket in the same volume and then keeps running. A weight change recreates only this container. If Caddy took the weights itself, every change would recreate the `caddy` container and drop all open connections, and Caddy has no production-ready way to watch its config file instead. After the reload, Caddy sends new requests according to the new weights and finishes the ones in flight. * `weighted_round_robin` splits the requests between the slots in proportion to `BLUE_WEIGHT` and `GREEN_WEIGHT`. A slot with weight `0` gets no new requests. Caddy also skips a slot whose health check on `health_uri` fails, so if a slot goes down during a rollout, the other one takes over its share. * `backend-blue` and `backend-green` are the network aliases the two slots register on the shared network. For your own application, adjust the port and `health_uri`. ## Step 2: Create the database application Keep the data both slots read and write in a deployment of its own, so replacing a slot leaves it alone. This example uses PostgreSQL. Create a Docker application named **Database** with this version: * docker-compose.yaml
```yaml
services:
postgres:
image: 'postgres:18.6-alpine3.24'
restart: unless-stopped
environment:
POSTGRES_USER: hello-distr
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: hello-distr
volumes:
- 'postgres:/var/lib/postgresql/'
networks:
- hello-distr
healthcheck:
test: pg_isready -h localhost -U hello-distr -d hello-distr
start_interval: 1s
interval: 5s
retries: 6
start_period: 30s
volumes:
postgres:
networks:
hello-distr:
external: true
```
* .env
```dotenv
POSTGRES_PASSWORD={{ .Secrets.POSTGRES_PASSWORD }}
```
The password comes from a [Distr secret](/docs/controllers/secrets/), so the database and both slots share it and it never shows up in a deployment configuration. Since the slots put the password into a connection URL, choose one without characters that have a meaning in URLs, such as `/`, `#`, `@` or `:`. Caution Undeploying a deployment removes its volumes. Keep the database deployment in place across rollouts and only ever undeploy the slots. ## Step 3: Create the backend application Create a Docker application named **Backend**. Both slots run the same Compose file. A `SLOT` variable decides which alias the slot registers on the shared network and therefore which of the proxy’s weights applies to it. * docker-compose.yaml
```yaml
services:
backend:
image: 'ghcr.io/distr-sh/hello-distr/backend:0.4.24'
restart: unless-stopped
environment:
DB_URL: postgresql://hello-distr:${POSTGRES_PASSWORD}@postgres/hello-distr?sslmode=disable
networks:
hello-distr:
aliases:
- backend-${SLOT:?SLOT must be blue or green}
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request; urllib.request.urlopen('http://localhost:5000/health', timeout=1)",
]
interval: 5s
networks:
hello-distr:
external: true
```
* .env
```dotenv
SLOT=blue
POSTGRES_PASSWORD={{ .Secrets.POSTGRES_PASSWORD }}
```
Distr reports the Docker health check as the deployment’s status, so a slot shows as **Healthy** once it can take traffic. The hello-distr backend answers on `/health` only once it reaches the database. Its image ships Python but neither `curl` nor `wget`, so the check calls the endpoint from Python. For your own application, use a command that exists in its image. Add one application version per release as usual, each pinning its image tag, for example `0.4.8` and `0.4.9`. ## Step 4: Deploy the setup Create the first three deployments on the same deployment target. The green slot follows with the first rollout. For the first deployment, follow [Create a Deployment](/docs/controllers/deployment/). For the others, use **+ Deploy App** on the deployment target card. 1. Deploy the **Proxy** with `BLUE_WEIGHT=100` and `GREEN_WEIGHT=0`. It creates the shared network. 2. Deploy the **Database**. 3. Deploy the **Backend** with `SLOT=blue` and the version you currently ship, and name the deployment after its slot, for example `backend blue`. The order matters only for the network. A deployment that joins it before it exists fails with `network hello-distr declared as external, but could not be found`, and the controller retries it on its next cycle until the proxy has created the network. Once all three deployments are **Healthy**, every request on port 80 goes to the blue slot, and `http:///latest-message` answers with `hello distr!`. ## Step 5: Roll out a new version 1. Deploy the **Backend** a second time with `SLOT=green` and the new version, and wait until the deployment is **Healthy**. Green now runs in the idle slot but gets no traffic yet. 2. Update the proxy deployment to `BLUE_WEIGHT=90` and `GREEN_WEIGHT=10`. One in ten requests now reaches the new version. Watch its [logs and metrics](/docs/controllers/logs-and-metrics/) and raise its share in as many steps as you like. 3. To switch over, update the proxy deployment to `BLUE_WEIGHT=0` and `GREEN_WEIGHT=100`. All requests now reach the new version, and the old one keeps running. 4. If something goes wrong, set the weights back to `100` and `0` while the blue slot is still deployed. All traffic moves back to the old version at once, since nothing has to start. 5. Once you trust the new version, undeploy the blue slot or keep it for the next rollout. The slots take turns from then on. For the next release, update the idle slot to the new version (or deploy it again if you undeployed it) and repeat the weight changes in the opposite direction. Caution Give a slot weight only after its deployment is **Healthy**. Caddy treats a slot as up until its first health check fails, so a slot that is not running yet still receives its share of requests for up to one health check interval. ## Keep both versions compatible with the data During a rollout both versions read and write the same database. Every database change a release brings has to work with the version before it: * Add columns and tables in one release and start using them in the next. * Remove what the old version still reads only in a release after the one that stopped reading it. * Run migrations in a way that does not lock tables the running version needs. A migration that breaks the old version also breaks the rollback, since rolling back only moves traffic and leaves the data as it is. ## Automate the rollout Every step above is a deployment created or updated in Distr, so a release pipeline can run a rollout through the [Distr API](/docs/integrations/api/) or the [Distr SDK](/docs/integrations/sdk/). Leave [automatic updates](/docs/controllers/deployment/#automatic-updates) off for the two slots, since they would move both slots to the latest version at the same time. ## Related * [Docker Environment Variables](/docs/controllers/docker-env/): define the environment templates used for the weights and the slot * [Secrets Management](/docs/controllers/secrets/): share credentials between the database and the slots * [Logs & Metrics](/docs/controllers/logs-and-metrics/): watch the new version while it receives a share of the traffic * [Mounting Configuration Files in Docker Compose](/blog/docker-compose-mount-config-files/) (blog post): ship a config file like the Caddyfile inside the Compose file * [Adding Cron Jobs to a Docker Compose application](/blog/docker-compose-cron-jobs/) (blog post): run scheduled jobs next to your application
# Docker Compose Secrets
> Use Docker's native secrets mechanism to deliver sensitive values as files inside containers rather than as environment variables.
Docker Compose has a native secrets mechanism that mounts sensitive values as files inside the container at `/run/secrets/`, rather than exposing them as environment variables. This is a Docker-level feature. It is independent of [Distr Secrets](/docs/controllers/secrets/) and can be used on its own or in combination with them. ## When to use Docker Compose Secrets | Approach | How the secret reaches the container | Use when | | -------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------ | | **Env var** (standard) | `ENV_VAR=value` in the environment | The application reads from `os.environ` | | **Docker Compose Secrets** | File at `/run/secrets/filename` | The application expects a file path, or you want to avoid secrets appearing in `docker inspect` output | Both approaches can pull the underlying secret value from Distr Secrets. The difference is the delivery mechanism, not the source. ## How Docker Compose Secrets work The `secrets` section in your `compose.yaml` defines a named secret and where its value comes from. Services that need it declare it under their `secrets` key, and Docker mounts it as a read-only file inside the container.
```yaml
services:
backend:
image: my-application-backend
secrets:
- api-key.txt
environment:
# Tell the app where to find the secret file
API_KEY_PATH: /run/secrets/api-key.txt
secrets:
api-key.txt:
environment: API_KEY # Reads from the API_KEY environment variable
```
The `environment: API_KEY` line tells Docker Compose to populate the secret from the `API_KEY` environment variable, which it reads from the `.env` file passed by the Distr controller. ## Using Docker Compose Secrets without Distr Secrets You can hardcode the value directly in the `.env` file:
```shell
API_KEY="my-actual-secret-value"
```
This works but stores the raw value in your deployment configuration. Anyone with access to the deployment in Distr can see it. ## Combining with Distr Secrets The recommended approach is to use [Distr Secrets](/docs/controllers/secrets/) to store the value and inject it into the `.env` file via template syntax. The Distr controller substitutes the template before passing the file to Docker Compose:
```shell
API_KEY="{{ .Secrets.API_KEY }}"
```
The full flow is: 1. Distr replaces `{{ .Secrets.API_KEY }}` with the actual value from the secret store 2. The Distr controller passes the resolved `.env` file to Docker Compose 3. Docker Compose reads `API_KEY` from the `.env` and creates the secret 4. The secret is mounted as `/run/secrets/api-key.txt` inside the container 5. Your application reads the file at the path from `API_KEY_PATH` ## Related * [Secrets Management](/docs/controllers/secrets/): store and template-reference secret values in Distr * [Docker Environment Variables](/docs/controllers/docker-env/): configure environment variables for Docker deployments
# Docker Controller
> How the Distr Docker Compose controller works: installation, core loop, OCI registry authentication, self-updates, Docker Swarm support, and uninstallation.
The Docker Compose controller manages container-based deployments, handling both single- and multi-container applications. It performs application updates with minimal downtime, collects container health metrics and logs, and supports environment variable templating for flexible configuration. The [architecture diagram](/docs/controllers/security/docker/#architecture) shows the connections the controller opens, what it runs with on the host and what it never does. ## Requirements The host system must have Docker and Docker Compose installed. ## Installation and Environment The controller is installed by running a single command that fetches a Docker Compose file from Distr and starts it:
```plaintext
curl "https:///api/v1/connect?targetId=&targetSecret=" | docker compose -f - up -d
```
The `targetId` and `targetSecret` ensure the controller can only fetch deployments for one specific deployment target. The secret is shown once and never stored by Distr. It can only be verified. The fetched Compose file runs the controller container:
```yaml
name: distr
services:
controller:
network_mode: host
restart: unless-stopped
image: 'ghcr.io/distr-sh/distr/docker-controller'
environment:
# Authentication with Distr, see above
DISTR_TARGET_ID: ''
DISTR_TARGET_SECRET: ''
# various endpoints of Distr:
DISTR_LOGIN_ENDPOINT: 'https:///api/v1/controller/login'
DISTR_MANIFEST_ENDPOINT: 'https:///api/v1/controller/manifest'
DISTR_RESOURCE_ENDPOINT: 'https:///api/v1/controller/resources'
DISTR_STATUS_ENDPOINT: 'https:///api/v1/controller/status'
DISTR_METRICS_ENDPOINT: 'https:///api/v1/controller/metrics'
DISTR_DEPLOYMENT_METRICS_ENDPOINT: 'https:///api/v1/controller/deployments'
DISTR_LOGS_ENDPOINT: 'https:///api/v1/controller/logs'
DISTR_DEPLOYMENT_TARGET_LOGS_ENDPOINT: 'https:///api/v1/controller/deployment-target-logs'
# how often the controller fetches deployments
DISTR_CONTROLLER_INTERVAL: '5s'
# controller versioning information, needed for controller self-updates:
DISTR_CONTROLLER_VERSION_ID: ''
DISTR_CONTROLLER_SCRATCH_DIR: /scratch
DISTR_REGISTRY_HOST: 'localhost:8585'
HOST_DOCKER_CONFIG_DIR: ${HOST_DOCKER_CONFIG_DIR-${HOME}/.docker}
volumes:
# the host's docker socket is mounted into the controller container
- /var/run/docker.sock:/var/run/docker.sock
- scratch:/scratch
- ${HOST_DOCKER_CONFIG_DIR-${HOME}/.docker}:/root/.docker:ro
volumes:
scratch:
```
All requests to Distr are authenticated with a JWT token obtained by calling `DISTR_LOGIN_ENDPOINT` with the `targetId` and `targetSecret` credentials. The Docker socket is mounted so the controller can manage containers on the host. Which socket that is can be configured per deployment target, see [Custom Docker Endpoint](#custom-docker-endpoint). [Controller Security](/docs/controllers/security/) describes what the controller can access on the host and what it sends to Distr. ## Core Logic The controller runs the following loop at the interval defined by `DISTR_CONTROLLER_INTERVAL` (default 5 seconds): 1. Fetch the deployments from `DISTR_RESOURCE_ENDPOINT` 2. Remove Docker Compose projects that are no longer in the list (undeployed), together with their volumes and networks 3. Start Docker Compose projects that are in the list. If images need pulling, the controller reports status `PROGRESSING`. 4. Send each Docker Compose output to `DISTR_STATUS_ENDPOINT`, reporting the deployment’s status. An apply that has not finished after 10 minutes is reported as an error rather than left in `PROGRESSING`, and is retried on the next cycle. Each deployment maps to one Docker Compose project on the host, named `distr-`. To let deployments reach each other, see [Docker Multi App Networking](/docs/controllers/docker-multi-app-networking/). ## Authentication with OCI Registries If a deployment uses images from the Distr registry, the controller authenticates automatically, so the customer needs no extra steps. The authentication secret is stored in a temporary directory inside the controller container. For any other authenticated OCI registry, the controller mounts the host’s Docker config directory so existing credentials are reused. Any registry accessible from the host is also accessible to the controller. You can also provide credentials via an [application entitlement](/docs/platform/application-entitlements/#oci-registry-authentication) (Pro feature). When a deployment is created with that entitlement, the controller logs in to the specified registry using the provided credentials. ## Controller Self Updates When the controller version for a deployment target is updated in Distr, the controller updates itself on the next cycle. It fetches the new manifest from `DISTR_MANIFEST_ENDPOINT` and restarts. The `DISTR_CONTROLLER_SCRATCH_DIR` environment variable and `scratch` volume mount are required for this to work. ## Controller Image Repository The controller and autoheal images are pulled from `registry.distr.sh/distr` on Distr Cloud and from `ghcr.io/distr-sh/distr` on self-hosted instances by default. You can have them pulled from your own registry instead, as described in [Controller Image Repository](/docs/platform/branding/#controller-image-repository). ## Autoheal Distr deploys an autoheal service alongside every Docker controller. This service monitors container health and automatically restarts containers that become unhealthy. When autoheal is enabled for **all containers**, the underlying `docker-autoheal` service targets every unhealthy container visible to the Docker engine on that host, not just containers from a specific Distr deployment. This means your application containers are automatically restarted if they fail their healthchecks. For this to work, your application must define [Docker healthchecks](https://docs.docker.com/reference/compose-file/services/#healthcheck) in its Compose file. Containers without healthchecks are not monitored. The autoheal setting is configured when creating a deployment target. In the deployment wizard, the **Enable autoheal for all containers** checkbox is enabled by default for Docker deployments. When disabled, the autoheal service still runs but only monitors the Distr controller itself. To prevent unrelated containers on the same host from being auto-healed, label those containers with `autoheal=False`. ## Image Cleanup By default, when the controller updates a deployment to a new version, the previous container images remain on the host. Over time this can consume significant disk space. When **Enable container image cleanup** is checked, the controller automatically removes the previous version’s container images after a successful deployment update. This setting is enabled by default for new Docker deployment targets. To toggle image cleanup on an existing deployment target: 1. Navigate to the deployment target in the Deployments view. 2. Click the **⋮** menu and select **Edit**. 3. Toggle **Enable container image cleanup**. Image cleanup only runs after a successful update. If a deployment fails, the previous images are kept so a rollback remains possible. ## Custom Docker Endpoint By default the controller uses the host’s standard Docker socket, `unix:///var/run/docker.sock`. If the Docker daemon on the target host listens on a different socket, check **Use a custom Docker endpoint** and enter its URI, for example `unix:///Users/you/.docker/run/docker.sock`. The generated Compose file then mounts that socket into the controller and autoheal containers as `/var/run/docker.sock` instead of the default one. The controller always addresses the socket through `DOCKER_HOST=unix:///var/run/docker.sock`, so the Docker context selected in the host’s Docker config, which is mounted into the controller container, cannot send it to a host path that does not exist inside the container. The setting is available both in the deployment wizard and when editing an existing deployment target. Changes only take effect after the customer re-applies the generated Compose file. Only unix socket URIs are supported. Remote endpoints such as `tcp://` cannot be used, because the endpoint is applied by mounting the socket into the controller container. For the same reason the socket path may contain neither whitespace nor a colon. ## Docker Swarm A deployment can run in Swarm mode. The host must have Docker Swarm enabled and initialized. Instead of `docker compose up`, the controller uses `docker stack deploy`. Unlike regular Compose mode, `docker stack deploy` is only called when the deployment has changed, not on every cycle. ## Security The controller manages Docker on the host, so it has the access of the Docker engine itself. [Docker Controller Security](/docs/controllers/security/docker/) describes what it can reach on the host, which Docker operations it runs and which credentials it keeps there. The other pages of [Controller Security](/docs/controllers/security/) cover its network connections, the data it sends to Distr and how to verify its images. ## Uninstalling Before removing the controller, undeploy all managed deployments via the UI or API. Then stop and remove the controller container:
```shell
docker stop distr-controller-1 && docker rm distr-controller-1
```
Deployment targets connected with Distr 4.2 or earlier run the controller as the `agent` Compose service, in the container `distr-agent-1`.
# Docker Environment Variables
> Create customizable environment variable templates for your Docker applications and let customers configure them before deployment.
Distr allows users to define environment variable templates for Docker applications. Users can configure and customize environment variables before deploying an application. This guide builds on top of the [create a Docker application](/docs/controllers/application/) guide and explains environment variable templates in more detail. ## What is an Environment Variable Template? Environment variables are used to pass deployment-specific values to your application. With Distr, you can define a template for these variables, allowing users to customize them before deployment and ensuring all necessary values are set. This setup consists of three parts: 1. A **parameterized Docker Compose file** that references dynamic variables. 2. A **template file** that provides default values for those variables, allowing end users to modify them in Distr before deployment. 3. The actual **environment** configured during the deployment of the application. Caution Updating the environment template will not update the environment file for existing deployments. Existing deployments will need to add the new variables manually when they release a new version. Here’s an example of how it works: The Docker Compose file will be the same for all deployments that use that specific version of the application. The environment file can be customized for each deployment. * docker-compose.yaml
```yaml
services:
web:
image: '${WEB_IMAGE:?error}'
container_name: '${WEB_NAME:?error}'
ports:
- '${WEB_PORT:?error}:80'
environment:
- APP_ENV=${APP_ENV:?error}
```
* .env
```dotenv
WEB_IMAGE=nginx:latest
WEB_NAME=my-nginx-container
WEB_PORT=8080
APP_ENV=development
```
You can execute this example with the following command:
```shell
docker compose up
```
You can also create different environments using the `--env-file` flag:
```shell
docker compose --env-file .prod.env up
```
## Referencing environment variables in multiple services Caution The Distr controller **does not** inject the environment variables into your containers automatically. By default the variables are only available for interpolation (e.g. `${MY_VARIABLE}`) inside the `docker-compose.yaml` file, so you have fine control over which service is able to access which env variable. You need to pass the environment variables to the services in the `docker-compose.yaml` file. If multiple services need the same environment variables, you can define them in `x-` sections of the `docker-compose.yaml` file. * docker-compose.yaml
```yaml
x-shared-env: &shared-env
SHARED_ENV_PRODUCT: ${SHARED_ENV_PRODUCT:?error}
SHARED_ENV_DOCS_URL: ${SHARED_ENV_DOCS_URL:?error}
# Our partly shared env needs to extend the shared env
x-partly-shared-env: &partly-shared-env
<<: *shared-env
PARTLY_SHARED_ENV: ${PARTLY_SHARED_ENV:?error}
services:
one:
image: 'stefanprodan/podinfo'
ports:
- '3001:9898'
environment:
<<: *partly-shared-env
SERVER_NAME: ${SERVER_NAME_ONE:?error}
two:
image: 'stefanprodan/podinfo'
ports:
- '3002:9898'
environment:
<<: *partly-shared-env
SERVER_NAME: ${SERVER_NAME_TWO:?error}
three:
image: 'stefanprodan/podinfo'
ports:
- '3003:9898'
environment:
<<: *shared-env
SERVER_NAME: ${SERVER_NAME_THREE:?error}
```
* .env
```dotenv
SERVER_NAME_ONE=ONE
SERVER_NAME_TWO=TWO
SERVER_NAME_THREE=THREE
SHARED_ENV_PRODUCT=Distr
SHARED_ENV_DOCS_URL=https://distr.sh/docs
PARTLY_SHARED_ENV=ONE_AND_TWO
```
You can execute this example with the following command:
```shell
docker compose up
```
When running the Docker Compose file you will be able to see the following output for the webservers `/env` endpoint: * service one http\://localhost:3001/env
```json
[
"HOME=/home/app",
"HOSTNAME=7278f34f08d1",
"PARTLY_SHARED_ENV=ONE_AND_TWO",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"SERVER_NAME=ONE",
"SHARED_ENV_DOCS_URL=https://distr.sh/docs",
"SHARED_ENV_PRODUCT=Distr"
]
```
* service two http\://localhost:3002/env
```json
[
"HOME=/home/app",
"HOSTNAME=6e2a1001f79f",
"PARTLY_SHARED_ENV=ONE_AND_TWO",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"SERVER_NAME=TWO",
"SHARED_ENV_DOCS_URL=https://distr.sh/docs",
"SHARED_ENV_PRODUCT=Distr"
]
```
* service three http\://localhost:3003/env
```json
[
"HOME=/home/app",
"HOSTNAME=b781b4ab2fe0",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"SERVER_NAME=THREE",
"SHARED_ENV_DOCS_URL=https://distr.sh/docs",
"SHARED_ENV_PRODUCT=Distr"
]
```
## Injecting the whole environment file into a service When applying a deployment, the Distr controller writes the configured environment as a `.env` file next to the `docker-compose.yaml`. This means you can use the standard Docker Compose [`env_file`](https://docs.docker.com/reference/compose-file/services/#env_file) directive to inject the entire environment file into a service, instead of listing every variable individually under `environment`:
```yaml
services:
webserver:
image: nginx
env_file:
- .env
```
Caution Using `env_file` injects **every** variable from the environment file into the service. Prefer an explicit `environment` block when a service should only receive a subset of the variables.
# Docker Multi App Networking
> Let several Docker applications on one deployment target reach each other through a shared Docker network, for example a backend and the database it uses.
Services in one Compose file reach each other by their service names. Services in different applications don’t, even on the same deployment target, because the Docker controller runs every deployment as a Compose project of its own (`distr-`) with its own default network. To connect them, one application creates a Docker network and the others join it. The [example](#example-a-backend-and-its-database) at the end does this for a database and a backend that are deployed separately. ## Step 1: Create the network application Create a Docker application in Distr with the following Compose file. It exists only to create the shared network. network/docker-compose.yaml
```yaml
services:
network:
image: 'registry.k8s.io/pause:3.10'
restart: unless-stopped
networks:
- acme-shared
networks:
acme-shared:
name: acme-shared
```
* `networks.acme-shared.name` fixes the network’s name. Without it, Compose puts the project name in front. That name differs for every deployment, so the others would not find the network. Replace `acme-shared` with a name unique to your application. * `network` is a placeholder. Compose won’t start a project that has no services, so the application needs one. The `pause` image does nothing and uses almost no resources. One of your other applications can create the network too, the way the proxy does in [Docker Blue-Green Deployments](/docs/controllers/docker-blue-green-deployments/). The advantage of a separate application is that you can update or undeploy any of the others without touching the network. ## Step 2: Join the network from your applications The other applications declare the network as `external`, so Compose uses the existing network rather than creating its own. Add it to every service that has to reach another deployment: docker-compose.yaml
```yaml
services:
my_service:
# ...
networks:
- acme-shared
networks:
acme-shared:
external: true
```
## Step 3: Deploy the network first Deploy all applications on the same deployment target, the network application before the others. For the first deployment, follow [Create a Deployment](/docs/controllers/deployment/). For the others, use **+ Deploy App** on the deployment target card. If you deploy another application first, it fails with `network acme-shared declared as external, but could not be found`. The controller retries every cycle, so the deployment starts by itself once the network exists. ## Example: a backend and its database This example connects the backend of [hello-distr](https://github.com/distr-sh/hello-distr), our example application, to a PostgreSQL database deployed separately. Create a Docker application from each of the following Compose files and name them **Network**, **Database** and **Backend**. The backend connects to the database as `acme-db`. Both read the password from a [Distr secret](/docs/controllers/secrets/), so it never appears in a deployment configuration. * network/docker-compose.yaml
```yaml
services:
network:
image: 'registry.k8s.io/pause:3.10'
restart: unless-stopped
networks:
- acme-shared
networks:
acme-shared:
name: acme-shared
```
* database/docker-compose.yaml
```yaml
services:
postgres:
image: 'postgres:18.6-alpine3.24'
restart: unless-stopped
environment:
POSTGRES_USER: acme
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: acme
volumes:
- 'postgres:/var/lib/postgresql/'
networks:
acme-shared:
aliases:
- acme-db
healthcheck:
test: pg_isready -h localhost -U acme -d acme
start_interval: 1s
interval: 5s
retries: 6
start_period: 30s
volumes:
postgres:
networks:
acme-shared:
external: true
```
* database/.env
```dotenv
POSTGRES_PASSWORD={{ .Secrets.POSTGRES_PASSWORD }}
```
* backend/docker-compose.yaml
```yaml
services:
backend:
image: 'ghcr.io/distr-sh/hello-distr/backend:0.4.24'
restart: unless-stopped
environment:
DB_URL: postgresql+psycopg2://acme:${POSTGRES_PASSWORD}@acme-db/acme?sslmode=disable
ports:
- '80:5000'
networks:
acme-shared:
aliases:
- acme-backend
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request; urllib.request.urlopen('http://localhost:5000/health', timeout=1)",
]
interval: 5s
networks:
acme-shared:
external: true
```
* backend/.env
```dotenv
POSTGRES_PASSWORD={{ .Secrets.POSTGRES_PASSWORD }}
```
Deploy the **Network**, then the **Database** and the **Backend**. The backend’s health check queries the database, so once the Database and Backend deployments are **Healthy**, the connection works. The Network deployment has no health check and stays **Running**. `http:///latest-message` then answers with `hello distr!`. ## Address other deployments by a network alias On the shared network, every container answers to its network aliases and to its service name. Service names tend to be generic, like `postgres` or `backend`. Two deployments can easily use the same one. Docker then resolves the name to both containers in random order. Each request ends up at either of them. * Give every service that other deployments connect to an alias under `networks..aliases` (like `acme-db`) and connect only through the alias. * If one application is deployed more than once on a deployment target, build the alias from a deployment variable, for example `acme-db-${INSTANCE}`, so each deployment has its own. Do the same for published host ports, since only one deployment can bind the Backend’s port `80`, for example `${HTTP_PORT}:5000`. Leave services that no other deployment needs off the shared network. ## Keep the network definition stable When a new version of the network application changes the network, for example by adding a label, a driver option or a subnet, Compose tries to recreate it. Docker can’t remove a network that other deployments are still connected to, so the update fails with `network acme-shared has active endpoints`. Settle the definition before the first deployment and keep it the same in every later version. ## Related * [Docker Blue-Green Deployments](/docs/controllers/docker-blue-green-deployments/): a setup of several connected deployments that shifts traffic between two versions of an application * [Docker Environment Variables](/docs/controllers/docker-env/): define the environment templates used for the password and the aliases * [Secrets Management](/docs/controllers/secrets/): share credentials between deployments * [Docker Controller](/docs/controllers/docker-controller/): how the controller runs every deployment as its own Compose project
# Helm Chart Registry Authentication
> Configure your Helm charts to support authenticated image pulls from the Distr registry by correctly using imagePullSecrets which enables controller-based credential injection.
Distr is an [OCI artifact registry](/glossary/oci-container-artifact-registry/) that is compliant with the OCI distribution specification. As such, it can be used to host container images, [Helm charts](/glossary/helm-chart/) and many other types of artifact. Distr requires authentication to access the registry API, but our controllers can inject the relevant credentials where they are needed. A common use-case is to host both a Helm chart and related container images on Distr. In this case the controller has to create a `Secret` resource in the same namespace as the helm release and supply that as an image pull secret to workloads created as part of the Helm release. To take advantage of this feature, you have to include one or more `imagePullSecrets` or `pullSecrets` entries in the values.yaml field of your application version where you want the controller to inject the secret name. For example:
```yaml
imagePullSecrets:
- name: foo
myAppServer:
imagePullSecrets: []
myAppDb:
imagePullSecrets: {}
image:
pullSecrets: []
worker:
imagePullSecrets:
- ''
```
will be transformed into
```yaml
imagePullSecrets:
- name: foo
- name: sh.distr.agent.v1.xxxxxx.pull
myAppServer:
imagePullSecrets:
- name: sh.distr.agent.v1.xxxxxx.pull
myAppDb:
# not changed because it is not an array
imagePullSecrets: {}
image:
pullSecrets:
- name: sh.distr.agent.v1.xxxxxx.pull
worker:
imagePullSecrets:
- sh.distr.agent.v1.xxxxxx.pull
```
The controller adds the secret as `name: ...` by default. Some charts expect plain strings instead, e.g. `imagePullSecrets: [foo]`. If an array is non-empty and every entry is a string, the controller adds the secret name as a string as well. To get this form without a secret of your own, put an empty string into the array, as `worker` does above. The controller replaces the empty string with its secret name.
# Infrastructure Controllers
> Distr infrastructure controllers provision and reconcile cloud infrastructure in customer environments. The OpenTofu controller runs your Terraform configuration as a regular Distr application, for BYOC and any other Terraform use case.
Infrastructure controllers provision the cloud resources your application needs in the customer’s environment: a Kubernetes cluster, a database, object storage, networks and IAM roles. The [deployment controllers](/docs/controllers/) deploy applications, while the infrastructure controllers create and reconcile what those applications run on. An infrastructure controller is not a new kind of deployment target. It is a container image that you release as a regular Distr application, with a Docker Compose file or a Helm chart. The [Docker controller](/docs/controllers/docker-controller/) runs it on a VM, or the [Kubernetes controller](/docs/controllers/kubernetes-controller/) runs it in an existing cluster. Versions, entitlements, secrets, logs, health and updates work exactly as they do for every other application. The infrastructure controllers are open source and available in the [distr-infrastructure-controllers](https://github.com/distr-sh/distr-infrastructure-controllers) repository. | Controller | Manages | Image | | ------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------- | | OpenTofu controller | Infrastructure described by an OpenTofu or Terraform config | `ghcr.io/distr-sh/distr-infrastructure-controllers/opentofu-controller` | ## Use cases * **[Bring Your Own Cloud (BYOC)](/docs/use-cases/byoc-bring-your-own-cloud/)**: the OpenTofu controller creates the cluster and the resources your product needs in the customer’s cloud account, and the Kubernetes controller deploys your application into that cluster. * **Terraform use cases**: provision a managed database, a bucket or DNS records next to an application the customer runs, with the same versioned configuration for every customer and a view in Distr of which version each customer runs and whether its last run succeeded. ## OpenTofu controller The OpenTofu controller runs an OpenTofu configuration baked into its image and keeps the state in a persistent volume. OpenTofu is the open source fork of Terraform, so existing Terraform configurations and providers work without changes. On start, the controller copies the configuration into its data volume, next to the state. It then plans and applies the configuration every `RECONCILE_INTERVAL` and logs each step, so the [deployment logs](/docs/controllers/logs-and-metrics/) in Distr show what is created, changed or destroyed and why:
```text
INFO run #1 started {"operation": "apply", "mode": "auto", "version": "0.2.0"}
INFO plan: update aws_s3_object.version
INFO plan: 0 to add, 1 to change, 0 to destroy
INFO upgrading the infrastructure from version 0.1.0 to 0.2.0
INFO aws_s3_object.version: modification complete after 0s [id=version.json]
INFO apply complete: 0 added, 1 changed, 0 destroyed
INFO run #1 finished in 3.7s: the infrastructure is up to date
```
The controller tells an upgrade, a new configuration, changed variables and drift apart, and says which one caused a change. Its `/readyz` endpoint reports whether the last run succeeded, so a failed run shows up in Distr as an unhealthy deployment and can trigger an [alert](/docs/controllers/alerts/). ### Ship your infrastructure with the OpenTofu controller 1. Write an OpenTofu configuration with an empty `backend "local" {}` block and keep the `.terraform.lock.hcl` that `tofu init` writes. The controller installs exactly the providers locked in it. 2. Build an image on top of the OpenTofu controller that copies the configuration to `/module`, and push it to the [Distr registry](/docs/registry/) or any other registry:
```dockerfile
FROM ghcr.io/distr-sh/distr-infrastructure-controllers/opentofu-controller:0.2.0
ARG VERSION
ENV APP_VERSION=${VERSION}
COPY . /module/
```
Build it with `--build-arg VERSION=1.0.0` to set the version of the infrastructure, which OpenTofu receives as `var.app_version`. 3. [Create an application](/docs/controllers/application/) in Distr whose Compose file or Helm chart runs that image with a persistent volume at `/data`. Every example in the repository contains both. 4. Deploy it to a deployment target in the customer’s environment. Pass the cloud credentials as [secrets](/docs/controllers/secrets/) and the variables of your configuration as `TF_VAR_`. 5. To change the infrastructure, release a new image version and update the deployment. Distr rolls it out like any other application update. Caution The state lives in the data volume. Undeploying a Docker deployment removes that volume, so destroy the infrastructure first by setting `DESTROY_CONFIRM` to the `INSTANCE_NAME` and waiting for the logs to confirm it. ### Examples Every directory in [`examples/opentofu/`](https://github.com/distr-sh/distr-infrastructure-controllers/tree/main/examples/opentofu) is a complete infrastructure application with a Dockerfile, a Compose file with its environment template and a Helm chart. Copy one to start your own. | Example | Provisions | | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | | [`hello-world`](https://github.com/distr-sh/distr-infrastructure-controllers/tree/main/examples/opentofu/hello-world) | Nothing real: random names, a password and a fake provisioning delay | | [`azure-static-website`](https://github.com/distr-sh/distr-infrastructure-controllers/tree/main/examples/opentofu/azure-static-website) | A public Azure Storage website showing the deployed version | | [`aws-eks`](https://github.com/distr-sh/distr-infrastructure-controllers/tree/main/examples/opentofu/aws-eks) | An EKS cluster, a PostgreSQL database and a bucket in one zone | ### Configuration The most important environment variables of the OpenTofu controller are listed below. The [repository README](https://github.com/distr-sh/distr-infrastructure-controllers#configuration) documents all of them. | Variable | Default | Description | | ----------------------------- | -------- | ------------------------------------------------------------------------------------------------ | | `INSTANCE_NAME` | required | Name of the installation, passed to OpenTofu as `var.instance_name` | | `APPLY_MODE` | `auto` | `auto` applies every plan, `plan` only logs it for review | | `RECONCILE_INTERVAL` | `15m` | Time between two runs | | `STATE_ENCRYPTION_PASSPHRASE` | | Encrypts the state and the plans, at least 16 characters | | `DESTROY_CONFIRM` | | Set to `INSTANCE_NAME` to destroy all infrastructure, also in `plan` mode | | `PROVIDER_MIRROR` | | OCI repository prefix to install providers from, for installations that can’t reach the registry | | `TF_VAR_` | | Variables of the OpenTofu configuration |
# Kubernetes Controller
> How the Distr Kubernetes controller works: installation, core loop, OCI registry authentication, self-updates, migrating existing releases, and uninstallation.
The Kubernetes controller manages Kubernetes deployments, handling the complete lifecycle of Helm charts in customer environments. It installs and upgrades charts, monitors Kubernetes resource health, supports customer-specific value overrides, and provides rollback capabilities for failed deployments. The [architecture diagram](/docs/controllers/security/kubernetes/#architecture) shows the connections the controller opens, how it runs in the cluster and what it never does. ## Installation and Environment The controller is installed by applying manifests fetched directly from Distr:
```plaintext
kubectl apply -n -f "https:///api/v1/connect?targetId=&targetSecret="
```
The namespace must already exist. The `targetId` and `targetSecret` ensure the controller can only fetch deployments for one specific deployment target. The secret is shown once and never stored by Distr. It can only be verified. The fetched manifests contain the `distr-controller` Deployment: Danger Scaling the controller to more than one replica leads to undefined behavior. Do not alter the deployment manifests.
```yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: distr-controller
spec:
selector:
matchLabels:
app: distr-controller
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: distr-controller
spec:
serviceAccountName: distr-controller
securityContext:
runAsNonRoot: true
containers:
- name: distr-controller
image: 'ghcr.io/distr-sh/distr/kubernetes-controller'
imagePullPolicy: IfNotPresent
env:
- name: DOCKER_CONFIG
value: /opt/config/.docker/
- name: HELM_CACHE_HOME
value: /.cache/helm/
- name: DISTR_CONTROLLER_CONFIG_DIRS
value: |
/opt/config/.controller/env
/opt/config/.controller/auth
envFrom:
- secretRef:
name: distr-controller-auth
- configMapRef:
name: distr-controller-env
volumeMounts:
- name: dockerconfig
mountPath: /opt/config/.docker/
- name: env
mountPath: /opt/config/.controller/env
- name: auth
mountPath: /opt/config/.controller/auth
- name: cache
mountPath: /.cache/
volumes:
- name: env
configMap:
name: distr-controller-env
- name: auth
secret:
secretName: distr-controller-auth
- name: cache
emptyDir: {}
```
The controller can be cluster-scoped or namespace-scoped. This cannot be changed after creation. Cluster-scoped controllers get a `ClusterRoleBinding` to the built-in [`cluster-admin`](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles) role. Namespace-scoped controllers get a `RoleBinding` to a `namespace-admin` role limited to that namespace. [Kubernetes Controller Security](/docs/controllers/security/kubernetes/) describes what either can access. The `distr-controller-env` ConfigMap contains all controller environment variables (same as the Docker controller). The `distr-controller-auth` Secret contains `targetId` and `targetSecret`. ## Core Logic The controller runs the following loop at the interval defined by `DISTR_CONTROLLER_INTERVAL` (default 5 seconds): 1. Fetch the deployments from `DISTR_RESOURCE_ENDPOINT` 2. Uninstall Helm releases that are no longer in the list (undeployed) 3. Install or upgrade Helm releases that are in the list. If images need pulling, the controller reports status `PROGRESSING`. 4. Send the Helm output to `DISTR_STATUS_ENDPOINT`, reporting the deployment’s status. Charts stored in the Distr registry are pinned to the digest their version pointed to when the revision was created. The controller keeps them in its cache volume and pulls each digest only once, so every later revision with the same chart is applied without contacting the registry, online or offline. The cache volume is an `emptyDir`, so it is emptied when the controller pod is recreated. Other charts are pulled once per revision, and retrying a failed revision reuses the chart pulled for it. An install or upgrade that has not finished after 10 minutes is reported as an error rather than left in `PROGRESSING`. The deployment’s Helm options set that timeout per deployment. When the controller pod is terminated, for example by a node drain or by the cluster autoscaler, the controller starts no further install or upgrade. It finishes the one in progress, records its outcome and only then exits. The controller Deployment grants it 15 minutes for that through `terminationGracePeriodSeconds`, so an operation with a longer Helm timeout can still be interrupted. All requests are authenticated with a JWT token obtained from `DISTR_LOGIN_ENDPOINT`. ## Altering the Helm Release The Kubernetes controller uses the Helm API to manage releases, similar to how the [Flux Helm Controller](https://fluxcd.io/flux/components/helm/) works. You can inspect releases with `helm ls -a -n `. Danger Manually running `helm upgrade` or `helm rollback` will stop the Distr controller from making any future changes. If you want the Distr controller to force an update, enable the “Ignore Helm revision skew” checkbox when configuring an update. ## Authentication with OCI Registries If a deployment uses images from the Distr registry, the controller authenticates automatically, so the customer needs no extra steps. To reference Distr registry images in your Helm chart, see [Configuring Helm Charts for Distr Artifacts](/docs/controllers/helm-registry-auth/). You can also provide credentials via an [application entitlement](/docs/platform/application-entitlements/#oci-registry-authentication) (Pro feature). When a deployment is created with that entitlement, the controller logs in to the specified registry using the provided credentials. ## Controller Self Updates When the controller version for a deployment target is updated in Distr, the controller updates itself on the next cycle. It fetches the new manifest from `DISTR_MANIFEST_ENDPOINT` and restarts. ## Controller Image Repository The controller image is pulled from `registry.distr.sh/distr` on Distr Cloud and from `ghcr.io/distr-sh/distr` on self-hosted instances by default. You can have it pulled from your own registry instead, as described in [Controller Image Repository](/docs/platform/branding/#controller-image-repository). ## Migrating an Existing Helm Release The Kubernetes controller only manages releases it knows about. If you already have a Helm release running and want Distr to take it over, you need to create a tracking secret that tells the controller the release exists and which revision it is on. Caution After migration, the Distr controller will manage the release. Do not run `helm upgrade` or `helm rollback` manually. This will cause the controller to stop reconciling. See [Altering the Helm Release](#altering-the-helm-release) for details. ### Step 1: Get the Current Revision Number
```bash
helm history -n --max 1
```
Note the **REVISION** number from the output. ### Step 2: Create the Tracking Secret
```bash
kubectl create secret generic "sh.distr.agent.v1." \
--namespace= \
--from-literal=release='{"id":"00000000-0000-0000-0000-000000000000","revisionId":"00000000-0000-0000-0000-000000000000","releaseName":"","helmRevision":,"deploymentLogsEnabled":false,"phase":"ready"}'
```
Then label it so the controller can discover it:
```bash
kubectl label secret "sh.distr.agent.v1." \
--namespace= \
"agent.distr.sh/deployment="
```
### Step 3: Install the Controller
```bash
kubectl apply -n -f ""
```
The controller discovers the tracking secret, adopts the release, and performs an upgrade on the next reconciliation cycle. ### Fixing Revision Skew If the controller reports `actual helm revision is different from latest deployed by controller`, the revision number in the tracking secret does not match the actual Helm release revision. **Option A: From the Distr UI** Open the deployment in the vendor portal, click **Update**, and use the reset button to sync the controller’s Helm revision to the current release revision. **Option B: Patch the Secret**
```bash
kubectl patch secret "sh.distr.agent.v1." \
--namespace= --type='strategic' \
-p '{"stringData":{"release":"{\"id\":\"00000000-0000-0000-0000-000000000000\",\"revisionId\":\"00000000-0000-0000-0000-000000000000\",\"releaseName\":\"\",\"helmRevision\":,\"logsEnabled\":false,\"phase\":\"ready\"}"}}'
```
## Security The controller manages Helm releases through the Kubernetes API, so it has the access of its service account. [Kubernetes Controller Security](/docs/controllers/security/kubernetes/) describes what it can reach in the cluster, which operations it runs and which credentials it keeps there. The other pages of [Controller Security](/docs/controllers/security/) cover its network connections, the data it sends to Distr and how to verify its image. ## Uninstalling Before removing the controller, undeploy all managed deployments via the UI or API. Set your context to the controller’s namespace:
```shell
kubectl config set-context --current --namespace={{deployment-namespace}}
```
Then remove the controller and its associated resources:
```shell
kubectl delete deployment/distr-controller secrets/distr-controller-auth configmaps/distr-controller-env serviceaccounts/distr-controller clusterrolebindings/distr-controller-{{deployment-namespace}}
```
Deployment targets connected with Distr 4.2 or earlier use the former `distr-agent` names for these resources.
# Logs & Metrics
> Monitor deployment health with controller logs, container logs, deployment status indicators, and host metrics collection in Distr.
Distr gives you observability for every deployment target via **logs** that let you dig into what happened, and **metrics** that track resource usage over time. ## Deployment Status Each deployment within a target also has its own colored dot and status label. This tells you whether the application itself is healthy, not just whether the controller is reachable: * ⚫ **No status**: The controller has not reported anything for this deployment yet. * 🔴 **Error**: Something is wrong. Healthchecks are failing or the deployment encountered an error. * 🟡 **Stale**: The controller has not reported this deployment’s health in the last 60 seconds. * 🔵 **Progressing**: The controller is installing or upgrading the deployment, or containers are still starting up. * **O** **Running**: The deployment is running but no healthchecks are configured. * 🟢 **Healthy**: The deployment is running and all healthchecks are passing. Clicking the status label (e.g. “Running”) opens the revision history of the deployment, which shows the latest status the controller reported for each revision along with its message. ### Healthchecks Docker Controller Update Required Docker healthcheck reporting requires the Distr platform and Docker Controller version 2.7.0 or higher. Configure healthchecks so Distr can distinguish between **Running** (no checks configured) and **Healthy** (checks passing). Without them, a deployment that starts but serves errors will still show as Running. * **Docker deployments**: Add a [healthcheck](https://docs.docker.com/reference/compose-file/services/#healthcheck) to your service definition in the Compose file. * **Kubernetes deployments**: Configure [container probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) (liveness, readiness, or startup probes). ## Log Viewer The log viewer is a dedicated page for inspecting all log data associated with a deployment target. Open it by clicking the deployment target name, clicking **Inspect** on a deployment, or selecting **Controller Logs** from the **⋮** menu. Once open, use the breadcrumb dropdowns to switch between deployment targets and views. The view dropdown lets you choose what to inspect: * **Controller Logs**: Raw output from the Distr controller process: connection events, reconciliation cycles, errors. Always available. * **Container resources**: Application container logs (e.g. `backend-1`, `proxy-1`). Only available when [log collection is enabled](#container-logs). You can select several resources at once to see their logs interleaved. **Inspect** preselects all [active resources](#active-and-archived-resources) of the deployment.  The log viewer auto-refreshes every 10 seconds. Use the **From** and **To** fields to view a specific time window, or the **Filter** field to search with plain text or a regular expression. Turn on **Exclude** to hide the matching entries instead. You can pin any log entry by clicking the thumbtack icon on hover. The row stays sticky while you scroll, making it easy to compare entries. ### Exporting Logs **Export all** downloads the currently selected view as a plain text file. The export uses the same selection as the table on screen, so the **From**, **To** and **Filter** fields all apply to it. A single export contains at most **1,000,000 lines**. When the limit is reached, the download ends with a note that the export was truncated. Since the export starts at the newest line, an export without a time range keeps the most recent lines and drops the oldest ones. Set **From** and **To** to a narrower window to get the lines you are actually looking for, and add a **Filter** to cut the export down further, for example to a specific error message or request ID. ### Controller Logs Controller logs show the raw output from the Distr controller process itself: connection events, deployment reconciliation cycles, errors, and status reports. These logs belong to the deployment target, not to any individual deployment, and are always available without any setup. ### Container Logs Container logs show the output from your application containers. Log collection can be configured in two places: * **When creating a deployment**: The deployment form includes an **Enable log collection** toggle in the configuration step. It is enabled by default. * **After deployment**: Click the **⋮** menu on the deployment to enable or disable log collection at any time.  The first logs should appear within 30 seconds. To disable, open the same menu and select **Disable log collection**. #### Active and Archived Resources The view dropdown separates container resources into **active** and **archived**: * **Active**: The resource has produced logs in one of the five most recent deployment revisions. * **Archived**: The resource only has logs from older revisions, typically because a container was renamed or removed during an update. Click **Show archived** at the bottom of the dropdown to reveal archived resources. ## Metrics Metrics give you visibility into the resource usage of the host or cluster running your deployments. Metrics collection can be toggled per deployment target. ### Enabling Metrics 1. Navigate to the deployment target in the Deployments view. 2. Click the **⋮** menu and select **Edit**. 3. Enable the metrics toggle. Once enabled, the controller scrapes and reports metrics every 30 seconds. ### Collected Metrics The following metrics are collected for both Docker and Kubernetes deployment targets: | Metric | Description | | ---------------- | --------------------------------------------------------------------------------------- | | **CPU cores** | Total number of CPU cores on the host (Docker) or across all cluster nodes (Kubernetes) | | **CPU usage** | Current overall CPU usage as a percentage | | **Memory** | Total memory on the host or across all cluster nodes | | **Memory usage** | Current overall memory usage as a percentage | The Docker controller also collects **disk metrics** for device-backed filesystems on the host, reported as one entry per block device: | Metric | Description | | ------------------- | ----------------------------------------------------- | | **Device** | The block device (e.g. `/dev/sda1`) | | **Mount path** | A representative mount path for the device (e.g. `/`) | | **Filesystem type** | The filesystem type (e.g. `ext4`, `xfs`) | | **Total bytes** | Total disk capacity | | **Used bytes** | Current disk usage | Disk metrics are reported per device, not per mount point; multiple mount points for the same block device are deduplicated into a single metric. Read-only and virtual filesystems (such as SquashFS mounts) are excluded. You can configure [alerts](/docs/controllers/alerts/#resource-usage-thresholds) to notify you when disk usage exceeds a threshold. ### Log Storage The Docker controller also reports how much disk space container logs occupy, so you can tell which container is filling up a device. Rotated log files are included in the number. * **Per container**: shown in the **Logs** column next to CPU and memory for every container of a deployment. * **For the controller itself**: shown as **Controller logs** in the metrics tooltip of the deployment target, covering the controller and its autoheal sidecar. Nothing is reported for a container whose [logging driver](https://docs.docker.com/engine/logging/configure/) does not write files, such as `journald` or `syslog`, because those logs are not stored on the container’s behalf. Since log sizes are collected together with CPU and memory, only running containers are counted. ### Image Storage The Docker controller reports how much disk space the image store occupies, shown as **Container images** in the metrics tooltip of the deployment target. It is the same number as the `SIZE` column of `docker system df`: every image on the host, including images no container currently uses, with layers shared between images counted once. Because the Docker daemon has to walk the whole image store to answer, this number is collected every five minutes rather than every 30 seconds like CPU and memory. It is sent with the next regular metrics report, so it can be up to five minutes older than the values next to it. Enable [image cleanup](/docs/controllers/docker-controller/#image-cleanup) on a deployment target to have the controller remove the images of previous versions instead of letting them accumulate. ## Reconnect Reconnect generates a new connection command for a deployment target. Use it when the controller has lost its connection and cannot recover on its own. To reconnect: 1. Click the **⋮** menu on the deployment target and select **Reconnect**. 2. Review the message and confirm. Distr issues a new secret next to the current one. 3. Copy the new command and run it on the deployment host. Until a controller connects to Distr with the new secret, the deployment target shows a **Reconnect pending** badge next to its name. The current secret stays valid during that time, so the running controller keeps working. Once a controller has connected with the new secret, the previous one is invalidated and the badge disappears. While a reconnect is pending, the **⋮** menu shows **Cancel reconnect** instead of **Reconnect**. To get a new command, for example because you lost the previous one, [cancel the pending reconnect](#cancel-a-pending-reconnect) and reconnect again. Reconnecting does not affect your running deployments. If your application was running before the reconnect, it continues running. The controller only manages the connection back to Distr, not the application lifecycle. Caution **The previous secret stops working once a controller has connected with the new one.** A controller still running with the previous secret keeps working until it restarts or its session expires, which takes at most 24 hours by default. After that, it can no longer authenticate. If you use an automated bootstrap script (for example, a cloud-init script, an EC2 Auto Scaling launch template, or any script that runs the controller install command on startup), you must update that script with the new command before new instances launch. Instances using the old command fail to connect once the reconnect is complete. ### Cancel a pending reconnect If you no longer need the new command, for example because it was shared with the wrong person or the controller recovered on its own, cancel the reconnect: 1. Click the **⋮** menu on the deployment target and select **Cancel reconnect**. The entry is only shown while a reconnect is pending. 2. Review the message and confirm. Distr deletes the pending secret, so the command issued with it stops working, and the **Reconnect pending** badge disappears. The current secret stays valid, so the running controller keeps working. ## Troubleshooting: Stale Status A **Stale** deployment target means the controller was previously connected but has not reported its health in the last 60 seconds. It does **not** mean your deployment is broken. Your application may still be running normally. Distr has simply lost contact with the controller. **Step 1: Check the Controller Logs** Open the **⋮** menu on the deployment target and select **Controller Logs**. Look for the last timestamp in the log to see when the controller stopped reporting, and check for any error messages that indicate why it disconnected. **Step 2: Reconnect** If you have access to the deployment host: 1. Click **Reconnect** in the **⋮** menu. If the menu shows **Cancel reconnect** instead, a reconnect is already pending: cancel it first. 2. Confirm. A new `targetSecret` is generated. The old one stays valid until a controller connects with the new one. 3. Run the new install command on the deployment host to re-establish the connection. If you do not have direct access to the deployment host, ask the customer to reconnect from the [Customer Portal](/docs/platform/customer-portal/deployments/). They will find the same **⋮** menu and **Reconnect** option in their deployment target view. Caution **If you use an automated bootstrap script** (e.g. a cloud-init script, an EC2 Auto Scaling launch template, or any script that installs the controller on startup), make sure to update it with the new command after reconnecting. The old command contains the previous `targetSecret`, which stops working once a controller has connected with the new one. New instances launched with the old command then fail to connect.
# Pre-Flight Checks
> Validate target environments before deployment by checking Docker or Kubernetes version, CPU, RAM, disk space and more with custom pre-flight check scripts.
Pre-flight checks are validation scripts that run **before** your application is deployed to a customer environment. They verify that the target system meets the minimum requirements (the correct Docker or Kubernetes version, sufficient CPU, memory and disk space) and prevent deployments from proceeding when critical conditions are not met. ## Why Pre-Flight Checks Matter Deploying software to customer-managed infrastructure means you don’t control the environment. Without pre-flight checks, deployments can fail silently or produce hard-to-diagnose issues: * **Docker version mismatches**: A customer runs an outdated Docker CLI that doesn’t support features your Compose file relies on (e.g., `docker compose` v2 syntax, health check options, or specific network drivers). * **Insufficient resources**: The target machine doesn’t have enough CPU cores, RAM, or free disk space to run your application, leading to OOM kills, slow performance, or failed container starts. * **Missing dependencies**: Required tools, kernel modules, or system libraries are not installed. * **Network issues**: The target machine cannot reach required endpoints such as container registries or external APIs. Pre-flight checks catch these problems **before** deployment begins, giving customers clear, actionable error messages instead of cryptic container failures. ## How It Works in Distr Pre-flight check scripts are configured separately for Docker and Kubernetes deployment targets, since the two environments need different checks. Once pre-flight checks are enabled for your organization and a script is configured for a platform, the connect instructions delivered to your customers on that platform change: * **Without pre-flight checks:** Customers receive a `docker compose` or `kubectl apply` command directly. * **With pre-flight checks:** Customers receive a `curl ... | sh` command that fetches a shell script which: 1. Runs your pre-flight check scripts to validate the environment. 2. Reports any failing checks with clear error messages. 3. Only proceeds with `docker compose up` or `kubectl apply` if all checks pass. For Docker, the shell script is also used when it should be run with `sudo`, even if no script is configured. This approach is transparent to customers: they run a single command and get immediate feedback if their environment doesn’t meet requirements. You can configure pre-flight check scripts in the **Organization Settings** under **Controllers**. The scripts are inlined into a `#!/bin/sh` script, so write them in POSIX shell rather than Bash. > **Tip:** Pre-flight check scripts are not limited to validation. You can also use them to install or update software on the target machine. For example, you can ensure a specific package is installed or upgrade a dependency to a compatible version before the deployment starts. > **Note:** Pre-flight check scripts are only executed during the initial connect or a reconnect. A reconnect will not delete any existing deployment. It re-runs the connect scripts and then resumes the deployment. ## Example Pre-Flight Check Scripts Below are practical shell scripts you can use as pre-flight checks. Each script exits with a non-zero status and prints an error message if the check fails. ### Minimum Docker CLI Version Ensures the Docker CLI meets a minimum version requirement. This is useful when your Compose file uses features introduced in a specific Docker version.
```sh
set -e
REQUIRED_VERSION="24.0.0"
if ! command -v docker > /dev/null 2>&1; then
echo "FAIL: Docker is not installed."
exit 1
fi
DOCKER_VERSION=$(docker version --format '{{.Client.Version}}' 2>/dev/null || echo "0.0.0")
version_ge() {
printf '%s\n%s' "$2" "$1" | sort -V -C
}
if ! version_ge "$DOCKER_VERSION" "$REQUIRED_VERSION"; then
echo "FAIL: Docker version $DOCKER_VERSION is below the required minimum $REQUIRED_VERSION."
exit 1
fi
echo "OK: Docker version $DOCKER_VERSION meets the minimum requirement ($REQUIRED_VERSION)."
```
### Minimum CPU Cores Checks that the host has enough CPU cores to run your application.
```sh
set -e
REQUIRED_CORES=2
AVAILABLE_CORES=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 0)
if [ "$AVAILABLE_CORES" -lt "$REQUIRED_CORES" ]; then
echo "FAIL: Only $AVAILABLE_CORES CPU core(s) available, but at least $REQUIRED_CORES required."
exit 1
fi
echo "OK: $AVAILABLE_CORES CPU core(s) available (minimum: $REQUIRED_CORES)."
```
### Minimum Available RAM Verifies the system has enough total memory. Adjust the threshold based on your application’s requirements.
```sh
set -e
REQUIRED_RAM_MB=4096
if [ -f /proc/meminfo ]; then
TOTAL_RAM_KB=$(grep MemTotal /proc/meminfo | awk '{print $2}')
TOTAL_RAM_MB=$((TOTAL_RAM_KB / 1024))
elif command -v sysctl > /dev/null 2>&1; then
TOTAL_RAM_BYTES=$(sysctl -n hw.memsize 2>/dev/null || echo 0)
TOTAL_RAM_MB=$((TOTAL_RAM_BYTES / 1024 / 1024))
else
echo "FAIL: Unable to determine available RAM."
exit 1
fi
if [ "$TOTAL_RAM_MB" -lt "$REQUIRED_RAM_MB" ]; then
echo "FAIL: Only ${TOTAL_RAM_MB}MB RAM available, but at least ${REQUIRED_RAM_MB}MB required."
exit 1
fi
echo "OK: ${TOTAL_RAM_MB}MB RAM available (minimum: ${REQUIRED_RAM_MB}MB)."
```
### Minimum Free Disk Space Checks that the target mount point (typically `/` or `/var/lib/docker`) has enough free disk space.
```sh
set -e
REQUIRED_DISK_GB=20
MOUNT_POINT="/"
AVAILABLE_KB=$(df --output=avail "$MOUNT_POINT" 2>/dev/null | tail -1)
AVAILABLE_GB=$((AVAILABLE_KB / 1024 / 1024))
if [ "$AVAILABLE_GB" -lt "$REQUIRED_DISK_GB" ]; then
echo "FAIL: Only ${AVAILABLE_GB}GB free disk space on $MOUNT_POINT, but at least ${REQUIRED_DISK_GB}GB required."
exit 1
fi
echo "OK: ${AVAILABLE_GB}GB free disk space on $MOUNT_POINT (minimum: ${REQUIRED_DISK_GB}GB)."
```
## Combining Checks Into a Single Script You can combine multiple checks into one pre-flight script. The script runs all checks and reports all failures at once, so customers can fix everything in a single pass.
```sh
ERRORS=0
# --- Docker version check ---
REQUIRED_DOCKER_VERSION="24.0.0"
if ! command -v docker > /dev/null 2>&1; then
echo "FAIL: Docker is not installed."
ERRORS=$((ERRORS + 1))
else
DOCKER_VERSION=$(docker version --format '{{.Client.Version}}' 2>/dev/null || echo "0.0.0")
if ! printf '%s\n%s' "$REQUIRED_DOCKER_VERSION" "$DOCKER_VERSION" | sort -V -C; then
echo "FAIL: Docker version $DOCKER_VERSION is below the required minimum $REQUIRED_DOCKER_VERSION."
ERRORS=$((ERRORS + 1))
else
echo "OK: Docker version $DOCKER_VERSION"
fi
fi
# --- CPU check ---
REQUIRED_CORES=2
AVAILABLE_CORES=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 0)
if [ "$AVAILABLE_CORES" -lt "$REQUIRED_CORES" ]; then
echo "FAIL: Only $AVAILABLE_CORES CPU core(s), need at least $REQUIRED_CORES."
ERRORS=$((ERRORS + 1))
else
echo "OK: $AVAILABLE_CORES CPU core(s)"
fi
# --- RAM check ---
REQUIRED_RAM_MB=4096
if [ -f /proc/meminfo ]; then
TOTAL_RAM_KB=$(grep MemTotal /proc/meminfo | awk '{print $2}')
TOTAL_RAM_MB=$((TOTAL_RAM_KB / 1024))
else
TOTAL_RAM_MB=0
fi
if [ "$TOTAL_RAM_MB" -lt "$REQUIRED_RAM_MB" ]; then
echo "FAIL: Only ${TOTAL_RAM_MB}MB RAM, need at least ${REQUIRED_RAM_MB}MB."
ERRORS=$((ERRORS + 1))
else
echo "OK: ${TOTAL_RAM_MB}MB RAM"
fi
# --- Disk space check ---
REQUIRED_DISK_GB=20
AVAILABLE_KB=$(df --output=avail / 2>/dev/null | tail -1)
AVAILABLE_GB=$((AVAILABLE_KB / 1024 / 1024))
if [ "$AVAILABLE_GB" -lt "$REQUIRED_DISK_GB" ]; then
echo "FAIL: Only ${AVAILABLE_GB}GB free disk space, need at least ${REQUIRED_DISK_GB}GB."
ERRORS=$((ERRORS + 1))
else
echo "OK: ${AVAILABLE_GB}GB free disk space"
fi
# --- Summary ---
echo ""
if [ "$ERRORS" -gt 0 ]; then
echo "Pre-flight checks failed with $ERRORS error(s). Please resolve the issues above before deploying."
exit 1
fi
echo "All pre-flight checks passed."
```
## Pre-Flight Checks for Kubernetes Kubernetes pre-flight check scripts run on the machine of the customer who connects the controller, with their kubeconfig. They check the cluster rather than the host, for example the Kubernetes version, the available StorageClasses, required CRDs or the permissions of the user. The namespace of the deployment target is available as `$DISTR_NAMESPACE`. The connect command for Kubernetes deployment targets then requires `curl` and a POSIX shell in addition to `kubectl`.
```sh
ERRORS=0
# --- Kubernetes version check ---
REQUIRED_MINOR=28
SERVER_MINOR=$(kubectl version -o json 2>/dev/null | grep -A 10 '"serverVersion"' | grep '"minor"' | head -1 | tr -dc '0-9')
if [ -z "$SERVER_MINOR" ]; then
echo "FAIL: Unable to reach the Kubernetes cluster."
ERRORS=$((ERRORS + 1))
elif [ "$SERVER_MINOR" -lt "$REQUIRED_MINOR" ]; then
echo "FAIL: Kubernetes 1.$SERVER_MINOR is below the required minimum 1.$REQUIRED_MINOR."
ERRORS=$((ERRORS + 1))
else
echo "OK: Kubernetes 1.$SERVER_MINOR"
fi
# --- Default StorageClass check ---
if kubectl get storageclass -o jsonpath='{.items[*].metadata.annotations.storageclass\.kubernetes\.io/is-default-class}' 2>/dev/null | grep -q true; then
echo "OK: A default StorageClass exists"
else
echo "FAIL: No default StorageClass is configured."
ERRORS=$((ERRORS + 1))
fi
# --- Permission check ---
if kubectl auth can-i create deployments -n "$DISTR_NAMESPACE" > /dev/null 2>&1; then
echo "OK: Allowed to create deployments in $DISTR_NAMESPACE"
else
echo "FAIL: Not allowed to create deployments in namespace $DISTR_NAMESPACE."
ERRORS=$((ERRORS + 1))
fi
# --- Summary ---
echo ""
if [ "$ERRORS" -gt 0 ]; then
echo "Pre-flight checks failed with $ERRORS error(s). Please resolve the issues above before deploying."
exit 1
fi
echo "All pre-flight checks passed."
```
## Writing Your Own Checks When writing custom pre-flight check scripts, follow these conventions: * **Exit with a non-zero status** on failure. This signals Distr to abort the deployment. * **Print clear messages** prefixed with `FAIL:` or `OK:` so customers understand what went wrong. * **Keep scripts idempotent and safe**: if they install or update software or otherwise change system state, they must be safe to run multiple times and avoid destructive side effects. * **Test on the target OS**: Linux distributions may differ in available commands (e.g., `nproc` vs `sysctl`). Include fallbacks where possible. * **Set reasonable thresholds**: document your minimums and explain why they are required. ## Next Steps * **[Deployment Controllers](/docs/controllers/)**: Learn how Distr controllers manage deployments on customer infrastructure * **[Automatic Deployments from GitHub](/docs/integrations/github-actions/)**: Automate your CI/CD pipeline with the Distr GitHub Action
# Secrets Management
> Store sensitive configuration values centrally in Distr and reference them in Docker and Kubernetes deployments using template syntax.
Distr provides a centralized secret management system that allows you to securely store sensitive configuration values and reference them in your deployments using template syntax. The secret values are substituted at deploy time, so they never appear in your compose files, Helm values, or deployment logs. ## What are Secrets? Secrets are key-value pairs that store sensitive information such as API keys, passwords, database credentials, or any other confidential data that your application needs. Instead of hardcoding these values in environment files or Helm values, you can store them centrally in Distr and reference them using template syntax. For example, if your application needs a database password, you can create a secret with key `DATABASE_PASSWORD` and reference it in your deployment configuration:
```plaintext
DATABASE_URL=postgresql://user:{{ .Secrets.DATABASE_PASSWORD }}@host:5432/db
```
When the deployment is created, the template is automatically replaced with the actual secret value. ## Benefits of Using Secrets * **Security**: Secret values are encrypted at rest and redacted from deployment logs; your deployment configuration can reference them via templates instead of storing them in plaintext * **Centralized Management**: Update secrets in one place and have them automatically available to all deployments * **Audit Trail**: Track who created or updated each secret and when * **Access Control**: Secrets are scoped to organizations and customer organizations * **Log Protection**: Secret values are automatically redacted from deployment logs, controller logs and [support bundles](/docs/platform/support-bundles/#redaction), along with common credential patterns ## Creating and Managing Secrets ### Accessing the Secrets Page 1. Navigate to the Distr web interface 2. Click on **Secrets** in the sidebar navigation 3. For vendor organizations: You can manage both vendor-level secrets and customer-specific secrets 4. For customer organizations: You can only view and manage secrets for your own organization ### Creating a Secret 1. Click the **Create Secret** button on the Secrets page 2. Enter a **Key** for your secret (must start with a letter and contain only alphanumeric characters and underscores) 3. Enter the **Value** for your secret 4. Click **Save** ### Updating a Secret 1. Find the secret you want to update in the secrets list 2. Click the **Edit** button next to the secret 3. Enter the new value (the key cannot be changed) 4. Click **Save** If any active deployments reference this secret, Distr will show you which deployment targets are affected before saving. Confirming will save the new value and automatically trigger a redeployment on those targets. ### Deleting a Secret 1. Find the secret you want to delete in the secrets list 2. Click the **Delete** button 3. Confirm the deletion Caution Deleting a secret will cause any deployments that reference it to fail during deployment or validation. Make sure no active deployments are using the secret before deleting it. ## Using Secrets in Deployments Secrets can be referenced in two types of deployment configurations: ### Environment Files (`.env`) Use secrets in your environment files with Go template syntax:
```dotenv
# Reference a secret directly
API_KEY={{ .Secrets.API_KEY }}
# Use secrets in connection strings
DATABASE_URL=postgresql://user:{{ .Secrets.DB_PASSWORD }}@localhost:5432/mydb
# Combine multiple secrets
AUTH_TOKEN={{ .Secrets.CLIENT_ID }}:{{ .Secrets.CLIENT_SECRET }}
```
### Helm Values (YAML) For Kubernetes deployments, reference secrets in your Helm values:
```yaml
database:
host: db.example.com
password: {{.Secrets.DB_PASSWORD}}
api:
credentials:
username: admin
password: {{.Secrets.ADMIN_PASSWORD}}
config:
githubToken: {{.Secrets.GITHUB_TOKEN}}
```
## Template Syntax Secrets use Go’s [`text/template`](https://pkg.go.dev/text/template) syntax for substitution. ### Basic Secret Reference
```plaintext
{{ .Secrets.SECRET_KEY_NAME }}
```
The secret key name must match exactly (case-sensitive) with a secret that exists in your organization. ### Conditionals Use `if` statements to handle optional secrets:
```plaintext
API_URL={{ if .Secrets.API_URL }}{{ .Secrets.API_URL }}{{ else }}https://api.example.com{{ end }}
```
In YAML:
```yaml
api:
url: {{ if .Secrets.API_URL }}{{ .Secrets.API_URL }}{{ else }}https://api.example.com{{ end }}
```
### Combining Secrets You can combine multiple secrets in a single value:
```plaintext
CREDENTIALS={{ .Secrets.USERNAME }}:{{ .Secrets.PASSWORD }}
```
## Secret Naming Conventions Secret keys must follow these rules: * Must start with a letter (a-z, A-Z) * Can contain letters, numbers, and underscores * Cannot start with a number or underscore * Cannot contain spaces or special characters (except underscore) **Valid examples**: * `API_KEY` * `database_password` * `GitHubToken123` * `stripe_api_key_prod` **Invalid examples**: * `_API_KEY` (starts with underscore) * `123_KEY` (starts with number) * `API-KEY` (contains hyphen) * `API KEY` (contains space) ## Secret Scoping Secrets are scoped either to a vendor organization or each customer. The scope determines which deployments can use a secret and where you manage it. ### Vendor-level secrets Vendor-level secrets are available to your internal deployments (deployment targets without a customer organization). They are not injected into customer deployments. If a customer deployment needs a credential, create it as a customer-specific secret for that customer. Use vendor-level secrets for credentials that only your internal infrastructure needs, for example a staging environment token or a third-party API key used in vendor-managed test deployments. To create or manage vendor-level secrets: 1. In the Vendor Portal sidebar, click **Secrets**. 2. Create, edit, or delete secrets from this view. ### Customer-specific secrets Customer-specific secrets are only available to deployments for one specific customer. Use these for credentials that belong to a single customer, for example a customer’s own database password or an API key specific to their environment. Customer-specific secrets are managed from the **Customers** section, not the **Secrets** page: 1. In the Vendor Portal sidebar, click **Customers**. 2. Find the customer and click **Manage secrets** next to them. 3. Create, edit, or delete secrets from this view. Customer-specific secrets are only injected into that customer’s deployments. They are not available to other customers and do not appear in the vendor-level secrets list. ### Customer Organizations As a customer, you can create and manage secrets for your own organization from the Customer Portal. For the full customer-side guide, see [Customer Portal Secrets](/docs/platform/customer-portal/secrets/). ## Security Considerations ### Log Redaction Distr automatically redacts secret values from deployment logs. If a log message contains a secret value, it will be replaced with `********` before being displayed or exported. This protects your secrets even if they accidentally appear in application logs. ### Secret Storage Secret values are encrypted with AES-256-GCM before they are written to the Distr database, so a database dump does not contain them. If you self-host Distr, the key is `DATABASE_ENCRYPTION_KEY`, see [Security & Encryption](/docs/self-hosting/security#database-encryption) for how to store and rotate it. The deployment values and env files that reference a secret are encrypted the same way. To keep a value out of Distr entirely, create it in the customer environment and reference it by name, see [External Secrets](/docs/controllers/security/external-secrets/). ### Access Control * Only users with `read_write` or `admin` roles can create, update, or delete secrets * All users in an organization can view secret keys (but not values) * Secret values are never returned by the API after creation (only keys and metadata) ### Best Practices 1. **Rotate secrets regularly**: Update secret values periodically and redeploy affected applications 2. **Use minimal scope**: Create customer-specific secrets when possible rather than vendor-wide secrets 3. **Don’t log secrets**: Ensure your application code doesn’t intentionally log secret values 4. **Use descriptive keys**: Make it clear what each secret is for without revealing sensitive information 5. **Test in non-production first**: Verify secret references work correctly before deploying to production ## Error Handling ### Missing Secrets If a deployment configuration references a secret that doesn’t exist, the deployment validation will fail with an error:
```plaintext
template execution error: map has no entry for key "SECRET_NAME"
```
To fix this, create the missing secret or remove the reference from your configuration. ### Template Syntax Errors If your template syntax is invalid, you’ll receive an error during deployment validation:
```plaintext
template parsing error: unexpected "}" in operand
```
Check your template syntax for missing braces, quotes, or other syntax issues. ### Empty Secret Values Caution Secret values cannot be empty. If you need to represent an empty value, consider using a placeholder string or removing the secret reference entirely.
# Controller Security
> Distr controllers are open source, open no inbound ports and only pull their deployments from Distr. This section explains what they do in a customer environment and which of their settings you control.
A controller runs in the customer’s environment and manages the deployments of one deployment target. This page explains why you can run it there without opening the environment up, and which of its settings you control. ## Open Source The Docker controller and the Kubernetes controller are open source under the Apache 2.0 license. Their code is in the [Distr repository on GitHub](https://github.com/distr-sh/distr), in `cmd/controller/docker` and `cmd/controller/kubernetes`. The autoheal service, in `docker-autoheal`, is an MIT-licensed adaptation of [willfarrell/docker-autoheal](https://github.com/willfarrell/docker-autoheal). You can read all of it before you install a controller. Public GitHub Actions workflows build the images from that code. Every released image comes with an SBOM and build provenance and is signed with cosign, so you can check that the image you pull was built by that workflow. The commands are on the [Images](/docs/controllers/security/images/) page. Please report a vulnerability privately through [GitHub’s vulnerability reporting](https://github.com/distr-sh/distr/security/advisories/new) rather than in a public issue. Fixed vulnerabilities are announced as [security advisories](https://github.com/distr-sh/distr/security/advisories) in the same repository, which you can watch to be notified. ## Pull Only, No Open Ports The controller connects to Distr. Distr never connects to the controller. Every few seconds the controller fetches its deployments over HTTPS and reports back over the same connection. The environment needs outbound access to Distr and the registries but no firewall rule for incoming traffic. The controller opens no port that is reachable from outside. Distr cannot open a connection into the environment or run a command there. It can only change what the controller fetches next. [Network & Authentication](/docs/controllers/security/network/) lists every connection and the local health check. ## Secrets That Never Reach Distr [Distr Secrets](/docs/controllers/secrets/) are encrypted at rest, but the controller still receives their values from Distr. A password, an API key or a certificate that should never leave the customer environment can be created there instead, as a Kubernetes Secret or a file on the Docker host. The deployment then refers to it by name, and Distr only ever sees that name. [External Secrets](/docs/controllers/security/external-secrets/) shows how for each deployment type. ## What You Can Configure Log collection, metrics, automatic controller and application updates, image cleanup, autoheal and the scope of a Kubernetes controller are settings you control, most of them per deployment target. The [Configuration Reference](/docs/controllers/security/configuration/) lists each of them with its default. ## In This Section * [Docker Controller](/docs/controllers/security/docker/) covers the mounts, the Docker commands and the credentials on a Docker host. * [Kubernetes Controller](/docs/controllers/security/kubernetes/) covers the RBAC of both scopes and the resources, operations and credentials in a cluster. * [Network & Authentication](/docs/controllers/security/network/) lists the connections a controller opens and explains how it logs in to Distr. * [Data Sent to Distr](/docs/controllers/security/data-sent-to-distr/) lists the logs, status and metrics a controller reports. * [External Secrets](/docs/controllers/security/external-secrets/) shows how to reference secrets that are created in the customer environment. * [Images](/docs/controllers/security/images/) describes what the controller images contain and how to verify their signatures. * [Configuration Reference](/docs/controllers/security/configuration/) lists the settings of a controller with their defaults.
# Configuration Reference
> The settings that decide what a Distr controller collects, what it sends to Distr and what it changes on its own, with their defaults.
These settings decide what a controller collects, what it sends and what it changes on its own. Most of them belong to the deployment target, and any user with the `read_write` or `admin` role in the vendor organization or in the customer organization of the deployment target can change them. The table shows the defaults of the Distr UI. A deployment target created through the API has every switch off unless the request turns it on. | Setting | Default in the UI | What it controls | | --------------------------------------------------------- | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Collect application logs | On | Whether the stdout and stderr of the deployments’ containers are sent to Distr. **Collect logs after** limits this to logs newer than a point in time | | Report metrics | On, off for namespace scope | Whether the usage of the host or cluster and of the deployments’ containers is sent to Distr. On Docker it also decides whether the host filesystem is mounted into the controller | | Automatic controller updates | On | Whether the controller updates itself as soon as a new version is released. With it off, an editor starts each update from the deployment target, which shows the changelog first | | Automatic application updates, per deployment | Off | Whether a deployment follows the latest version of its application. Vendors and customers can both turn it on, see [Automatic Updates](/docs/controllers/deployment/#automatic-updates) | | Image cleanup, Docker only | On | Whether the images of the previous revision are removed after a successful update | | Autoheal for all containers, Docker only, set at creation | On | Whether autoheal restarts every unhealthy container on the host or only the controller | | Custom Docker endpoint, Docker only | Off | Which Docker socket the controller uses instead of `/var/run/docker.sock` | | Scope, Kubernetes only, set at creation | Cluster | Whether the controller gets `cluster-admin` or only the permissions of its namespace | | Custom resource requirements, Kubernetes only | Off | The CPU and memory of the controller pod instead of 256Mi of memory and a 500m CPU limit | | Controller image repository, organization setting | `registry.distr.sh/distr` on Distr Cloud, `ghcr.io/distr-sh/distr` when self-hosted | Which registry the controller images are pulled from, see [Controller Image Repository](/docs/platform/branding/#controller-image-repository) | A setting that ends up in the controller’s Compose file or manifest, such as metrics on Docker, the Docker endpoint, the resource requirements or the image repository, reaches the environment the next time that file is applied, by a controller update or a reconnect. The other settings apply on the controller’s next cycle.
# Data Sent to Distr
> The controller logs, deployment status, container logs and metrics that Distr controllers report to Distr, when they report them and how Distr redacts secrets in them.
| Data | When | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Controller logs at debug level, including connection events, reconciliation cycles, errors and the output of Docker and Helm operations | Always | | The status of every deployment, whose message can contain the Compose progress, the Helm output, image names and error output | Always | | stdout and stderr of the containers of the deployments | When [log collection](/docs/controllers/logs-and-metrics/#container-logs) is enabled | | Docker: CPU, memory and disk usage of the host with the device names and mount paths, the size of the image store and the CPU, memory, limits and log size of every container of the deployments | When [metrics](/docs/controllers/logs-and-metrics/#metrics) are enabled | | Kubernetes: CPU and memory capacity and usage summed over all nodes, the usage of the controller pod and the CPU, memory and limits of every container of the deployments with its pod and workload names | When [metrics](/docs/controllers/logs-and-metrics/#metrics) are enabled | The controller reads no logs or metrics of containers outside its deployments apart from its own. Distr masks the secrets of the deployment target and common credential patterns in logs before it stores them, see [Log Redaction](/docs/controllers/secrets/#log-redaction). Status messages are stored as reported. Log collection and metrics are settings of the deployment target, see the [Configuration Reference](/docs/controllers/security/configuration/). ## Example Controller Logs These lines are taken from the controller logs of a Kubernetes and a Docker deployment target, as Distr shows and exports them. Every line has the time, the level, the place in the controller’s code, the message and the fields of the message. Lines written by Helm carry `"component": "helm"` instead of a place in the code. The container logs of the deployments are not part of the controller logs. * Kubernetes
```text
2026-11-09T14:33:26Z info kubernetes/main.go:243 controller version has changed. starting self-update
2026-11-09T14:33:28Z info kubernetes/main.go:265 self-update has been applied
2026-11-09T14:45:04Z info kubernetes/main.go:105 kubernetes controller is starting {"version": "4.9.0-rc.1", "commit": "278beaa", "release": true}
2026-11-09T14:45:09Z info controllerclient/client.go:193 token has expired or is about to expire
2026-11-09T14:45:10Z info controllerclient/client.go:202 token refreshed
2026-11-09T15:52:10Z debug kubernetes/main.go:239 controller version is up to date
2026-11-09T15:52:11Z debug kubernetes/metrics.go:47 node metrics {"node": "minikube", "cpuUsage": 713, "memUsage": 1690030080}
2026-11-09T15:52:12Z debug getting release history {"component": "helm", "name": "production-cluster-3"}
2026-11-09T15:52:13Z debug kubernetes/logs.go:130 get logs for resource {"deploymentId": "8c8f78c9-e628-469f-a0c6-6da8bbd2767b", "resourceKind": "Deployment", "resourceName": "production-cluster-podinfo", "sinceTime": "2026-11-09T15:51:41.262Z"}
2026-11-09T15:52:16Z debug kubernetes/status_check.go:181 checking status {"resourceKind": "Deployment", "resourceNamespace": "llm-1", "resourceName": "production-cluster-podinfo"}
2026-11-09T15:52:16Z info controllerclient/client.go:89 reporting deployment status {"deploymentId": "8c8f78c9-e628-469f-a0c6-6da8bbd2767b", "revisionId": "4de6d2d2-7f10-47cb-92c8-9aef453fb29c", "type": "healthy", "message": "status check passed. 2 resources healthy"}
2026-11-09T15:52:17Z debug deploymentlogs/collector.go:70 skipped flushing log records {"deploymentId": "6a9796e8-94c7-4873-9a45-c835bdeaf5e0", "logRecords": 0, "resourceNames": []}
```
* Docker
```text
2026-11-09T15:52:15Z debug docker/metrics.go:132 cpu usage {"usage": 0.14856669580489745, "cores": 2}
2026-11-09T15:52:15Z debug docker/metrics.go:133 memory usage {"usage": 0.2828959859, "total": 8197980160}
2026-11-09T15:52:44Z debug docker/logs.go:88 getting compose logs {"deploymentId": "4b780df7-ac43-42d8-971e-f880fd18ef68", "projectName": "distr-4b780df7", "since": "2026-11-09T15:52:14.397Z"}
2026-11-09T15:52:49Z info controllerclient/client.go:89 reporting deployment status {"deploymentId": "4b780df7-ac43-42d8-971e-f880fd18ef68", "revisionId": "8744e7bf-9a3a-4565-97d9-c30a37a2b556", "type": "progressing", "message": "Started Container distr-4b780df7-backend-1\nRunning Container distr-4b780df7-postgres-1\n"}
2026-11-09T15:52:50Z debug docker/metrics.go:154 disk usage {"device": "/dev/nvme0n1p16", "path": "/boot", "fsType": "ext2/ext3", "total": 923156480, "used": 190869504}
2026-11-09T15:52:54Z debug deploymentlogs/collector.go:87 flushed log records {"deploymentId": "4b780df7-ac43-42d8-971e-f880fd18ef68", "projectName": "distr-4b780df7", "logRecords": 218, "resourceNames": ["backend-1"], "duration": "336.678642ms"}
2026-11-09T15:52:59Z info controllerclient/client.go:89 reporting deployment status {"deploymentId": "4b780df7-ac43-42d8-971e-f880fd18ef68", "revisionId": "2e4aab9a-78b9-4d52-a079-7e8ed6fab98d", "type": "progressing", "message": "service distr-4b780df7-proxy-1 is not in running state: state=created, status=Created, exitCode=0"}
2026-11-09T15:53:01Z debug docker/metrics.go:266 image disk usage {"bytes": 24197767044, "count": 159}
2026-11-09T15:53:04Z debug docker/main.go:320 controller version is up to date
2026-11-09T15:53:04Z info controllerclient/client.go:89 reporting deployment status {"deploymentId": "4b780df7-ac43-42d8-971e-f880fd18ef68", "revisionId": "8744e7bf-9a3a-4565-97d9-c30a37a2b556", "type": "error", "message": "compose up failed: dependency failed to start: container distr-4b780df7-backend-1 exited (1)"}
2026-11-09T15:53:05Z debug docker/docker_actions.go:53 applying compose file {"deploymentId": "512dd0fb-0b51-42d8-bdcc-f3c14151be78"}
2026-11-09T15:53:05Z info controllerclient/client.go:89 reporting deployment status {"deploymentId": "512dd0fb-0b51-42d8-bdcc-f3c14151be78", "revisionId": "08093463-a61f-430f-9278-7313145e2899", "type": "error", "message": "failed to load compose project: services must be a mapping"}
```
A controller writes most of these lines on every cycle. The two deployment targets these lines come from have two deployments each, and their controller logs grew by about 5,000 lines per hour on Docker and 14,000 on Kubernetes.
# Docker Controller Security
> What the Distr Docker controller can access on the host, which Docker operations it runs and which credentials it keeps there.
The [Docker controller](/docs/controllers/docker-controller/) manages Docker on the host, so it has the access of the Docker engine itself. ## Architecture The controller opens every connection to Distr itself, over HTTPS, so the host needs no inbound ports.  ## Access to the Host The Compose file that installs the controller runs two containers as root, the controller and the [autoheal](/docs/controllers/docker-controller/#autoheal) service. Autoheal only mounts the Docker socket, the controller mounts: | Mount (default) | Purpose | Optional | Changed by | | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------- | | `/var/run/docker.sock` | Manage containers through the Docker API | No | Deployment target editor, as a [custom Docker endpoint](/docs/controllers/docker-controller/#custom-docker-endpoint) | | `${HOME}/.docker`, read-only | Reuse the host’s registry credentials, see [Authentication with OCI Registries](/docs/controllers/docker-controller/#authentication-with-oci-registries) | No | Host administrator, with `HOST_DOCKER_CONFIG_DIR` | | `/` as `/hostfs`, read-only | Read the mount table and the size of container log files for [metrics](/docs/controllers/logs-and-metrics/#metrics) | Yes, on by default in the UI | Deployment target editor, with **Report Metrics** | | `scratch` volume | Keep the Compose and env files of the deployments and the files of self-updates | No | Not configurable | A deployment target editor is a user with the `read_write` or `admin` role in the vendor organization or in the customer organization the deployment target belongs to. The API only enables metrics when a request sets `metricsEnabled`. The controller runs in the host’s network namespace. The autoheal container has no network and only talks to the Docker socket. Caution Access to the Docker socket is equivalent to root access on the host, whether or not the container runs as root, since the Docker API can start a privileged container that mounts the host filesystem. Run the controller on a host dedicated to the deployments it manages. Distr renders the Compose file when the controller connects and again for every [self-update](/docs/controllers/docker-controller/#controller-self-updates). A change to the deployment target, such as enabling metrics, reaches the host with the next controller update, and local edits to the Compose file are overwritten then. ## Docker Operations The controller talks to the Docker engine only through the mounted socket. It runs Compose operations through the Compose library built into the controller, and the self-update through the Docker CLI of the controller image. The commands below are what the controller runs, written as the equivalent Docker CLI calls, with these placeholders: | Placeholder | Value | | ----------------- | ----------------------------------------------------------------------------------------------------- | | `` | The Compose project of the deployment, `distr-` followed by the first 8 characters of its ID | | `` | The project directory of the deployment, `/scratch/projects/` in the `scratch` volume | | `` | The registry credentials of the deployment, `/tmp//docker` in the controller container | Distr sets `` as the `name` of the Compose file it sends. The controller writes that file to `/docker-compose.yaml` and, when the deployment has an env file, that file to `/.env`. Both are readable by root only. A deployment without an env file has no `.env`: the controller deletes one left by an earlier revision, because Compose reads a `.env` in the project directory on its own. ### Applying a Deployment The controller applies a deployment when Distr sends a revision it has not applied yet, and again on every cycle while the last apply failed or did not finish. A running deployment is not applied again. First it logs in to the Distr registry with its current login token and to the registries of the deployment’s [application entitlements](/docs/platform/application-entitlements/#oci-registry-authentication) with their credentials, the equivalent of `docker login`. It stores these credentials in `` and uses that directory instead of the host’s Docker config for every command of the deployment that needs one of these logins. It then runs:
```shell
docker compose --project-directory --file /docker-compose.yaml \
up --detach --remove-orphans --no-build
```
This creates the networks and volumes of the project, pulls the images that are missing or whose `pull_policy` asks for it, creates and starts the containers, runs their `post_start` hooks and removes the containers of services the project no longer defines. Images are never built on the host. An apply that has not finished after 10 minutes is canceled and reported as an error. ### Restarting a Deployment When a revision is created with **Force restart**, the controller restarts the deployment after a successful apply:
```shell
docker compose --project-directory --file /docker-compose.yaml restart
```
### Cleaning Up Images With [image cleanup](/docs/controllers/docker-controller/#image-cleanup) enabled, the controller collects the images of all containers of the previous revision with `docker compose --project-name ps --all` before an apply and, once the apply succeeded, removes each of them:
```shell
docker image rm
```
It does not force the removal, so an image the new revision or another container still uses stays on the host. ### Undeploying a Deployment When a deployment is no longer part of the deployment target, the controller removes it:
```shell
docker compose --project-directory --file /docker-compose.yaml down --volumes --remove-orphans
docker compose --project-name down --volumes --remove-orphans
docker image rm
```
The first `down` loads the project so that Compose runs the `pre_stop` hooks of its services. The second one removes whatever is left with the label of the project, including volumes and networks a previous revision declared. The images are those of the deployment’s containers and are removed whether or not image cleanup is enabled. Finally the controller deletes ``. Caution `--volumes` removes the named volumes of the deployment, so undeploying deletes the data stored in them. ### Updating the Controller When the controller version of the deployment target changes, the controller fetches its new Compose file from Distr, adds its target secret to it and writes it to `/scratch/distr-update.yaml`. It removes a stopped container named `distr-controller-update` left over from an earlier update, and then starts the update from a container of the new image:
```shell
docker run --detach --rm --name distr-controller-update \
--entrypoint /usr/local/bin/docker-entrypoint.sh \
--env HOST_DOCKER_CONFIG_DIR= \
--env DOCKER_HOST=unix:///var/run/docker.sock \
--volumes-from \
: \
docker compose -f /scratch/distr-update.yaml up -d
```
`--volumes-from` gives the update container the mounts of the controller, including the Docker socket. The update recreates the controller and autoheal containers of the `distr` project and removes itself when it is done. ### Reading State, Logs and Metrics These calls only read. They run for the applied revision of every deployment: | Interval | Command | | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | Every `DISTR_CONTROLLER_INTERVAL` | `docker compose --project-name ps --all` for the status | | Every 30 seconds, with log collection | `docker compose --project-name logs --timestamps --since ` | | Every 30 seconds, with metrics | `docker compose --project-name ps`, then `docker stats --no-stream` and `docker inspect` per container | With metrics enabled the controller also reads the usage of its own containers through `docker ps --filter label=com.docker.compose.project=distr`, `docker stats --no-stream` and `docker inspect`, and the size of the image store through the equivalent of `docker system df` every 5 minutes. It reads the CPU and memory usage of the host from `/proc`, the mounted devices from `/hostfs/proc/mounts`, the usage of each mounted `/dev/` device and the size of the container log files that `docker inspect` names under `/hostfs`. ### Autoheal The autoheal container checks every 5 seconds for unhealthy containers and restarts them, through the Docker API, as the equivalent of:
```shell
docker ps --filter health=unhealthy --filter status=running --filter label=sh.distr.autoheal=true
docker restart --time 10
```
It skips containers labeled `autoheal=False` and takes the timeout from a container’s `autoheal.stop.timeout` label where one is set. With autoheal enabled for all containers, the label filter is left out, so it restarts every unhealthy container on the host. See [Autoheal](/docs/controllers/docker-controller/#autoheal). Anything else that runs comes from the Compose file of a deployment, such as its lifecycle hooks. ## Credentials on the Host * The target secret is part of the controller’s environment, so anyone who can inspect the controller container can read it. During a self-update it is also written to `/scratch/distr-update.yaml`. [Authentication](/docs/controllers/security/network/#authentication) explains how to replace it. * The env files of the deployments, with their [secrets](/docs/controllers/secrets/) filled in, are kept in `/.env` in the `scratch` volume, readable by root only. * The registry credentials of every deployment, including the controller’s login token for the Distr registry, are kept in `/config.json` in the temporary directory of the controller container.
# External Secrets
> Create secrets in the customer environment and reference them by name, so their values never pass through Distr.
[Distr Secrets](/docs/controllers/secrets/) are encrypted at rest and filled in when a deployment is applied, but the controller still receives their values from Distr. A password, an API key or a certificate that should never leave the customer environment can be created there instead. The deployment then refers to it by name, and Distr only ever sees that name. | | Distr Secrets | External secrets | | ---------------------------- | ------------------------------------------- | ------------------------------------------------------------------ | | Where the value is stored | Encrypted in the Distr database | Only in the customer environment | | Who manages it | Vendor or customer users in Distr | Whoever administers the environment | | On a change | Distr redeploys the deployments that use it | Restarting the containers that read it is up to whoever changes it | | Masked in logs sent to Distr | Yes | Only if it matches a common credential pattern | Both can be used in the same deployment, for example Distr Secrets for values the vendor provides and external secrets for credentials that belong to the customer. ## Kubernetes Create the Secret in the namespace of the deployment, with `kubectl` or a tool such as the [External Secrets Operator](https://external-secrets.io/) that syncs it from a vault. Then pass its name to the chart in the Helm values. Put the value in a file rather than on the command line, so it does not land in the shell history or the process list. Delete the file once the Secret exists if you do not want a copy left on disk.
```shell
kubectl create secret generic my-app-db --namespace my-app --from-file=password=./db-password
```
```yaml
postgresql:
auth:
existingSecret: my-app-db
```
Most charts offer a value like `existingSecret` for this, but its name and whether it exists depend on the chart. The Secret is not part of the Helm release, so uninstalling the deployment leaves it in place. ## Docker Compose Put the value in a file on the host that only root can read, and reference it in the `secrets` section of the Compose file. Docker mounts it into the container as `/run/secrets/`.
```yaml
services:
backend:
image: my-application-backend
secrets:
- db-password
secrets:
db-password:
file: /etc/my-application/db-password
```
The controller does not need access to the file. Compose passes the path to the Docker engine as a bind mount, and the engine reads it on the host. Compose cannot find the file inside the controller container, so the controller logs a warning that the secret file does not exist. You can ignore it. The path has to be absolute, since Compose resolves a relative one in the controller’s project directory and not on the host. Unlike an environment variable, the value does not show up in `docker inspect`, which only shows the path of the mount. ## Logs Distr masks the values of Distr Secrets and common credential patterns in the logs it receives. It cannot know the value of an external secret, so if application logs are collected, make sure the application does not log it. [Data Sent to Distr](/docs/controllers/security/data-sent-to-distr/) lists everything a controller reports.
# Controller Images
> What the Distr controller images contain, how they are built and how to verify their cosign signatures and read their SBOMs.
| Image | Base | Contents | | ----------------------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `docker-controller` | The Alpine variant of the official Docker CLI image | The controller binary, the Docker CLI with its Compose and Buildx plugins and curl for the health check, but no Docker daemon | | `docker-autoheal` | Alpine | The autoheal script with curl and jq | | `kubernetes-controller` | Distroless `static`, as the `nonroot` user | The controller binary only, without a shell or package manager | The Alpine images are built with their packages upgraded to the latest version, so a package fix published after a release is part of the next release. To pull the images from your own registry, see [Controller Image Repository](/docs/platform/branding/#controller-image-repository). ## Verifying the Signature Every released image is published with an SBOM and build provenance and signed with [cosign](https://docs.sigstore.dev/cosign/signing/overview/) keyless signing by the GitHub Actions workflow that builds it. The images are published to `registry.distr.sh`, which Distr Cloud pulls from, and mirrored to `ghcr.io`, which self-hosted instances pull from by default. The same workflow run signs both, while release candidates are only published to `ghcr.io`. To check an image before installing it, verify that its signature was issued to the workflow that builds it. The commands run cosign with an empty Docker config, so credentials or a credential helper configured for the registry cannot interfere with pulling the signature. Replace `4.8.1` with the controller version you install. * registry.distr.sh The `docker-controller` and `kubernetes-controller` images are signed by `build-controller.yaml`:
```shell
DOCKER_CONFIG=$(mktemp -d) cosign verify \
--certificate-identity-regexp '^https://github\.com/distr-sh/distr/\.github/workflows/build-controller\.yaml@' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
registry.distr.sh/distr/docker-controller:4.8.1
```
The `docker-autoheal` image is signed by `build-docker-autoheal.yaml`:
```shell
DOCKER_CONFIG=$(mktemp -d) cosign verify \
--certificate-identity-regexp '^https://github\.com/distr-sh/distr/\.github/workflows/build-docker-autoheal\.yaml@' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
registry.distr.sh/distr/docker-autoheal:4.8.1
```
* ghcr.io (GitHub mirror) The `docker-controller` and `kubernetes-controller` images are signed by `build-controller.yaml`:
```shell
DOCKER_CONFIG=$(mktemp -d) cosign verify \
--certificate-identity-regexp '^https://github\.com/distr-sh/distr/\.github/workflows/build-controller\.yaml@' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
ghcr.io/distr-sh/distr/docker-controller:4.8.1
```
The `docker-autoheal` image is signed by `build-docker-autoheal.yaml`:
```shell
DOCKER_CONFIG=$(mktemp -d) cosign verify \
--certificate-identity-regexp '^https://github\.com/distr-sh/distr/\.github/workflows/build-docker-autoheal\.yaml@' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
ghcr.io/distr-sh/distr/docker-autoheal:4.8.1
```
For the Kubernetes controller, replace `docker-controller` with `kubernetes-controller`. cosign exits with an error if the image has no signature from that workflow. ## Reading the SBOM To list the packages of an image, read its SBOM: * registry.distr.sh
```shell
docker buildx imagetools inspect registry.distr.sh/distr/docker-controller:4.8.1 --format '{{ json .SBOM }}'
```
* ghcr.io (GitHub mirror)
```shell
docker buildx imagetools inspect ghcr.io/distr-sh/distr/docker-controller:4.8.1 --format '{{ json .SBOM }}'
```
The command works the same for `kubernetes-controller` and `docker-autoheal`.
# Kubernetes Controller Security
> What the Distr Kubernetes controller can access in the cluster, which Helm and Kubernetes operations it runs and which credentials it keeps there.
The [Kubernetes controller](/docs/controllers/kubernetes-controller/) manages Helm releases through the Kubernetes API, so it has the access of its service account. ## Architecture The controller opens every connection to Distr itself, over HTTPS, so the cluster needs no inbound ports.  ## Access to the Cluster The manifest that installs the controller creates these resources in the namespace it is applied to: | Resource (default) | Purpose | Optional | Changed by | | ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | | `distr-controller` ServiceAccount, bound to `cluster-admin` with cluster scope or to the `namespace-admin` Role with namespace scope | Install the resources of Helm charts and read their status, logs and metrics | No | Deployment target editor, when creating the deployment target | | `distr-controller` Deployment, one replica as non-root user with 256Mi memory and a CPU limit of 500m | Run the controller | No | Deployment target editor, with custom resource requirements | | `distr-controller-auth` Secret | Hold the target secret | No | Deployment target editor, by [reconnecting](/docs/controllers/logs-and-metrics/#reconnect) | | `distr-controller-env` ConfigMap | Hold the Distr endpoints and the controller version | No | Not configurable | | `distr-controller-dockerconfig` Secret | Provide the registry credentials the Distr instance configures for all controllers | Yes, only with `CONTROLLER_DOCKER_CONFIG` set on a self-hosted Distr | Distr administrator | | `emptyDir` cache volume | Keep the pulled Helm charts | No | Not configurable | A deployment target editor is a user with the `read_write` or `admin` role in the vendor organization or in the customer organization the deployment target belongs to. The scope cannot be changed after the deployment target is created. The `namespace-admin` Role grants every verb on every resource of the namespace, including Secrets, Roles and RoleBindings. `cluster-admin` grants the same on every resource of the cluster, which [metrics](/docs/controllers/logs-and-metrics/#metrics) need to read the nodes. Caution Anyone who can create pods in the controller’s namespace can run a pod with the controller’s service account and act with its permissions. With cluster scope that is control over the whole cluster. Choose namespace scope where the charts allow it and do not give other users write access to the namespace. Distr renders the manifest when the controller connects and again for every [self-update](/docs/controllers/kubernetes-controller/#controller-self-updates). A change to the custom resource requirements reaches the cluster with the next reconnect or controller update. ## Kubernetes Operations | When | What the controller does | | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | A deployment is created or updated | Writes the image pull secret `sh.distr.agent.v1..pull`, adds it to every `imagePullSecrets` and `pullSecrets` list in the values and runs `helm install` or `helm upgrade` in its namespace. By default Helm waits for the resources to become ready and rolls back on failure, unless the Helm options of the deployment say otherwise | | A deployment is force restarted | After the upgrade, patches the workloads of the release the way `kubectl rollout restart` does | | A deployment is undeployed | `helm uninstall`, then deletes the tracking secret `sh.distr.agent.v1.` | | Continuously | Reads the tracking secrets and Helm releases of its namespace and the status of the release resources. With log collection enabled it reads the logs of their pods, with metrics enabled the pods and pod metrics of its namespace and the nodes and node metrics of the cluster | | The controller version changes | Fetches the new manifest from Distr and creates or updates its resources, including its own role binding | Anything the chart of a deployment defines runs as well, such as Helm hooks. Releases are installed in the controller’s namespace, but with cluster scope a chart can create resources anywhere in the cluster. ## Credentials in the Cluster * The `distr-controller-auth` Secret holds the target secret. [Authentication](/docs/controllers/security/network/#authentication) explains how to replace it. * The image pull secret of every deployment holds its registry credentials. Registry credentials are also kept in the temporary directory of the controller container. * Helm stores every revision of a release, including its values with their [secrets](/docs/controllers/secrets/) filled in, in Secrets named `sh.helm.release.v1..v`. Anyone who can read Secrets in the controller’s namespace can read all of these.
# Network & Authentication
> The outbound connections Distr controllers open, the health check they serve and how they authenticate with Distr using the target secret.
## Network The controller only opens outbound connections. Distr never connects to the controller, so nothing in the environment has to be reachable from outside: the controller fetches its deployments every `DISTR_CONTROLLER_INTERVAL`, 5 seconds by default, and reports back on the same connection. | Destination | Purpose | | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | | Distr, the `DISTR_*_ENDPOINT` URLs | Login, deployments, status, logs, metrics and self-updates over HTTPS | | The Distr registry and the registries of [application entitlements](/docs/platform/application-entitlements/#oci-registry-authentication) | Log in for the images of a deployment, and pull Helm charts | | Helm chart repositories, and the Git repositories and OCI artifacts a Compose file includes | Load the chart or the Compose project, over HTTPS or SSH for Git | | The Kubernetes API server | Manage the cluster, Kubernetes controller only | Container images are pulled by the container runtime, the Docker daemon or the kubelet, not by the controller. The runtime’s proxy and registry mirror settings apply to them. Both controllers serve a health check on port `8765` that only reports whether the controller’s main loop is running. The Docker controller listens on `127.0.0.1` of the host, the Kubernetes controller on the pod IP for its liveness and readiness probes. ## Authentication The controller logs in to Distr with the target ID and the target secret of its deployment target and authenticates every further request with the JWT it receives. These credentials only give access to the deployments of that one deployment target. The target secret is part of the connect command as a query parameter, so the command can end up in the shell history and in the logs of a proxy that inspects TLS traffic. Distr shows the secret once and stores only a hash to verify it. To replace it, [reconnect](/docs/controllers/logs-and-metrics/#reconnect) the deployment target: the previous secret stops working once a controller has connected with the new one. The [Docker controller](/docs/controllers/security/docker/#credentials-on-the-host) and [Kubernetes controller](/docs/controllers/security/kubernetes/#credentials-in-the-cluster) pages list where each controller keeps the target secret.
# Update Notifications
> Notify users by email when a new application version or a new artifact version becomes available.
Update notifications tell selected users by email that a new version is available: a new version of an application whose deployments are still on an older one, or a new version of an artifact in the registry. ## How to Configure Update Notifications In the sidebar, navigate to **Notifications** > **Updates**. 1. Click **Update Notification**. 2. Optionally enter a name for the configuration. 3. Switch between **Applications** and **Artifacts**, and select what to watch. One configuration can watch applications and artifacts together, so an application and the images it is shipped with are announced from a single place. 4. Select the users who should receive the emails. Your own team, your partners and your customers’ users can all be picked. Each configuration can be toggled on or off without deleting it, and the **History** page lists what has been sent. ## Configuring for a Customer The page lists what your own organization has configured. **Show customer update notifications** leads to the same page for one of your customers, where the breadcrumb switches between them, and the **Alerts**, **Updates** and **History** of a customer can be managed the way their users and secrets are. A configuration created there belongs to the customer: it can only watch what that customer is [entitled](/docs/platform/license-management/) to and only notify users of their organization. ## Letting Customers Configure Their Own Grant a customer organization the **Update Notifications** feature in **Customers** to let its admins decide who of their own users hears about a new version. They reach the page through **Notifications** in the sidebar, and can only pick the applications and artifacts they are entitled to and users of their own organization. ## When a Notification Is Sent An application notification is sent when a new version of a watched application is created, to every selected recipient who can see at least one deployment that runs an older version. Older is decided by the application’s versioning strategy: with SemVer, a customer already on 2.1.0 is not told about a 2.0.5 bugfix. A deployment whose [entitlement](/docs/platform/license-management/) does not cover the new version is left out for every recipient, and its customer hears about the version once the entitlement is widened. An artifact notification is sent when a new tag is pushed to a watched artifact. A customer is left out when the tag it pulled last has the same content as the new tag or newer content, as decided by the artifact’s [versioning strategy](/docs/registry/#versioning-strategy): with SemVer, a customer who pulled 2.1.0 is not told about a 2.0.5 bugfix. A customer who has not pulled the artifact yet is notified when its entitlement covers the new tag, and so are your own team and partners. When an entitlement is widened, its customer hears about the newest of the tags it now covers. Artifacts that mirror an upstream registry cannot be watched, because all of their versions appear at once when the mirror syncs. Each recipient hears about a version once, however many deployments are affected and however many configurations cover them. A customer who watches the same application as you do receives one email, not two. ## Notification Emails Every email names the application or artifact and the new version, and links to Distr. A recipient from your own team or a partner organization sees every affected customer and deployment in one email. A customer user sees only their own deployments.
# FAQs
> Information about the Distr frequently asked questions
# Free Trial
> Learn how Distr's 30-day Pro Trial works, what happens when it expires, and how to select a subscription plan.
All new Distr organizations automatically receive a **30-day Pro Unlimited Trial**, giving you full access to Pro features to evaluate the platform without requiring a credit card. ## How Trials Work When you create a new Distr organization, you automatically receive a **30-day Pro Unlimited Trial**: 1. **Full Feature Access** - You have access to all Pro features during the trial period 2. **No Credit Card Required** - Start using Distr immediately without payment 3. **Trial Banner** - A banner at the top of the Vendor Portal displays your trial end date 4. **Trial Expiration** - Your trial expires 30 days after organization creation ## What Happens When Your Trial Expires If you haven’t selected a subscription plan before your trial expires: 1. **Vendor Portal Access** - You’ll be redirected to the subscription page and will not be able to access Distr 2. **Data Retention** - Your data, customers, and deployments remain intact 3. **No Automatic Charges** - You won’t be charged until you actively select a subscription plan Caution Admin users will see subscription management options. Non-admin users will see a message explaining that subscription management requires admin privileges. Make sure at least one admin user selects a subscription before the trial expires. ## Selecting a Subscription During Trial You can select a subscription plan at any time during your trial: 1. Navigate to the **Subscription** page in the Vendor Portal 2. Review available plans (Pro, Business, Enterprise) 3. Select your preferred plan 4. Complete checkout via Stripe 5. Your subscription becomes active immediately ## Choosing the Right Plan Not sure which plan to choose? Consider: * **Pro** - If you’re distributing to self-managed customers and need license management, alerts, and RBAC * **Business** - If you’re distributing at scale and need partner management and full white label * **Enterprise** - If Distr is your complete commercial platform with custom scale, isolation, and contract needs Learn more about [choosing the right plan](/docs/subscription/) for your needs. ## Next Steps * Review [subscription plans](/docs/subscription/) to understand which plan fits your needs * Visit our [pricing page](/pricing/) for current pricing and feature comparisons * Try Distr locally with the free Community Edition from our [self-hosting guide](/docs/self-hosting/) * Learn how to [manage your subscription](/docs/subscription-management/) after selecting a plan
# Integrations
> Connect Distr with your existing tools and workflows through our API, SDKs, and integrations.
Distr works with your existing development workflow and tools. Use the APIs, SDKs, and platform integrations to automate your software distribution pipeline. ## CI/CD Integrations Automate your deployment pipeline with native integrations: * **[Automatic Deployments from GitHub](/docs/integrations/github-actions/)** - Step-by-step guide to set up automatic deployments from your GitHub workflows * **[GitHub Action Reference](/docs/integrations/gh-action/)** - Complete reference for the distr-create-version-action ## Air-Gapped Delivery Deliver your application into disconnected and air-gapped environments: * **[Air-Gapped Deployments with Zarf](/docs/integrations/zarf/)** - Package your Helm chart and all container images into a single Zarf package and distribute it through the Distr registry ## Kubernetes Cluster Setup Serve a Helm application to customers that operate no Kubernetes cluster: * **[Cluster Setup with k3s](/docs/integrations/k3s/)** - Install k3s on the customer’s Linux server with the connect command, provision a managed cluster in their cloud account or install k3s offline with Zarf ## Amazon Elastic Container Service (ECS) Run your application on the ECS clusters your customers operate in their own AWS accounts: * **[Deploying to Amazon ECS](/docs/integrations/aws-ecs/)** - Pull your images from the Distr registry into ECS tasks, with registry credentials, secrets and configuration kept in the customer’s AWS account ## Remote Access Debug customer installations through a tunnel that you deploy as a Distr application: * **[Remote Access Overview](/docs/integrations/remote-access/)** - How remote access is deployed, revoked and limited with the Docker socket and a Kubernetes ServiceAccount * **[Docker Compose with Tailscale](/docs/integrations/remote-access/tailscale/)** - Reach the Docker engine of a customer host through Tailscale SSH or a forwarded Docker socket * **[Kubernetes with Cloudflare Tunnel](/docs/integrations/remote-access/cloudflare-tunnel/)** - Run kubectl against a customer cluster through a single cloudflared Deployment and Cloudflare Access ## API & SDKs Access Distr programmatically using our REST API and client libraries: * **[Distr API](/docs/integrations/api/)** - REST API for managing applications, deployments, and customers * **[API Reference](https://app.distr.sh/docs)** - Interactive API documentation * **[JavaScript/TypeScript SDK](/docs/integrations/sdk/)** - Official SDK for Node.js and TypeScript applications * **[Personal Access Tokens](/docs/integrations/personal-access-token/)** - Generate API tokens for authentication *** Need help integrating Distr? [Get help](https://github.com/distr-sh/distr/discussions) in our community forum.
# Distr API
> The Distr REST API lets you manage your software distribution programmatically, from publishing artifacts and creating customers to triggering deployment updates. It's the same API that powers the Vendor and Customer Portals.
Distr exposes a RESTful JSON API that allows you to interact with the platform programmatically. It is the same API used by the Distr Vendor and Customer Portals. If you prefer to interact with the API on a higher level of abstraction, you can use our [first-party SDKs](/docs/integrations/sdk/) that handle authentication and error handling for you, and provide types. ## Base URL Every Distr instance, no matter if self-managed or the SaaS version, exposes this API under the `/api/v1` path. ## API reference Every instance serves an interactive API reference at `/docs` and the machine-readable OpenAPI specification at `/docs/openapi.json`. For Distr Cloud these are [app.distr.sh/docs](https://app.distr.sh/docs) and [app.distr.sh/docs/openapi.json](https://app.distr.sh/docs/openapi.json). ## Authentication To authenticate with the Distr API, you need to use a Personal Access Token. To create a Personal Access Token, follow the steps outlined in the [Creating a Personal Access Token](/docs/integrations/personal-access-token/) guide. For each HTTP request to the API, you need to include the Personal Access Token in the `Authorization` header, like shown here:
```shell
curl 'https://app.distr.sh/api/v1/applications' \
-H "Authorization: AccessToken "
```
This will authenticate you as the user who created the Personal Access Token for the lifetime of this request. The token needs to be sent with every request to the API. ## Request Limits The following limits apply to the Distr API for each user: * 30 requests per second * 300 requests per minute * 2000 requests per hour If these limits are exceeded, the API will respond with a `429 Too Many Requests` status code. The API also rejects request bodies larger than 1MiB.
# Deploying to Amazon ECS
> Run your application on Amazon ECS in your customers' AWS accounts, with container images pulled straight from the Distr registry and access controlled by artifact entitlements and license keys.
Many enterprise customers standardize on [Amazon Elastic Container Service (ECS)](https://aws.amazon.com/ecs/) and want to run your application on the clusters they already operate. Distr supports this through its [artifact registry](/docs/registry/): you publish your container images to Distr and decide per customer which images and tags they are entitled to, and the customer’s ECS tasks pull those images directly from Distr with a Personal Access Token. This follows the [fully self-managed](/docs/use-cases/fully-self-managed/) distribution model. Your customer runs the ECS cluster, the task definitions and the services in their own AWS account, the same way they would install a Helm chart on a Kubernetes cluster they operate themselves. You stay in control of what they can pull, and you see which versions they pull. ## How Distr and Amazon ECS work together You, the vendor, push your images to the Distr registry, grant them to a customer with an [artifact entitlement](/docs/platform/artifact-entitlements/), optionally issue a [license key](/docs/platform/license-keys/) and publish the installation instructions on the welcome page of the [Customer Portal](/docs/platform/customer-portal/). Your customer creates a Personal Access Token in the Customer Portal, stores it in AWS Secrets Manager and references it from the ECS task definition. ECS then authenticates against the Distr registry whenever it pulls the image to start a task.  | What | Where it lives | | ----------------------------------- | ------------------------------------------- | | Container images | Distr registry | | Which images and tags may be pulled | Artifact entitlement in Distr | | Registry credentials | AWS Secrets Manager in the customer account | | Application configuration | Environment of the ECS task definition | | License token | Environment of the ECS task definition | | Cluster, task definitions, services | Amazon ECS in the customer’s AWS account | ## Vendor setup: publishing your application for ECS customers ### 1. Push your images to the Distr registry [Configure your registry slug](/docs/registry/configuration/), authenticate with a Personal Access Token and push your images:
```shell
docker push registry.distr.sh/acme/acme-app:1.4.0
```
### 2. Grant access with an artifact entitlement [Create the customer](/docs/platform/customer-management/#creating-a-customer) and an [artifact entitlement](/docs/platform/artifact-entitlements/) for the images your application consists of. Choose **All tags and future tags** so that every new release becomes available to the customer as soon as you push it, or select specific tags to keep a customer on a release line. ### 3. Issue a license key If your application enforces seats, plans or features, create a [license key](/docs/platform/license-keys/) for the customer. The customer copies the signed token from the Customer Portal and passes it to the container as an environment variable, and your application verifies it offline against your public key. ### 4. Publish the ECS installation instructions The welcome page, which you edit under [Branding](/docs/platform/branding/#customer-portal), is the first thing your customers see when they log in to the Customer Portal. Use it to hand over everything an ECS installation needs: * The full image references, including the registry host. * Every environment variable your application reads, with a sensible default and a description. * The name of the environment variable that receives the license token. * Every value that belongs in a secret rather than in the task definition, such as a database password. * The recommended CPU, memory, container port and health check. * A link to the [customer setup](#customer-setup-running-the-application-on-amazon-ecs) of this guide. A welcome page for an application called Acme App could look like this:
```markdown
## Installing Acme App on Amazon ECS
Image: `registry.distr.sh/acme/acme-app:1.4.0`
Recommended task size: 0.5 vCPU, 1 GB memory. The container listens on port 8080
and answers health checks on `/healthz`.
Set these variables in the `environment` of the task definition:
| Variable | Example | Description |
| -------------------- | -------------------------- | ------------------------------------------------ |
| `ACME_BASE_URL` | `https://acme.example.com` | Public URL under which your users reach Acme App |
| `ACME_DATABASE_HOST` | `acme-db.internal` | Hostname of your PostgreSQL instance |
| `ACME_DATABASE_NAME` | `acme` | Name of the PostgreSQL database |
| `ACME_LOG_LEVEL` | `info` | One of `debug`, `info`, `warn`, `error` |
| `ACME_LICENSE_TOKEN` | `eyJhbGciOi...` | Your license token from the Licenses page |
Store the password of your PostgreSQL user in AWS Secrets Manager and pass it
as `ACME_DATABASE_PASSWORD` through the `secrets` of the task definition.
Follow the [Amazon ECS guide](https://distr.sh/docs/integrations/aws-ecs/#customer-setup-running-the-application-on-amazon-ecs)
for the step by step setup.
```
## Customer setup: running the application on Amazon ECS Your customers perform these steps in their own AWS account. The examples use the image and settings from the welcome page above, the AWS Region `eu-central-1` and the account ID `123456789012`. Before you start, make sure that: * You have an ECS cluster with the Fargate or the EC2 launch type and the [AWS CLI](https://aws.amazon.com/cli/) configured for that account. * Your tasks can reach the Distr registry over HTTPS, either from a public subnet with a public IP address or from a private subnet with a NAT gateway. ### 1. Create a Personal Access Token for the registry In the Customer Portal, click your user icon in the top right corner and select **Personal Access Tokens**. [Create a token](/docs/integrations/personal-access-token/) with the role `read_only`, a label such as `ecs-production` and an expiry date, and copy it. The token acts on behalf of the user who created it, so consider creating it with a dedicated user of your organization: the cluster then keeps pulling when a team member leaves. Check that the token can pull the image before you hand it to ECS:
```shell
echo "YOUR-ACCESS-TOKEN" | docker login registry.distr.sh --password-stdin -u -
docker pull registry.distr.sh/acme/acme-app:1.4.0
```
### 2. Store the registry credentials in AWS Secrets Manager ECS reads [private registry credentials](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/private-auth.html) from a Secrets Manager secret with the keys `username` and `password`. Distr identifies you by the token alone, so the username can be any non-empty value:
```shell
aws secretsmanager create-secret \
--name acme/distr-registry \
--secret-string '{"username":"distr","password":"YOUR-ACCESS-TOKEN"}'
```
Note the `ARN` in the output: the task definition references it. ### 3. Store the database password in AWS Secrets Manager Store the database password, and any other secret your vendor lists, in a secret of its own:
```shell
aws secretsmanager create-secret \
--name acme/database-password \
--secret-string 'YOUR-DATABASE-PASSWORD'
```
### 4. Grant the task execution role access ECS pulls the image and reads the secrets with the [task execution role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) before the container starts. Save this policy as `acme-app-execution-policy.json`, with the ARNs of your secrets:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "secretsmanager:GetSecretValue",
"Resource": [
"arn:aws:secretsmanager:eu-central-1:123456789012:secret:acme/distr-registry-AbCdEf",
"arn:aws:secretsmanager:eu-central-1:123456789012:secret:acme/database-password-MnOpQr"
]
}
]
}
```
Attach it to the execution role next to the managed `AmazonECSTaskExecutionRolePolicy`:
```shell
aws iam put-role-policy \
--role-name ecsTaskExecutionRole \
--policy-name acme-app \
--policy-document file://acme-app-execution-policy.json
```
If your secrets are encrypted with a customer managed KMS key, also allow `kms:Decrypt` on that key. ### 5. Register the task definition The `repositoryCredentials` of the container definition tell ECS to authenticate with the secret from step 2. The `environment` holds the configuration from the welcome page and the license token from the **Licenses** page of the [Customer Portal](/docs/platform/customer-portal/licenses/), and the `secrets` pass the database password from step 3:
```json
{
"family": "acme-app",
"requiresCompatibilities": ["FARGATE"],
"networkMode": "awsvpc",
"cpu": "512",
"memory": "1024",
"runtimePlatform": {
"cpuArchitecture": "X86_64",
"operatingSystemFamily": "LINUX"
},
"executionRoleArn": "arn:aws:iam::123456789012:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"name": "acme-app",
"image": "registry.distr.sh/acme/acme-app:1.4.0",
"essential": true,
"repositoryCredentials": {
"credentialsParameter": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:acme/distr-registry-AbCdEf"
},
"portMappings": [{"containerPort": 8080, "protocol": "tcp"}],
"environment": [
{"name": "ACME_BASE_URL", "value": "https://acme.example.com"},
{"name": "ACME_DATABASE_HOST", "value": "acme-db.internal"},
{"name": "ACME_DATABASE_NAME", "value": "acme"},
{"name": "ACME_LOG_LEVEL", "value": "info"},
{"name": "ACME_LICENSE_TOKEN", "value": "YOUR-LICENSE-TOKEN"}
],
"secrets": [
{
"name": "ACME_DATABASE_PASSWORD",
"valueFrom": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:acme/database-password-MnOpQr"
}
]
}
]
}
```
Save it as `acme-app-task.json` and register it:
```shell
aws ecs register-task-definition --cli-input-json file://acme-app-task.json
```
You can also load the license token from AWS Secrets Manager through the `secrets` and the configuration from an [environment file in S3](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/use-environment-file.html) through `environmentFiles`, but keeping everything in the task definition is the recommended approach. For the EC2 launch type, set `requiresCompatibilities` to `EC2` here and `--launch-type` to `EC2` when you create the service in the next step; registry authentication works the same way. Terraform (`repositoryCredentials` inside `container_definitions` of `aws_ecs_task_definition`) and CloudFormation (`RepositoryCredentials` of a container definition) accept the same fields. ### 6. Create the service
```shell
aws ecs create-service \
--cluster production \
--service-name acme-app \
--task-definition acme-app \
--desired-count 2 \
--launch-type FARGATE \
--network-configuration 'awsvpcConfiguration={subnets=[subnet-0a1b2c3d4e5f67890],securityGroups=[sg-0a1b2c3d4e5f67890],assignPublicIp=DISABLED}'
```
The example runs the tasks in private subnets with a NAT gateway. Fargate tasks in a public subnet need `assignPublicIp=ENABLED` instead, or they cannot reach the registry. Add `--load-balancers` to put the service behind an Application Load Balancer, as with any other ECS service. The service events show whether the tasks started:
```shell
aws ecs describe-services \
--cluster production \
--services acme-app \
--query 'services[0].events[:5]'
```
## Updating the application on ECS New versions appear on the **Artifacts** page of the Customer Portal as soon as your vendor publishes them. To roll one out, change the `image` in `acme-app-task.json` to the new tag, register the task definition again and point the service at the new revision. A change to the `environment`, such as a renewed license token, is rolled out the same way:
```shell
aws ecs register-task-definition --cli-input-json file://acme-app-task.json
aws ecs update-service \
--cluster production \
--service acme-app \
--task-definition acme-app
```
ECS replaces the running tasks with a rolling deployment. Reference a concrete version rather than a tag like `latest`: tags in the Distr registry are immutable by default, so a version always resolves to the same image and every task of a deployment runs the same code. Every revision of the task definition holds both the image and its configuration, so pointing the service back at an earlier revision rolls back both. ECS reads the secrets only when a task starts. After you store a new password with `aws secretsmanager put-secret-value`, start a new deployment to apply it:
```shell
aws ecs update-service \
--cluster production \
--service acme-app \
--force-new-deployment
```
## Rotating the registry token without downtime ECS uses the registry credentials whenever it pulls the image, which includes scaling out and replacing unhealthy tasks, so renew the token before it expires. A Personal Access Token can hold two valid tokens at once, which lets you [rotate it](/docs/integrations/personal-access-token/#rotating-a-token) without an interruption: 1. Click **Add token** on the token’s page in the Customer Portal and copy the new token. 2. Store it in the existing secret:
```shell
aws secretsmanager put-secret-value \
--secret-id acme/distr-registry \
--secret-string '{"username":"distr","password":"YOUR-NEW-ACCESS-TOKEN"}'
```
3. Delete the old token once its “last used” timestamp stops moving. Running tasks are not affected, since the credentials are only needed to pull the image. ## Download analytics for ECS installations Every image pull of an ECS task appears in the [download analytics](/docs/registry/analytics/) of the vendor, with the customer, the user, the version and the IP address it came from. As a vendor, you therefore see which versions your ECS customers pull and when they pull a new one, without any component running in their AWS account. A pull is recorded when the registry serves the image, so it shows that a version was fetched, not that its tasks started successfully. ## Troubleshooting image pulls on ECS When a task fails to start, the stopped reason of the task in the ECS console, or `aws ecs describe-tasks`, says why: * **`CannotPullContainerError` with `unauthorized` or `401`**: the token is invalid, expired or deleted, or the secret does not use exactly the keys `username` and `password`. * **`CannotPullContainerError` with `not found` or `denied`**: the tag does not exist, or the customer is not entitled to it. The Artifacts page of the Customer Portal lists every tag the customer can pull. * **`ResourceInitializationError` mentioning registry auth or secrets**: the task execution role lacks `secretsmanager:GetSecretValue` or `kms:Decrypt`, or the task cannot reach Secrets Manager. * **A timeout while pulling**: the subnet has no route to the internet. Use a public subnet with a public IP address or a NAT gateway. * **No matching platform in the image manifest**: the `cpuArchitecture` of the task definition is not one the image was built for.
# GitHub Actions
> Automatically create new application versions in Distr whenever you push a release to GitHub, supporting both Docker and Helm applications.
## distr-create-version-action Distr offers the [distr-create-version-action](https://github.com/distr-sh/distr-create-version-action) GitHub Action that allows you to automatically create new versions of your application in Distr every time you push a new release. It supports both Docker and Helm applications. ### Key Features * **Automatic Version Creation** - Create new application versions in Distr on every release * **Automatic Deployment Updates** - Optionally update all customer deployments to the new version, for a rollout your CI has to gate. Distr’s own [automatic updates](/docs/controllers/deployment/#automatic-updates) do this without the workflow, per deployment and for every way a version can be created * **Docker Support** - Upload Docker Compose files with environment variable templates * **Helm Support** - Reference Helm charts from OCI or traditional repositories * **Multi-Organization** - Deploy to multiple Distr instances or organizations in parallel ### Quick Example
```yaml
name: Push Distr Application Version
on:
push:
tags:
- '*'
jobs:
push-to-distr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: distr-sh/distr-create-version-action@v1
with:
api-token: ${{ secrets.DISTR_API_TOKEN }}
application-id: ${{ vars.DISTR_APPLICATION_ID }}
version-name: ${{ github.ref_name }}
compose-file: ${{ github.workspace }}/docker-compose.yaml
update-deployments: true
```
### Attaching Additional Resources The action can attach [additional resources](/docs/controllers/application/#additional-resources) (markdown documents such as release notes or upgrade instructions) to the created version via the `resources` input. It takes a JSON array where each resource has a `name` and either inline `content` or a `path` to a file on the runner. With `visibleToCustomers` (defaults to `true`) you control whether a resource is shown to your customers.
```yaml
- uses: distr-sh/distr-create-version-action@v1
with:
api-token: ${{ secrets.DISTR_API_TOKEN }}
application-id: ${{ vars.DISTR_APPLICATION_ID }}
version-name: ${{ github.ref_name }}
compose-file: ${{ github.workspace }}/docker-compose.yaml
resources: |
[
{ "name": "Release Notes", "path": "./docs/release-notes.md" },
{ "name": "Internal Notes", "content": "For support staff only.", "visibleToCustomers": false }
]
```
### Complete Setup Guide For a step-by-step guide covering: * Creating your application in Distr * Setting up Personal Access Tokens * Configuring GitHub secrets and variables * Setting up automatic deployment updates * Troubleshooting and advanced scenarios See the **[Automatic Deployments from GitHub](/docs/integrations/github-actions/)** guide. ### Additional Resources * [GitHub Action README](https://github.com/distr-sh/distr-create-version-action/blob/main/README.md) - Complete action documentation * [hello-distr Example](https://github.com/distr-sh/hello-distr) - Real-world implementation example * [Personal Access Tokens](/docs/integrations/personal-access-token/) - How to create API tokens
# Automatic Deployments from GitHub
> Automatically create new versions and update customer deployments whenever you push a release to GitHub using the Distr GitHub Action.
This guide sets up a fully automated deployment pipeline that creates new application versions in Distr and updates all your customer deployments whenever you push a new release to GitHub. By the end of this guide, you’ll have: * A Docker or Helm application configured in Distr * A GitHub Actions workflow that runs on every release tag * Automatic version creation in Distr * Automatic deployment updates to all customer environments This is particularly useful for SaaS applications where you want to roll out updates to all customers simultaneously, or for managed services where you control the deployment timing. Distr can also keep deployments on the latest version by itself, without the pipeline updating them. See [Automatic updates](/docs/controllers/deployment/#automatic-updates) for when to prefer that over the `update-deployments` input described below. ## Prerequisites Before starting, ensure you have: 1. A Distr account with an organization set up 2. A GitHub repository containing your application 3. A Docker Compose file (for Docker apps) or Helm chart details (for Helm apps) 4. At least one deployment target configured in Distr (for testing automatic updates) ## Step 1: Create Your Application in Distr First, you need to create an application in Distr that will receive the automated version updates. ### For Docker Applications 1. Navigate to the **Applications** section in the Distr web interface 2. Click **Add application** in the top right corner 3. Enter a name for your application (e.g., “My SaaS App”) 4. Select **Docker** as the application type 5. Click **Create Application** ### For Helm Applications 1. Navigate to the **Applications** section in the Distr web interface 2. Click **Add application** in the top right corner 3. Enter a name for your application (e.g., “My Kubernetes App”) 4. Select **Kubernetes** as the application type 5. Click **Create Application** ### Copy the Application ID After creating the application, you’ll see the application details page. At the top, you’ll find the **Application ID** (a UUID like `7fa566b3-a20e-4b09-814c-5193c1469f7c`). **Copy this ID** - you’ll need it later for the GitHub Action configuration. ## Step 2: Create a Personal Access Token The GitHub Action needs to authenticate with Distr to create new versions and update deployments. You’ll use a Personal Access Token (PAT) for this. 1. In the Distr web interface, click on your user icon in the top right corner 2. Select **Personal Access Tokens** from the dropdown menu 3. Click **Create token** in the top right corner 4. Enter a descriptive name (e.g., “GitHub Actions - My App”) 5. Set an expiry date (recommended: 1 year from now) 6. Click **Create** 7. **Copy the token immediately** - this is the only time you’ll see it For detailed instructions with screenshots, see the [Creating a Personal Access Token](/docs/integrations/personal-access-token/) guide. ## Step 3: Configure GitHub Secrets and Variables Now you’ll store the PAT and Application ID securely in your GitHub repository. ### Add the Personal Access Token as a Secret GitHub Secrets are encrypted and perfect for storing sensitive information like API tokens. 1. Go to your GitHub repository 2. Click on **Settings** (in the repository toolbar) 3. In the left sidebar, navigate to **Secrets and variables** → **Actions** 4. Click **New repository secret** 5. Name: `DISTR_API_TOKEN` 6. Value: Paste the Personal Access Token you copied earlier 7. Click **Add secret** ### Add the Application ID as a Variable GitHub Variables are used for non-sensitive configuration values. 1. Stay on the same page (Secrets and variables → Actions) 2. Click on the **Variables** tab 3. Click **New repository variable** 4. Name: `DISTR_APPLICATION_ID` 5. Value: Paste the Application ID you copied earlier 6. Click **Add variable** ## Step 4: Prepare Your Application Files Ensure your repository contains the necessary files for deployment. ### For Docker Applications Your repository should include: * **docker-compose.yaml** - Your Docker Compose file (can be in a subdirectory like `deploy/`) * **env.template** (optional) - A template file showing which environment variables customers need to configure Example docker-compose.yaml:
```yaml
services:
web:
image: ghcr.io/yourorg/your-app:${VERSION}
ports:
- '8080:8080'
environment:
- DATABASE_URL=${DATABASE_URL}
- SECRET_KEY=${SECRET_KEY}
```
Example env.template:
```plaintext
# Database connection string
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
# Secret key for encryption (generate a random string)
SECRET_KEY=
```
### For Helm Applications Your Helm chart should be published to a registry (OCI or traditional Helm repository). You’ll reference it in the GitHub Action. Optionally, include: * **base-values.yaml** - Default values for your Helm chart * **template.yaml** (optional) - Template for customer-specific value overrides ## Step 5: Automate Version Management with Release Please (Recommended) For Docker applications that build and push container images, you need to ensure your Docker Compose file references the correct image tags for each release. Manually updating these tags is error-prone and tedious. **Release Please** automates this process. ### Why Release Please is Essential When you release a new version of your application: 1. Your CI/CD builds and pushes Docker images tagged with the release version (e.g., `0.2.0`) 2. Your `docker-compose.yaml` must reference these exact image tags 3. The Distr GitHub Action uploads this compose file to Distr **Without automation**, you’d need to manually update every image tag in your compose file before each release. Release Please solves this by automatically updating version numbers throughout your repository when creating a release. ### How It Works Release Please follows this workflow: 1. **Analyzes commits** - Reads your conventional commits (`feat:`, `fix:`, `chore:`, etc.) since the last release 2. **Creates a Release PR** - Opens a pull request with: * Updated version numbers in all configured files * Generated CHANGELOG.md entries * Bumped version following semantic versioning rules 3. **Creates releases** - When you merge the Release PR: * Creates a Git tag (e.g., `0.2.0`) * Publishes a GitHub release with the changelog * Triggers your build and deployment workflows ### Setting Up Release Please #### 1. Create the Release Please Workflow Create `.github/workflows/release-please.yaml`:
```yaml
name: Release Please
on:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
```
#### 2. Create the Configuration File Create `release-please-config.json` in your repository root:
```json
{
"packages": {
".": {
"release-type": "go",
"extra-files": ["deploy/docker-compose.yaml"]
}
},
"include-v-in-tag": false
}
```
**Key settings:** * **`release-type`** - Set to `"go"`, `"node"`, or `"simple"` based on your project * **`extra-files`** - Lists additional files to update with version numbers * **`include-v-in-tag`** - Set to `false` to create tags like `0.2.0` instead of `v0.2.0` For projects with multiple services, add all compose files or package files to `extra-files`. #### 3. Create the Manifest File Create `.release-please-manifest.json`:
```json
{
".": "0.1.0"
}
```
This tracks your current version. Release Please will update this file automatically. #### 4. Mark Version Locations in Your Docker Compose File Add `# x-release-please-version` comments to lines where versions should be updated:
```yaml
services:
backend:
image: ghcr.io/yourorg/your-app/backend:0.1.0 # x-release-please-version
# ... rest of config
frontend:
image: ghcr.io/yourorg/your-app/frontend:0.1.0 # x-release-please-version
# ... rest of config
proxy:
image: ghcr.io/yourorg/your-app/proxy:0.1.0 # x-release-please-version
# ... rest of config
```
Release Please will automatically update these version numbers when creating a release. ### The Complete Release Flow Here’s how everything works together: 1. **Development** - You push commits to `main` using conventional commit messages 2. **Release PR Created** - Release Please automatically: * Creates/updates a release PR * Updates version numbers in `docker-compose.yaml` * Generates changelog entries 3. **Merge Release PR** - When you merge the PR: * Git tag is created (e.g., `0.2.0`) * GitHub release is published 4. **Build Images** - Tag triggers your build workflows: * Docker images are built and pushed with the version tag 5. **Push to Distr** - Tag triggers the `push-distr.yaml` workflow: * **IMPORTANT**: This workflow must wait for all Docker images to be pushed before running * Creates new version in Distr with the updated compose file (now referencing the correct image tags) * Optionally updates all deployments ### Example from hello-distr The [hello-distr](https://github.com/distr-sh/hello-distr) repository demonstrates this complete setup: **docker-compose.yaml:**
```yaml
services:
backend:
image: ghcr.io/distr-sh/hello-distr/backend:0.2.1 # x-release-please-version
frontend:
image: ghcr.io/distr-sh/hello-distr/frontend:0.2.1 # x-release-please-version
proxy:
image: ghcr.io/distr-sh/hello-distr/proxy:0.2.1 # x-release-please-version
```
**Build workflow** (`.github/workflows/build-backend.yaml`):
```yaml
on:
push:
tags:
- '*'
jobs:
build:
steps:
- uses: docker/metadata-action@v5
with:
images: ghcr.io/distr-sh/hello-distr/backend
tags: |
type=semver,pattern={{version}}
- uses: docker/build-push-action@v6
with:
push: ${{ startsWith(github.ref, 'refs/tags/') }}
tags: ${{ steps.meta.outputs.tags }}
```
When version `0.2.0` is released: 1. Release Please updates all image tags to `0.2.0` 2. Git tag `0.2.0` is created 3. Build workflows push images tagged `0.2.0` 4. Distr workflow creates version with compose file referencing `0.2.0` images **Note:** In hello-distr’s current setup, build workflows and the Distr workflow trigger simultaneously on tags. In practice, image builds take longer than uploading a compose file, so this works. However, for production use, you should implement proper workflow sequencing to guarantee images are available before deployments are triggered. ## Step 6: Create the GitHub Actions Workflow Now you’ll create a workflow that runs automatically whenever you create a new release tag. 1. In your repository, create the directory `.github/workflows/` (if it doesn’t exist) 2. Create a new file: `.github/workflows/push-distr.yaml` ### For Docker Applications
```yaml
name: Push Distr Application Version
on:
push:
tags:
- '*'
jobs:
push-to-distr:
name: Create Version and Update Deployments
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Distr Version and Update Deployments
uses: distr-sh/distr-create-version-action@v1
with:
api-token: ${{ secrets.DISTR_API_TOKEN }}
application-id: ${{ vars.DISTR_APPLICATION_ID }}
version-name: ${{ github.ref_name }}
compose-file: ${{ github.workspace }}/docker-compose.yaml
template-file: ${{ github.workspace }}/env.template
link-template: 'http://{{ .Env.APP_HOST }}'
update-deployments: true
```
### For Helm Applications
```yaml
name: Push Distr Application Version
on:
push:
tags:
- '*'
jobs:
push-to-distr:
name: Create Version and Update Deployments
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Distr Version and Update Deployments
uses: distr-sh/distr-create-version-action@v1
with:
api-token: ${{ secrets.DISTR_API_TOKEN }}
application-id: ${{ vars.DISTR_APPLICATION_ID }}
version-name: ${{ github.ref_name }}
chart-type: 'oci'
chart-url: oci://ghcr.io/yourorg/your-chart
chart-version: ${{ github.ref_name }}
base-values-file: ${{ github.workspace }}/base-values.yaml
template-file: ${{ github.workspace }}/template.yaml
link-template: 'https://{{ .Env.INGRESS_HOST }}'
update-deployments: true
```
### Key Configuration Options * **`api-token`** - Your Personal Access Token (from GitHub Secrets) * **`application-id`** - Your Application ID (from GitHub Variables) * **`version-name`** - The version name (here we use the git tag name) * **`link-template`** - Template for generating links to deployments (e.g., `http://{{ .Env.APP_HOST }}`). See [Application Links](/docs/controllers/application-links/) for details * **`update-deployments: true`** - Updates every deployment of the application from the workflow. Leave it out and use [Distr’s automatic updates](/docs/controllers/deployment/#automatic-updates) instead when the rollout does not have to be gated by your CI When `update-deployments` is set to `true`, the action will: 1. Create the new version in Distr 2. Find all deployment targets where this application is deployed 3. Update each deployment to the new version 4. Skip targets that are already on the new version or don’t have the app deployed **IMPORTANT**: If your application builds and pushes Docker images, the Distr workflow **must wait** for all images to be pushed before running. Otherwise, deployments will fail because the images referenced in your `docker-compose.yaml` won’t be available yet.
```yaml
name: Build and Push to Distr
on:
push:
tags:
- '*'
jobs:
build-backend:
runs-on: ubuntu-latest
steps:
# ... build and push backend image
build-frontend:
runs-on: ubuntu-latest
steps:
# ... build and push frontend image
build-proxy:
runs-on: ubuntu-latest
steps:
# ... build and push proxy image
push-to-distr:
needs: [build-backend, build-frontend, build-proxy]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Distr Version and Update Deployments
uses: distr-sh/distr-create-version-action@v1
with:
api-token: ${{ secrets.DISTR_API_TOKEN }}
application-id: ${{ vars.DISTR_APPLICATION_ID }}
version-name: ${{ github.ref_name }}
compose-file: ${{ github.workspace }}/deploy/docker-compose.yaml
template-file: ${{ github.workspace }}/deploy/env.template
update-deployments: true
```
The `needs:` clause ensures `push-to-distr` only runs after all build jobs complete. ## Step 7: Test Your Automation Now it’s time to test the complete automation pipeline. ### Create a Test Deployment Target Before testing, make sure you have at least one deployment target configured: 1. Navigate to **Deployments** in the Distr web interface 2. Click **Add deployment** to create a test deployment target 3. Follow the wizard to set up a Docker or Kubernetes deployment target 4. Deploy an earlier version of your application to this target ### Create a Release #### If Using Release Please (Recommended) 1. Commit and push your changes using conventional commits:
```bash
git add .github/workflows/
git commit -m "feat: add automated Distr deployment workflow"
git push origin main
```
2. Release Please will automatically create a Release PR. Review and merge it. 3. When you merge the Release PR, Release Please will: * Create a Git tag (e.g., `0.1.0`) * Trigger your build workflows (which push Docker images) * Trigger the Distr workflow (which creates the version and updates deployments) #### If Using Manual Tags 1. Commit and push your workflow file to GitHub:
```bash
git add .github/workflows/push-distr.yaml
git commit -m "Add automated Distr deployment workflow"
git push
```
2. Create and push a release tag:
```bash
git tag 0.1.0
git push origin 0.1.0
```
### Monitor the Workflow 1. Go to your GitHub repository 2. Click on the **Actions** tab 3. You should see your workflow running 4. Click on the workflow run to see detailed logs The workflow will: * Check out your code * Create a new version (e.g., `0.1.0`) in Distr * Update all deployments to the new version * Show which deployment targets were updated and which were skipped ### Verify in Distr 1. In the Distr web interface, navigate to your application 2. You should see the new version in the version list 3. Navigate to **Deployments** 4. Your deployment target should now show the new version as the deployed version ## Understanding Automatic Updates There are two ways to keep customer deployments on the latest version, and you should pick one. **Distr’s own automatic updates** are the better fit for most setups. A deployment set to follow the latest version is updated by Distr whenever that version changes, so it also catches a version created through the API or the web interface, a version brought back from the archive and an entitlement that starts covering a newer version. Both you and your customer can turn it on per deployment, so a customer can stay on a version they chose while everyone else follows along. See [Automatic updates](/docs/controllers/deployment/#automatic-updates). **The action’s `update-deployments` input** updates every deployment of the application as a step of the workflow, which is what you want when the release pipeline has to decide whether an update happens at all, or when the rollout has to be visible in and gated by your CI. Do not use both for the same application. The two would update the same deployments, and each update creates a revision. When `update-deployments: true` is enabled, the GitHub Action will: ### Update These Targets * Deployment targets that have your application deployed * Deployment targets on an older version than the newly created one * Deployment targets that are online and reachable ### Skip These Targets * Deployment targets that don’t have your application deployed * Deployment targets already on the target version * The action will log why each target was skipped ### Example Output
```plaintext
Updating all deployments to the new version...
Updated 3 deployment target(s)
Skipped 2 deployment target(s):
- Customer A Production: Already on target version
- Customer B Testing: Application not deployed on this target
```
## Troubleshooting ### Workflow Fails with “401 Unauthorized” **Problem:** The GitHub Action cannot authenticate with Distr. **Solution:** * Verify your `DISTR_API_TOKEN` secret is set correctly * Check that the token hasn’t expired * Ensure the token has the necessary permissions * If using self-hosted Distr, verify the `api-base` URL is correct ### Workflow Succeeds but No Deployments Update **Problem:** Version is created but deployments aren’t updated. **Solution:** * Verify `update-deployments: true` is set in the workflow * Check that deployment targets have the application deployed * Ensure deployment targets are online and reachable * Review the workflow logs for “Skipped” messages explaining why targets weren’t updated ### Deployments Update but Application Doesn’t Start **Problem:** Deployment shows updated but the application fails to start. **Solution:** * Check the deployment status in Distr for error messages * Verify your Docker Compose file or Helm chart is valid * Ensure required environment variables are configured in the deployment * Check the deployment logs in the Distr web interface ### Deployments Fail with “Image Pull Error” or “manifest unknown” **Problem:** Deployments fail immediately after creation with errors like “failed to pull image” or “manifest for image not found”. **Cause:** The Distr workflow ran before your Docker images were fully pushed to the registry. **Solution:** This is a critical sequencing issue. In summary: 1. Use `workflow_run` to make the Distr workflow wait for build workflows to complete 2. Use `needs:` in a combined workflow to enforce job order 3. Set `update-deployments: false` and update manually after images are available **Quick check:** Look at your GitHub Actions runs - do the build workflows complete *after* the Distr workflow? If yes, you need to fix the sequencing. ### Version Already Exists Error **Problem:** GitHub Action fails because the version name already exists. **Solution:** * Each version name must be unique within an application * If re-running a workflow for the same tag, delete the existing version in Distr first * Consider using more specific version names (e.g., include build numbers or timestamps) ## Next Steps Now that you have automatic deployments set up, consider: * **[Application Entitlements](/docs/platform/application-entitlements/)** - Control which customers receive automatic updates * **[Application Links](/docs/controllers/application-links/)** - Create dynamic links for customers to access their deployments * **[Air-Gapped Deployments with Zarf](/docs/integrations/zarf/)** - Extend your release pipeline to publish self-contained Zarf packages for air-gapped clusters * **[Distr SDK](/docs/integrations/sdk/)** - Build custom automation and integrations * **[Distr API](/docs/integrations/api/)** - Explore advanced API capabilities ## Additional Resources * [distr-create-version-action GitHub Repository](https://github.com/distr-sh/distr-create-version-action) * [hello-distr Example Application](https://github.com/distr-sh/hello-distr) - Complete example with Release Please, Docker builds, and automatic deployments * [Release Please Documentation](https://github.com/googleapis/release-please) - Automated release management * [Conventional Commits Specification](https://www.conventionalcommits.org/) - Commit message format for Release Please * [GitHub Actions Documentation](https://docs.github.com/en/actions) * [Distr Community Forum](https://github.com/distr-sh/distr/discussions) *** Have questions? [Get help](https://github.com/distr-sh/distr/discussions) in our community forum or check out the [FAQs](/docs/faqs/).
# Cluster Setup with k3s
> Ship a Helm application to customers that run no Kubernetes cluster. Install k3s on their Linux server with the connect command, provision a managed cluster in their cloud account or install k3s offline with Zarf.
Some customers want your Kubernetes application but do not operate a cluster. Distr gives you four ways to serve them, depending on the application and the environment: | Customer environment | Path | | ------------------------------------------ | ------------------------------------------------------------------------------------------------- | | A Linux server, application runs on Docker | [Docker Compose](/docs/controllers/docker-controller/) with the Docker controller | | A Linux server, application needs Helm | [k3s installed by the connect command](#k3s-installed-by-the-connect-command) | | A cloud account | [A managed cluster from the infrastructure controller](#a-managed-cluster-in-the-customers-cloud) | | An air-gapped network | [k3s from the Zarf init package](#air-gapped-servers) | For production, deploy into a cluster the customer already operates whenever there is one. Otherwise use k3s on a dedicated server or a managed cluster in the customer’s cloud account. Tools that run Kubernetes inside Docker, such as minikube or kind, are built for local development and are not meant for customer installations. ## k3s installed by the connect command [k3s](https://k3s.io) is a lightweight, CNCF-certified Kubernetes distribution that runs on a single Linux server. A [pre-connect script](/docs/controllers/preflight-checks/) can install it before the Kubernetes controller is applied, so the customer runs one command on a fresh server and ends up with a cluster that Distr manages. 1. In the Vendor Portal, open **Organization Settings** and, under **Controllers**, check **Enable Pre- and Post-Connect Scripts (Pre-Flight Checks)**. Paste the script below as the **Pre-connect script** on the **Kubernetes** tab and save. 2. The customer creates a Kubernetes deployment target in the Customer Portal, or you create one for them. 3. The customer runs the connect command on the server as a user with `sudo` or as `root`. The script installs k3s, waits for the node, creates the namespace of the deployment target and the connect command then applies the Distr controller.
```sh
SUDO=""
if [ "$(id -u)" -ne 0 ]; then
SUDO="sudo"
fi
INSTALLED_K3S=false
if ! command -v kubectl > /dev/null 2>&1; then
echo "No kubectl found on this machine. Installing k3s."
curl -sfL https://get.k3s.io | $SUDO sh -s - || exit 1
mkdir -p "$HOME/.kube"
$SUDO cat /etc/rancher/k3s/k3s.yaml > "$HOME/.kube/config" || exit 1
chmod 600 "$HOME/.kube/config"
INSTALLED_K3S=true
fi
# The kubectl that k3s installs reads /etc/rancher/k3s/k3s.yaml, which only root can read, unless KUBECONFIG is set.
if [ -z "$KUBECONFIG" ] && [ -f "$HOME/.kube/config" ]; then
export KUBECONFIG="$HOME/.kube/config"
fi
if [ "$INSTALLED_K3S" = true ]; then
ATTEMPTS=0
until kubectl get nodes -o name 2> /dev/null | grep -q .; do
ATTEMPTS=$((ATTEMPTS + 1))
if [ "$ATTEMPTS" -ge 90 ]; then
echo "FAIL: k3s did not register a node."
exit 1
fi
sleep 2
done
kubectl wait --for=condition=Ready node --all --timeout=180s || exit 1
kubectl create namespace "$DISTR_NAMESPACE" || exit 1
fi
```
The pre-connect script runs for every Kubernetes deployment target in your organization. It only installs k3s on a machine without `kubectl`, so customers that connect an existing cluster are not affected. Running the connect command again on the same server, for example to reconnect the controller, reuses the cluster. The server needs: * Linux with systemd or OpenRC and at least the [k3s requirements](https://docs.k3s.io/installation/requirements) plus what your application needs * Outbound access to `get.k3s.io` and GitHub during the installation, next to the access to Distr that every controller needs To pin the k3s version, replace `$SUDO sh -s -` with `$SUDO env INSTALL_K3S_VERSION=v1.36.5+k3s1 sh -s -`. The k3s [configuration options](https://docs.k3s.io/installation/configuration) are passed the same way. ### Upgrading k3s k3s upgrades itself through the [system-upgrade-controller](https://docs.k3s.io/upgrades/automated), which applies `Plan` resources that name the target k3s version. Package the controller and a `Plan` in a Helm chart and deploy it as a second Distr application on the same deployment target. Publishing an application version with a newer `Plan` version then upgrades the cluster the same way an application update rolls out. ## A managed cluster in the customer’s cloud When the customer has a cloud account but no cluster, an [infrastructure controller](/docs/controllers/infrastructure-controllers/) provisions one with OpenTofu, for example Amazon EKS. The Kubernetes controller then deploys your application onto it. The [BYOC guide](/docs/use-cases/byoc-bring-your-own-cloud/) walks through the setup. ## Air-gapped servers An air-gapped server cannot reach Distr, so the connect command does not apply. The [Zarf](/docs/integrations/zarf/) init package contains an optional k3s component instead: running `zarf init --components k3s --confirm` as `root` on the server installs k3s from the package, without network access. Deploy your application with `zarf package deploy` afterwards, as described in the [air-gapped deployments guide](/docs/use-cases/air-gapped-deployments/). See the [Zarf init package reference](https://docs.zarf.dev/ref/init-package/) for the requirements of that component.
# Creating a Personal Access Token
> Generate secure access tokens to authenticate with Distr's Registry, API and SDK.
In integration scenarios, you need to authenticate with the Distr API using a Personal Access Token (PAT). This applies for any kind of integration, no matter whether you are using the Distr SDK or interacting with the API directly. A Personal Access Token is a unique string that you generate in the Distr web interface. It is directly associated with the user who created it, and with the organization it was created in. It cannot be used to access data of other organizations of the same user. A token consists of a prefix and a second part, separated by an underscore: `distr-_`. The prefix identifies the token and stays the same for its whole life, while the second part is what proves that you are allowed to use it. Distr only stores a hash of that second part, which is why a token is shown to you exactly once and cannot be recovered afterwards. Both parts use digits and letters only, and the token ends in a six character checksum of everything before it. That checksum lets Distr reject a token that was mistyped or truncated on the way, and lets a secret scanner recognize one of our tokens in a repository. Tokens issued before this format existed consist of the prefix alone and have no checksum. ## Creating a Personal Access Token In the top right corner of the Distr web interface, click on your user icon and select **Personal Access Tokens** from the dropdown menu. You can also directly access this page by navigating to (make sure to replace `app.distr.sh` with your Distr instance URL if you selfhost). The page lists the tokens that already exist for your user account, with a filter box above the list to find one by its label. To create a token, click **Create token** in the top right corner. You will be prompted to enter a label, an expiry date and a role. You can leave the label and the expiry empty, but we recommend setting a descriptive label and an expiry date to keep your tokens organized and secure. Only the label can be changed later. The role cannot, so that a token cannot gain access it was not created with, and neither can the expiry date: moving it would change a deadline that whatever holds the token already relies on. To keep an access token alive past that date, add a second token that expires later, as described under [rotating a token](#rotating-a-token). After you have entered the details, click **Create**. Distr generates the token and opens its page, where the token is displayed. This is the only time the token will be shown to you. Make sure to copy it and store it in a secure place. Reloading the page or navigating away removes it from the screen for good. Remember, anybody that has access to this token can authenticate with the Distr API on your behalf. Treat it like your password. ## Scoping a token’s permissions By default, a Personal Access Token operates with the same role you have in the organization. You can lower this when creating the token: the role dropdown only lets you pick a role equal to or below your own (`admin`, `read_write`, `read_only`). The effective role on each request is the lower of the PAT’s role and your current role in the organization. That means: * A `read_only` token issued by an `admin` user can only read. It cannot push artifacts to the registry or change deployments, even though the user could. * If your own role is later downgraded (for example from `admin` to `read_write`), every token you issued is automatically capped at the new lower role on the next request. You do not need to revoke and reissue tokens after a demotion. We recommend creating dedicated lower-privilege tokens for automation that does not need write access, for example a `read_only` token for a CI job that only pulls artifacts from the registry. ## A token’s page Click **Details / Edit** next to a token to open its page. It shows when the access token was created and the role it acts under, and below that the tokens issued for it, each with its own prefix and the time it was created, expires and was last used. The prefix lets you tell which of your tokens a client is configured with, and only the beginning of it is shown, because a legacy token is nothing but its prefix. An access token can have at most two tokens at a time. That second slot exists so that you can rotate without downtime, and **Add token** is unavailable while both are in use. An access token expires when the last token issued for it does, because every token that is still valid authenticates it. The label can be changed here and is saved right away. ## Rotating a token Both of an access token’s two tokens can be valid at the same time, so that you can replace one without ever having a moment where nothing works. They grant exactly the same access, and two tokens of the current format also share a prefix. This is also how an access token is kept alive: the new token gets its own expiry date, and the access token stops working once both have expired. To rotate a token: 1. Click **Add token** on the access token’s page and pick the expiry date of the new one. Distr shows you the new token, which is the same prefix with a new second part. Note it down, it is only shown once. 2. Roll it out everywhere the old one is in use. The “last used” timestamp of the old token tells you whether anything is still authenticating with it. 3. Delete the old token once its “last used” timestamp stops moving. At least one token has to remain, so the last one cannot be deleted. Delete the whole access token instead. ## Migrating a legacy token Tokens created before Distr split them into a prefix and a second part have no second part at all, and both the list and the token’s own page mark them as **Legacy**. Such a token is its own credential, which is why Distr asks you to migrate it to the format that has one. A legacy token keeps working while you migrate, so the steps are the same as [rotating a token](#rotating-a-token): click **Add token**, roll the new one out, then delete the legacy entry once its “last used” timestamp stops moving. Nothing breaks the moment you add the token, and the legacy one stops working only when you delete it or its expiry date passes. A legacy token counts towards the two an access token can have, so you can add exactly one token next to it and have to delete the legacy entry before adding another. Migrating is not optional forever: a legacy token that was issued without an expiry date was given one 90 days out when your instance introduced this format, and it stops working on that date whether or not it has been migrated by then. The two differ in the prefix they start with, because a legacy token is in the hex encoding it was issued in and the new one in the encoding the current format uses. The token’s page shows the prefix per entry for exactly that reason. ## Deleting Personal Access Tokens On the same page you are also able to delete tokens. Click on the trash icon next to the token you want to delete and confirm the action. Note that any application using this token will no longer be able to authenticate with the Distr API.
# Remote Access for Debugging
> Debug a customer installation remotely by deploying Tailscale or a Cloudflare Tunnel as a Distr application next to your application, with access the customer can see and revoke.
Logs, metrics and [support bundles](/docs/platform/support-bundles/) answer most questions about a customer installation. For the rest, your support engineers need [remote access](/glossary/vendor-remote-access/) to look at the running containers themselves. Customer environments rarely accept inbound connections, so this guide uses a [reverse tunnel](/glossary/reverse-tunnel/) instead: it connects outbound from the customer environment to [Tailscale](https://tailscale.com) or [Cloudflare](https://www.cloudflare.com), and your support team comes in from there. You ship the tunnel like your application, as a Distr application that the Distr controller in the customer environment deploys. ## How remote access works with Distr 1. Create a separate [application](/docs/controllers/application/), for example **Remote Access**, with a version that contains the tunnel. The tool guides below provide the Compose file and the Helm values for it. 2. Store the credential of the tunnel as a [customer-specific secret](/docs/controllers/secrets/#customer-specific-secrets) of the customer you want to support. 3. Deploy the application to the customer’s existing deployment target with **+ Deploy App**, as described in [Using Existing Deployment Targets](/docs/controllers/deployment/#using-existing-deployment-targets). It runs next to your application, and the deployment target stays as it is. 4. Debug the installation through the tunnel. 5. Undeploy the application when the support case is closed. The customer opens no port in their firewall, since the tunnel only connects outbound. The deployment shows up in the Customer Portal like any other. The customer sees when remote access is active and can undeploy it themselves. If you use [application entitlements](/docs/platform/application-entitlements/), grant the customer the remote access application too, or it does not appear in the deployment wizard. Caution Remote access reaches into an environment the customer operates. Agree with the customer on when you deploy it and what you may do with it before you deploy it. ## Storing the tunnel credential per customer Give every customer their own tunnel credential: a Cloudflare tunnel token or a Tailscale auth key. Store it as a customer-specific secret, which Distr only injects into that customer’s deployments, and reference it from the deployment configuration:
```dotenv
TS_AUTHKEY={{ .Secrets.TAILSCALE_AUTHKEY }}
```
If you revoke one customer’s credential, the other customers keep their access. The value itself never shows up in the Compose file, the Helm values or the deployment logs. See [Secrets Management](/docs/controllers/secrets/) for the template syntax. ## Docker Compose: the Docker socket On a Docker deployment target, your application runs as containers of the Docker engine on the customer’s host. A container that mounts the engine’s socket, `/var/run/docker.sock`, gets the full Docker API. `docker ps`, `docker logs`, `docker inspect` and `docker exec` then work for every container on the host, your application included. You can use the socket through the tunnel in two ways: * Your support engineer opens a shell in a debug container that mounts the socket and ships the Docker CLI, then runs `docker` commands as if logged in to the host. * A small proxy exposes the socket to the tunnel, and your support engineer points the Docker CLI on their own machine at it with `docker -H` or a Docker context. If the deployment target uses a [custom Docker endpoint](/docs/controllers/docker-controller/#custom-docker-endpoint), mount that socket instead of `/var/run/docker.sock`. Danger Access to the Docker socket is root access to the host. Anyone who reaches the socket can start a privileged container that mounts the host’s file system. Restrict who may connect in your tunnel’s access policy and never deploy the remote access application without the customer’s consent. ## Kubernetes: a ServiceAccount for your support team On a Kubernetes deployment target, the tunnel exposes the cluster’s Kubernetes API server, and your support engineer runs `kubectl` against it. The identity `kubectl` presents decides what it may do. The customer therefore creates a ServiceAccount for your support team and binds it to a Role in the namespace of your application. They review the manifest before they apply it, so they decide what your support team can do: vendor-support-rbac.yaml
```yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: vendor-support
namespace: acme
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: vendor-support
namespace: acme
rules:
- apiGroups: ['']
resources:
- pods
- pods/log
- services
- endpoints
- configmaps
- persistentvolumeclaims
- events
verbs: [get, list, watch]
- apiGroups: [apps]
resources: [deployments, statefulsets, daemonsets, replicasets]
verbs: [get, list, watch]
- apiGroups: [batch]
resources: [jobs, cronjobs]
verbs: [get, list, watch]
# Delete this rule to keep the vendor out of the containers.
- apiGroups: ['']
resources: [pods/exec, pods/portforward]
verbs: [get, create]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: vendor-support
namespace: acme
subjects:
- kind: ServiceAccount
name: vendor-support
namespace: acme
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: vendor-support
```
The Role can read the workloads of the namespace and their logs, but not its Secrets. Its last rule allows `kubectl exec` and `kubectl port-forward`, the Kubernetes equivalent of a shell in a debug container. A customer who wants to keep your support team out of the containers deletes that rule. Change `acme` to the namespace of the deployment target and apply the manifest:
```shell
kubectl apply -f vendor-support-rbac.yaml
```
When a support case starts, the customer issues a short-lived token for the ServiceAccount and sends it to your support engineer:
```shell
kubectl create token vendor-support --namespace acme --duration 8h
```
The token expires on its own, and deleting the ServiceAccount revokes it earlier. Some clusters cap the lifetime of tokens, in which case the token expires sooner than requested. Caution Never debug with the ServiceAccount of the Distr controller. It is bound to `cluster-admin` or to an admin role of its namespace, as described in [Kubernetes Controller](/docs/controllers/kubernetes-controller/), and its credentials are not meant to leave the cluster. ## Choosing a tool for each deployment type | Deployment target | Recommended tool | | ----------------- | ------------------------------------------------------------------------ | | Docker Compose | [Tailscale](/docs/integrations/remote-access/tailscale/) | | Kubernetes | [Cloudflare Tunnel](/docs/integrations/remote-access/cloudflare-tunnel/) | ### Why Tailscale for Docker Compose One Tailscale container joins your tailnet. Through it, Tailscale SSH and MagicDNS give your support engineers a shell or the forwarded socket under the name of the host. Your tailnet authorizes every connection by the identity of the engineer, and nothing besides that container runs on the host. ### Why Cloudflare Tunnel for Kubernetes Tailscale gets into a cluster through the [Tailscale Kubernetes operator](https://tailscale.com/kb/1236/kubernetes-operator). The operator installs custom resource definitions and ClusterRoles, and its API server proxy needs the right to impersonate any user and group of the cluster. It therefore only runs on a cluster-scoped deployment target. Customers who share the cluster with other teams or vendors rarely accept that. An operator that reconciles cluster-wide resources is also hard to remove cleanly once the support case is closed. A Cloudflare Tunnel is a single cloudflared Deployment in the namespace of your application. Its ServiceAccount has no permissions, so it runs on a namespace-scoped deployment target, and the `vendor-support` ServiceAccount alone decides what your support team may do in the cluster. ## Closing remote access When the support case is closed: 1. Undeploy the remote access application in Distr, or let the customer undeploy it in the Customer Portal. 2. Delete the tunnel in Cloudflare or the device in your tailnet, if it is not removed automatically. 3. On Kubernetes, let the token expire or delete the `vendor-support` ServiceAccount.
# Kubernetes with Cloudflare Tunnel
> Debug a customer's Kubernetes installation through a Cloudflare Tunnel that runs as a single cloudflared Deployment, with kubectl access limited to a ServiceAccount the customer controls.
With this setup, a [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/) on the customer’s Kubernetes deployment target exposes the cluster’s Kubernetes API server to your support engineers, behind [Cloudflare Access](https://developers.cloudflare.com/cloudflare-one/access-controls/). Read the [Remote Access Overview](/docs/integrations/remote-access/) first. It explains how the remote access application runs next to your application and how the customer creates the `vendor-support` ServiceAccount, which decides what your support team may do. The [tunnel](/glossary/reverse-tunnel/) is a single cloudflared Deployment in the namespace of your application. Its ServiceAccount has no permissions at all, so it runs on a namespace-scoped deployment target. ## Preparing Cloudflare You set this up in the [Cloudflare One dashboard](https://one.dash.cloudflare.com/) of your Cloudflare account. The hostname of the tunnel needs a domain on Cloudflare, for example `example.com`. ### 1. Create a tunnel for the customer Under **Networks** > **Tunnels**, create a tunnel of type **Cloudflared** named after the customer, for example `acme`. The dashboard then shows an install command with the tunnel token in it, the long string starting with `eyJ`. Copy the token and skip the installation, because Distr deploys cloudflared for you. Give every customer their own tunnel. Deleting one then cuts off only that customer. ### 2. Route a hostname to the Kubernetes API server Add a published application route to the tunnel: * **Hostname**: `k8s-acme.example.com` * **Service type**: `TCP` * **URL**: `kubernetes.default.svc:443` Every cluster serves its API server at `kubernetes.default.svc`, so the route works without knowing anything about the customer’s cluster. Cloudflare’s own [kubectl guide](https://developers.cloudflare.com/cloudflare-one/tutorials/kubectl/) turns the tunnel into a SOCKS proxy instead. Do not follow it here. A SOCKS proxy lets the client reach every address the cloudflared pod can reach, while this route only leads to the API server. ### 3. Protect the hostname with Cloudflare Access Under **Access controls** > **Applications**, add a **Self-hosted** application for `k8s-acme.example.com`. Give it a policy that only allows your support team, for example by their email addresses or by a group in your identity provider. Without that policy, anyone who knows the hostname can reach the customer’s API server, and only the API server’s own authentication stands in their way. ## Creating the application in Distr ### 1. Store the tunnel token Open **Customers**, click **Manage secrets** next to the customer and create the secret `CLOUDFLARE_TUNNEL_TOKEN` with the tunnel token as its value. ### 2. Create the application Create a Kubernetes application called **Remote Access** and add a version that uses Cloudflare’s [`cloudflare-tunnel-remote`](https://github.com/cloudflare/helm-charts/tree/main/charts/cloudflare-tunnel-remote) chart: * **Chart Type**: `Repository` * **Chart Name**: `cloudflare-tunnel-remote` * **Chart URL**: `https://cloudflare.github.io/helm-charts` * **Chart Version**: `0.1.2` Enter these values as the **Template for Customer Values**. Every deployment starts from them, and Distr fills in the secret when it deploys: values.yaml
```yaml
cloudflare:
tunnel_token: '{{ .Secrets.CLOUDFLARE_TUNNEL_TOKEN }}'
image:
tag: 2026.10.7
replicaCount: 1
```
The chart puts the token into a Kubernetes Secret and starts cloudflared with it. Without `image.tag`, it pulls the `latest` cloudflared image. It also runs two replicas by default, more than a tunnel for debugging needs. ### 3. Deploy the tunnel Deploy the application to the customer’s Kubernetes deployment target with **+ Deploy App**. Once the pod runs, the Cloudflare dashboard shows the tunnel as healthy. The pod connects out to Cloudflare on port 7844 and to the API server, and it resolves both names through the cluster DNS. Customers who restrict egress with NetworkPolicies have to allow both connections and DNS on port 53 over UDP and TCP. ## Giving your support team access ### 1. Receive the credentials from the customer The customer applies `vendor-support-rbac.yaml` as described in the [overview](/docs/integrations/remote-access/#kubernetes-a-serviceaccount-for-your-support-team) and sends your support engineer two values: a short-lived token and the certificate of the cluster’s certificate authority.
```shell
kubectl create token vendor-support --namespace acme --duration 8h
kubectl get configmap kube-root-ca.crt --namespace acme \
--output jsonpath='{.data.ca\.crt}' | base64 | tr -d '\n'
```
The token grants access to the customer’s cluster. The customer should send it through a channel both sides trust, not in a support ticket. ### 2. Start the local end of the tunnel Your support engineer installs [cloudflared](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/) and opens the tunnel on a local port:
```shell
cloudflared access tcp --hostname k8s-acme.example.com --url 127.0.0.1:6443
```
On the first connection, cloudflared opens a browser to log in to Cloudflare Access. ### 3. Connect with kubectl Save this kubeconfig as `acme-kubeconfig.yaml` with the two values from the customer: acme-kubeconfig.yaml
```yaml
apiVersion: v1
kind: Config
clusters:
- name: acme
cluster:
server: https://127.0.0.1:6443
tls-server-name: kubernetes.default.svc
certificate-authority-data: CLUSTER-CA-BASE64
users:
- name: acme-vendor-support
user:
token: SERVICE-ACCOUNT-TOKEN
contexts:
- name: acme
context:
cluster: acme
user: acme-vendor-support
namespace: acme
current-context: acme
```
kubectl connects to `127.0.0.1`, which is not a name on the API server’s certificate. `tls-server-name` tells kubectl to check the certificate against `kubernetes.default.svc` instead. From there, the cluster works like any other:
```shell
export KUBECONFIG=acme-kubeconfig.yaml
kubectl get pods
kubectl logs deployment/acme-backend --tail 100
kubectl exec -it deployment/acme-backend -- sh
kubectl port-forward service/acme-backend 8080:80
```
kubectl acts as the `vendor-support` ServiceAccount, and any command the Role does not allow fails with `Forbidden`. `kubectl exec` and `kubectl port-forward` only work while the Role keeps its rule for `pods/exec` and `pods/portforward`. `kubectl debug` also needs `patch` on `pods/ephemeralcontainers`, which the customer can add to the Role. ## Closing access When the support case is closed: 1. Undeploy the remote access application, which removes the cloudflared Deployment and the Secret with the tunnel token. 2. Delete the tunnel in the Cloudflare dashboard, or keep it and its secret in Distr for the next support case. 3. Let the token expire, or have the customer delete the `vendor-support` ServiceAccount to revoke it right away.
# Docker Compose with Tailscale
> Debug a customer's Docker Compose installation through Tailscale, with a shell over Tailscale SSH or the Docker socket forwarded to your own Docker CLI.
With this setup, a Tailscale container on the customer’s Docker deployment target joins your [tailnet](https://tailscale.com/kb/1136/tailnet), and your support engineers reach the host’s Docker engine through it. Read the [Remote Access Overview](/docs/integrations/remote-access/) first. It explains how the remote access application runs next to your application and what access to the Docker socket means. There are two ways to reach the Docker engine: * [A shell over Tailscale SSH](#option-1-a-shell-over-tailscale-ssh) in a container that ships the Docker CLI. * [The forwarded Docker socket](#option-2-the-forwarded-docker-socket), which the Docker CLI on your own machine connects to. ## Preparing your tailnet The customer’s container joins your tailnet, not the customer’s. Each customer gets a tag, which keeps their container apart from other customers and from the rest of your tailnet. Only your support team may connect to it. Your support engineers need Tailscale installed on their own machines and signed in to your tailnet. Keep [MagicDNS](https://tailscale.com/kb/1081/magicdns) enabled, which it is by default, so that the device names used below resolve. ### 1. Write the access policy Add a group for your support team, a tag for the customer, a grant and an SSH rule to the [tailnet policy file](https://tailscale.com/kb/1337/policy-syntax): policy.hujson
```json
{
"groups": {
"group:support": ["alice@example.com", "bob@example.com"]
},
"tagOwners": {
"tag:customer-acme": ["autogroup:admin"]
},
"grants": [
{
"src": ["group:support"],
"dst": ["tag:customer-acme"],
"ip": ["tcp:22", "tcp:2375"]
}
],
"ssh": [
{
"action": "check",
"src": ["group:support"],
"dst": ["tag:customer-acme"],
"users": ["root"],
"checkPeriod": "12h"
}
]
}
```
The grant opens port 22 of the customer’s container for Tailscale SSH and port 2375 for the forwarded socket, and only to your support team. The SSH rule logs them in as `root` in that container, and `check` makes them authenticate again every 12 hours. Danger No rule may give `tag:customer-acme` access to anything. A new tailnet comes with a default rule that allows all traffic. Remove it, or the customer’s host can reach every device in your tailnet. For the next customer, add another tag such as `tag:customer-globex` with its own grant and SSH rule. ### 2. Create an auth key In the Tailscale admin console, generate an [auth key](https://tailscale.com/kb/1085/auth-keys) under **Settings** > **Keys** with these settings: * **Reusable**, so the container can register again after a restart. * **Ephemeral**, so the device disappears from your tailnet shortly after the container stops. * **Pre-approved**, if your tailnet requires device approval. * **Tags**: `tag:customer-acme`. ### 3. Store the auth key in Distr Open **Customers**, click **Manage secrets** next to the customer and create the secret `TAILSCALE_AUTHKEY` with the auth key as its value. The Compose files below read it through the `.env` template. ## Option 1: a shell over Tailscale SSH [Tailscale SSH](https://tailscale.com/kb/1193/tailscale-ssh) runs inside the Tailscale container, and that is where your support engineer’s shell opens. The official image has no Docker CLI, so you build a small image that adds it. ### 1. Build the image and push it to Distr Dockerfile
```dockerfile
FROM tailscale/tailscale:v1.104.4
RUN apk add --no-cache docker-cli
```
Build it for the platforms of your customers and push it to the [Distr registry](/docs/registry/):
```shell
docker buildx build --platform linux/amd64,linux/arm64 \
--tag registry.distr.sh/your-org/remote-access:1.104.4 --push .
```
The Distr controller pulls images from the Distr registry with its own credentials. If you use [artifact entitlements](/docs/platform/artifact-entitlements/), grant the customer the image. You can also make it a [public artifact](/docs/registry/#public-artifacts), because it contains nothing but Tailscale and the Docker CLI. ### 2. Create the application Create a Docker application called **Remote Access** and add a version with this Compose file and this **Template for Environment File**: * docker-compose.yaml
```yaml
services:
tailscale:
image: registry.distr.sh/your-org/remote-access:1.104.4
environment:
TS_AUTHKEY: ${TS_AUTHKEY:?}
TS_HOSTNAME: ${TS_HOSTNAME:?}
TS_EXTRA_ARGS: --ssh
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
```
* .env
```dotenv
TS_AUTHKEY={{ .Secrets.TAILSCALE_AUTHKEY }}
TS_HOSTNAME=acme-debug
```
`TS_EXTRA_ARGS: --ssh` turns on the Tailscale SSH server. The mounted socket connects the Docker CLI in the container to the host’s Docker engine. `TS_HOSTNAME` is the name of the device in your tailnet; set a different one for each customer when you deploy. ### 3. Deploy and connect Deploy the application to the customer’s deployment target with **+ Deploy App**. Once the deployment is running, the device `acme-debug` appears in your tailnet, and your support engineer connects to it:
```shell
tailscale ssh root@acme-debug
```
In that shell, the Docker CLI talks to the host’s Docker engine:
```shell
docker ps
docker logs --tail 100 distr-1a2b3c4d-backend-1
docker exec -it distr-1a2b3c4d-backend-1 sh
```
The Distr controller runs each deployment as a Compose project named `distr-`, and the container names start with that prefix. ## Option 2: the forwarded Docker socket Here your support engineer works with the Docker CLI on their own machine, where their usual tools and scripts are. You do not need an image of your own for this option. ### 1. Create the application Create a Docker application called **Remote Access** and add a version with this Compose file and this **Template for Environment File**: * docker-compose.yaml
```yaml
services:
tailscale:
image: tailscale/tailscale:v1.104.4
environment:
TS_AUTHKEY: ${TS_AUTHKEY:?}
TS_HOSTNAME: ${TS_HOSTNAME:?}
TS_SERVE_CONFIG: /config/serve.json
configs:
- source: tailscale-serve
target: /config/serve.json
restart: unless-stopped
docker-socket:
image: alpine/socat:1.8.1.3
command: tcp-listen:2375,bind=127.0.0.1,fork,reuseaddr unix-connect:/var/run/docker.sock
network_mode: service:tailscale
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
configs:
tailscale-serve:
content: |
{"TCP": {"2375": {"TCPForward": "127.0.0.1:2375"}}}
```
* .env
```dotenv
TS_AUTHKEY={{ .Secrets.TAILSCALE_AUTHKEY }}
TS_HOSTNAME=acme-debug
```
The `docker-socket` container shares the network of the `tailscale` container and serves the mounted socket on `127.0.0.1:2375`. Neither the host nor any other container can reach that address. [Tailscale Serve](https://tailscale.com/kb/1312/serve) forwards port 2375 of the device in your tailnet to it, as configured in the `TS_SERVE_CONFIG` file. Deploy this version in regular Compose mode, because Docker Swarm does not support `network_mode: service:`. ### 2. Deploy and connect Deploy the application to the customer’s deployment target with **+ Deploy App**. Your support engineer then creates a Docker context for the customer on their own machine and uses it like a local Docker engine:
```shell
docker context create acme --docker host=tcp://acme-debug:2375
docker --context acme ps
docker --context acme logs --tail 100 distr-1a2b3c4d-backend-1
docker --context acme exec -it distr-1a2b3c4d-backend-1 sh
```
The Docker API on port 2375 is unencrypted. The connection still runs inside Tailscale’s WireGuard tunnel, and only devices the grant admits can open it. ## Closing access Undeploy the remote access application when the support case is closed. The container stops, and Tailscale removes the ephemeral device from your tailnet shortly after. To lock out a customer’s container right away, remove the device in the Tailscale admin console and revoke the auth key. Create a new key and update the secret before the next support case. Your support engineer removes the Docker context with `docker context rm acme`.
# Distr SDK
> Integrate Distr into your applications with our TypeScript/JavaScript SDK for programmatic access to deployments, registries, and more.
Distr SDKs are first-party libraries that allow you to interact with the Distr platform programmatically. In the simplest case, you can use them as an API wrapper that executes HTTP requests to the [Distr API](/docs/integrations/api/). For more high level use cases, they offer services that help you to interact with the Distr platform in a more convenient way, e.g. by providing methods for checking if a deployment is outdated. Currently, we offer an SDK for TS/JS, which is available on [npm](https://www.npmjs.com/package/@distr-sh/distr-sdk). More languages are planned to be supported in the future. ## JavaScript SDK You can install the Distr SDK for JavaScript from [npm](https://npmjs.org/package/@distr-sh/distr-sdk):
```shell
npm install --save @distr-sh/distr-sdk
```
Conceptually, the SDK is divided into two parts: * A high-level service called `DistrService`, which provides a simplified interface for interacting with the Distr API. * A low-level client called `Client`, which provides a more direct interface for interacting with the Distr API. In order to connect to the Distr API, you have to [create a Personal Access Token (PAT)](/docs/integrations/personal-access-token/) in the Distr web interface. Optionally, you can specify the URL of the Distr API you want to communicate with. It defaults to `https://app.distr.sh/api/v1`.
```typescript
import {DistrService} from '@distr-sh/distr-sdk';
const service = new DistrService({
// to use your selfhosted instance, set apiBase: 'https://selfhosted-instance.company/api/v1',
apiKey: '',
});
// do something with the service
```
The [src/examples](https://github.com/distr-sh/distr/tree/main/sdk/js/src/examples) directory contains examples of how to use the SDK. See the [docs](https://github.com/distr-sh/distr/tree/main/sdk/js/docs/README.md) for more information. ## Feedback We are always open to hear what is missing or not working in our SDKs. Please let us know in our [GitHub repository](https://github.com/distr-sh/distr).
# Air-Gapped Deployments with Distr and Zarf
> Package your application, Helm chart, and all container images into a single Zarf package, publish it to the Distr registry as an OCI artifact, and let customers deploy it into air-gapped Kubernetes clusters.
[Zarf](https://zarf.dev) is an open-source tool for delivering software into air-gapped and disconnected environments. A Zarf package bundles everything a Kubernetes application needs (Helm charts, container images, and manifests) into a single archive that can be deployed without any access to external registries. Zarf packages are published as standard [OCI artifacts](/glossary/oci-container-artifact-registry/), so the [Distr Artifact Registry](/docs/registry/) can host them like any other artifact. You publish packages from your CI pipeline, decide which customer gets access to which package with [artifact entitlements](/docs/platform/artifact-entitlements/), and see per-customer download analytics. Your customers pull a package once and can then deploy it into clusters that have no internet access at all. By the end of this guide, you’ll have: * A `zarf.yaml` package definition for your Helm-based application * A GitHub Actions job that builds and publishes a multi-architecture Zarf package to the Distr registry on every release * A deployment flow your customers can use to install the package in connected or fully air-gapped clusters This guide follows the setup of the [hello-distr](https://github.com/distr-sh/hello-distr) example application. If you haven’t read it yet, the [Automatic Deployments from GitHub](/docs/integrations/github-actions/) guide covers the surrounding release automation in detail. ## Prerequisites Before starting, ensure you have: 1. A Distr account with a [registry slug configured](/docs/registry/configuration/) 2. A [Personal Access Token](/docs/integrations/personal-access-token/) for pushing to the registry 3. A Helm chart for your application, with all container images published to a registry 4. The [Zarf CLI](https://docs.zarf.dev/getting-started/install/) installed locally for testing ## How the Integration Works The delivery pipeline looks like this: 1. Your release workflow builds and pushes your container images and Helm chart 2. `zarf package create` reads your `zarf.yaml`, resolves the chart (from a local path in this guide, but Helm repositories and Git are also supported), pulls all referenced images, and writes a single `.tar.zst` archive that also includes SBOMs for every image 3. `zarf package publish` pushes the archive to the Distr registry as an OCI artifact 4. Your customers deploy directly from the registry with `zarf package deploy oci://...`, or download the package once and carry it across the gap Once published, the package shows up in your Distr registry UI like any other artifact, including tags, size, and per-customer pull analytics. ## Step 1: Create the Zarf Package Definition Create a `zarf.yaml` next to your deployment files (hello-distr keeps it in `deploy/zarf/`):
```yaml
kind: ZarfPackageConfig
metadata:
name: hello-distr
description: A sample multi-service application for the Distr platform
version: '###ZARF_PKG_TMPL_VERSION###'
url: https://github.com/distr-sh/hello-distr
components:
- name: hello-distr
required: true
description: Deploys the Hello Distr Helm chart together with all required images
charts:
- name: hello-distr
namespace: hello-distr
version: '###ZARF_PKG_TMPL_VERSION###'
localPath: ../charts/hello-distr
images:
- 'ghcr.io/distr-sh/hello-distr/backend:###ZARF_PKG_TMPL_VERSION###'
- 'ghcr.io/distr-sh/hello-distr/frontend:###ZARF_PKG_TMPL_VERSION###'
- 'ghcr.io/distr-sh/hello-distr/proxy:###ZARF_PKG_TMPL_VERSION###'
- 'ghcr.io/distr-sh/hello-distr/jobs:###ZARF_PKG_TMPL_VERSION###'
- 'docker.io/postgres:18.4-alpine3.23'
```
Key points: * `###ZARF_PKG_TMPL_VERSION###` is a Zarf package template. Its value is provided at build time with `--set VERSION=...`, so the package version, chart version, and image tags all stay in sync with your release tag. * `charts[].version` is required, also for `localPath` charts. It must match the `version` in your `Chart.yaml`. If you use [Release Please](https://github.com/googleapis/release-please) as described in the [GitHub guide](/docs/integrations/github-actions/), both are bumped from the same release tag automatically. * `images` must list every image your chart deploys, including dependency images such as the PostgreSQL database. Zarf pushes these into the target cluster’s internal registry at deploy time, so nothing is pulled from the internet. You can validate the definition at any time:
```shell
zarf dev lint deploy/zarf --set VERSION=1.0.0
```
## Step 2: Build and Test Locally Build the chart dependencies and create the package:
```shell
helm dependency build deploy/charts/hello-distr
zarf package create deploy/zarf --set VERSION=1.0.0 -o build --confirm
```
This produces `build/zarf-package-hello-distr--1.0.0.tar.zst` containing the chart, all images, and generated SBOMs. To test it against a local cluster (for example minikube) that has been initialized with `zarf init`:
```shell
zarf package deploy build/zarf-package-hello-distr-*-1.0.0.tar.zst --confirm
```
Zarf pushes the bundled images into the cluster’s internal registry, rewrites the image references, and installs the Helm chart. This is exactly what will happen later in your customer’s environment. ## Step 3: Publish to the Distr Registry Log in to the Distr registry with your Personal Access Token. Distr only validates the token, so the username can be any value; `-` is used as a placeholder here:
```shell
zarf tools registry login registry.distr.sh -u - -p "YOUR-ACCESS-TOKEN"
```
Then publish the package. The OCI reference is your registry hostname plus your organization’s registry slug:
```shell
zarf package publish build/zarf-package-hello-distr-*.tar.zst oci://registry.distr.sh/your-slug
```
The package is now available at `oci://registry.distr.sh/your-slug/hello-distr:1.0.0` and appears in the Distr registry UI, where you can license it to customers via [artifact entitlements](/docs/platform/artifact-entitlements/).  The artifact detail page shows all published tags with their size and pull counts, and displays the exact `zarf package deploy` command your customers can copy to install the package.  ## Step 4: Automate with GitHub Actions Add a job to your release workflow that creates and publishes the Zarf package for every release tag. This is the `build-zarf` job from the [hello-distr workflow](https://github.com/distr-sh/hello-distr/blob/main/.github/workflows/hello-distr.yaml):
```yaml
build-zarf:
name: Build Zarf package
needs: build # wait until all container images are pushed
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup helm
uses: azure/setup-helm@v5
- name: Build helm dependencies
run: helm dependency build deploy/charts/hello-distr
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Distr Registry
uses: docker/login-action@v4
with:
registry: registry.distr.sh
username: ${{ github.actor }}
password: ${{ secrets.DISTR_TOKEN }}
- name: Setup Zarf
uses: zarf-dev/setup-zarf@v1
with:
version: v0.81.0
- name: Create Zarf package
run: |
zarf package create deploy/zarf -a amd64 --set VERSION="${{ github.ref_name }}" --confirm
zarf package create deploy/zarf -a arm64 --set VERSION="${{ github.ref_name }}" --confirm
- name: Publish Zarf package to Distr registry
run: |
for pkg in zarf-package-hello-distr-*.tar.zst; do
zarf package publish "$pkg" oci://registry.distr.sh/your-slug
done
```
Notes on this job: * `needs: build` ensures the container images exist in the source registry before Zarf tries to pull them into the package. * `DISTR_TOKEN` is a repository secret containing your Distr [Personal Access Token](/docs/integrations/personal-access-token/). * The job builds one package per CPU architecture (`-a amd64` and `-a arm64`). Publishing both to the same OCI reference creates a multi-arch index, so `zarf package deploy` automatically selects the right package for the target cluster. Note that publishing the second architecture updates the already existing tag, which requires mutable tags. By default, the Distr registry uses [immutable tags](/docs/registry/), so enable “Artifact versions are mutable” on the organization settings page for this to work. * `--set VERSION="${{ github.ref_name }}"` wires the release tag into the `###ZARF_PKG_TMPL_VERSION###` template. ## Step 5: Customer Deployment Customers authenticate with their own [Personal Access Token](/docs/integrations/personal-access-token/) and can only access packages they are licensed for. ### Connected Clusters For clusters that can reach the Distr registry, customers deploy directly from the OCI reference:
```shell
zarf tools registry login registry.distr.sh -u - -p "CUSTOMER-ACCESS-TOKEN"
zarf init --confirm
zarf package deploy oci://registry.distr.sh/your-slug/hello-distr:1.0.0 --confirm
```
### Fully Air-Gapped Clusters For environments without any internet access, customers pull the package on a machine that can reach the Distr registry, transfer it across the gap (for example on physical media), and deploy from the local file:
```shell
# On a machine with registry access
zarf package pull oci://registry.distr.sh/your-slug/hello-distr:1.0.0
# Transfer zarf-package-hello-distr-*.tar.zst across the gap, then:
zarf init --confirm
zarf package deploy zarf-package-hello-distr-amd64-1.0.0.tar.zst --confirm
```
In both cases, `zarf init` sets up Zarf’s in-cluster registry once per cluster. Every subsequent package deployment pushes its bundled images there, so the cluster never has to pull an image from an external registry. ## Troubleshooting ### Package Creation Fails with “must include a chart version” Zarf requires an explicit `version` on every chart entry, including charts referenced via `localPath`. Add `version: '###ZARF_PKG_TMPL_VERSION###'` (or the concrete chart version) to the chart definition in your `zarf.yaml`. ### Deployed Pods Fail with “ImagePullBackOff” An image referenced by your Helm chart might be missing from the `images` list in `zarf.yaml`. Render your chart and compare against the package definition:
```shell
helm template test deploy/charts/hello-distr | grep 'image:'
```
Every image in the output (including subchart images) must be listed in `zarf.yaml`. ### Deployment Fails with “no package found for architecture” The published package doesn’t include a build for the target cluster’s CPU architecture. Build and publish one package per architecture as shown in [Step 4](#step-4-automate-with-github-actions). ## Next Steps * **[Artifact Entitlements](/docs/platform/artifact-entitlements/)** - License Zarf packages to specific customers * **[Artifact Registry](/docs/registry/)** - Learn more about the Distr registry and download analytics * **[Automatic Deployments from GitHub](/docs/integrations/github-actions/)** - Set up the surrounding release automation ## Additional Resources * [Zarf Documentation](https://docs.zarf.dev) - Official Zarf documentation * [hello-distr Example Application](https://github.com/distr-sh/hello-distr) - Complete example including the Zarf package definition and CI workflow * [Distr Community Forum](https://github.com/distr-sh/distr/discussions) *** Have questions? [Get help](https://github.com/distr-sh/distr/discussions) in our community forum or check out the [FAQs](/docs/faqs/).
# Distribution Platform
> Manage licenses, entitlements, customer access and compliance tools for your software distribution.
The Distr Distribution Platform covers the commercial and operational side of shipping software into customer-controlled environments: what you ship, who is allowed to run it, what their license permits and what you can see once it runs. ## Platform Capabilities * **Application delivery**: define Docker Compose and Helm applications with versions and configuration templates, then roll them out and track every revision. See [Application](/docs/controllers/application/) and [Deployment](/docs/controllers/deployment/). * **Docker and Kubernetes deployment controllers**: the [Docker controller](/docs/controllers/docker-controller/) runs Compose projects on any Linux host and supports Docker Swarm, and the [Kubernetes controller](/docs/controllers/kubernetes-controller/) manages Helm releases with cluster- or namespace-scoped permissions. See [Deployment Controllers](/docs/controllers/). * **Customer management**: create customer organizations, invite their users and turn portal features on per customer. See [Customer Management](/docs/platform/customer-management/) and the white-labeled [Customer Portal](/docs/platform/customer-portal/). * **Application and artifact entitlements**: control which application versions a customer may deploy and which artifacts and tags they may pull. See [Application Entitlements](/docs/platform/application-entitlements/) and [Artifact Entitlements](/docs/platform/artifact-entitlements/). * **Signed offline license keys**: issue Ed25519-signed JWTs carrying your own claims, verified locally by your application without a callback to Distr, so licensing also works in air-gapped environments. See [License Keys](/docs/platform/license-keys/). * **Logs, metrics and support bundles**: follow deployment status, controller and container logs and host metrics, and let customers hand over diagnostics when they report an issue. See [Logs & Metrics](/docs/controllers/logs-and-metrics/) and [Support Bundles](/docs/platform/support-bundles/). * **Cloud and self-hosted operation**: run on Distr Cloud or operate the platform yourself with Docker Compose or Helm. See [Self-Hosting](/docs/self-hosting/). ## License Management Control access to your applications and artifacts: * **[License Management](/docs/platform/license-management/)** - Overview of the licensing system * **[Application Entitlements](/docs/platform/application-entitlements/)** - Control which application versions customers can deploy * **[Artifact Entitlements](/docs/platform/artifact-entitlements/)** - Control which artifacts customers can access * **[License Keys](/docs/platform/license-keys/)** - Issue signed tokens for usage limits and feature access ## Support Validate, scan and support your deployments: * **[Support Bundles](/docs/platform/support-bundles/)** - Collect and review diagnostic data from customers * **[Kubernetes Compatibility Matrix](/docs/platform/kubernetes-compatibility-matrix/)** - Validate Helm charts against multiple Kubernetes versions * **[Vulnerability Scanning](/docs/platform/vulnerability-scanning/)** - Scan for known vulnerabilities in dependencies and images ## Customer Portal The customer-facing interface for your end customers: * **[Customer Portal](/docs/platform/customer-portal/)** - Overview of the white-labeled customer UI * **[Artifact Registry](/docs/platform/customer-portal/registry/)** - End-customer guide to accessing artifacts * **[Deployments](/docs/platform/customer-portal/deployments/)** - End-customer guide to deploying with controllers * **[Licenses](/docs/platform/customer-portal/licenses/)** - End-customer guide to viewing license keys * **[Support Bundles](/docs/platform/customer-portal/support/)** - End-customer guide to creating support bundles * **[Secrets](/docs/platform/customer-portal/secrets/)** - End-customer guide to managing secrets ## Customer Management Manage customer organizations and their access: * **[Customer Management](/docs/platform/customer-management/)** - Create customers, invite users, manage secrets and features * **[Branding & White-Labeling](/docs/platform/branding/)** - Customize the customer portal with your branding ## User Management Control user roles and permissions: * **[Role-Based Access Control (RBAC)](/docs/platform/rbac/)** - Manage roles and permissions across organizations *** Evaluating Distr next to another distribution platform? See [Distr vs Replicated](/compare/replicated/) and [Distr vs Nuon](/compare/nuon/). Need help with the platform? [Get help](https://github.com/distr-sh/distr/discussions) in our community forum.
# Application Entitlements
> Learn how to create and manage Application Entitlements to control which application versions your customers can access and deploy.
This guide walks you through how to use Application Entitlements to control which application versions your end-customers can access and deploy through Distr controllers. With Application Entitlements, you can link an entitlement to a customer to grant access to specific application versions, whether that’s one version, a few, or all of them. You can name the entitlement, set an expiration date, and assign it to a particular customer. This gives you granular control over which applications and versions each end-customer can use. ## Entitlement flow diagram  ## Use case Many vendors offer tiered pricing plans with different features. For those serving [on-premises](/glossary/on-premises-definition/) environments, granular control over version access matters: you might deliver a specific feature set, send hotfixes to select customers, or offer early access to new application versions. Application Entitlements give you that control. ## Entitlement features 1. Each entitlement is linked to a single `customer/application` pairing. 2. Each entitlement grants a customer access to one or multiple application versions. 3. Once an application version has been granted via an entitlement, it can’t be revoked (version revoking is currently in progress). 4. A customer can be associated with multiple entitlements. 5. Entitlement edits are reflected in the customer portal in real time. ## How to use it If you don’t see the feature yet, make sure you’re on a Pro plan or Pro Trial. Once you’re in, here’s how it works: 1. **Create a customer:** If none exist, [create a customer](/docs/platform/customer-management/#creating-a-customer) first 2. **Navigate to Licenses** in the sidebar 3. **Click the customer** you want to create an entitlement for 4. **Select the Application Entitlements tab** and click **“Create Entitlement”** 5. **Give it a name** 6. **Set an expiration date** (optional) 7. **Assign to an application** 8. **Choose the versions**: grant all versions, or select specific ones and optionally an auto-add regex for future versions 9. **Save**: click “Save” and you’re done The customer can now access and deploy the assigned application version/s directly from their [customer portal](/docs/platform/customer-portal/).  ## Choosing the granted versions An entitlement grants either **All versions** of the application, which includes every version you create later, or **Specific versions**. With specific versions, you have to select at least one version, the customer only gets the versions you select and new versions are not added unless they match the [auto-add version regex](#auto-add-version-regex). ## Auto-add version regex An entitlement for specific versions can grow with your releases. Enter a regular expression in **Auto-add Version Regex**, and every new application version whose name matches it is added to the entitlement automatically. See [Auto-add Regex](/docs/platform/auto-add-regex/) for when it runs, how to write it and examples. ## OCI registry authentication If your images are stored in a private [OCI registry](/glossary/oci-container-artifact-registry/), you’ll need to provide access credentials. You can configure these credentials in the lower section of the entitlement configuration panel. Once set, the application versions will be available at the deployment target for as long as the entitlement is valid. 
# Artifact Entitlements
> Learn how to create and manage Artifact Entitlements to control which artifacts and tags your customers can access in your registry.
This guide walks you through how to use Artifact Entitlements to control which artifacts and tags your end-customers can access and pull from your Distr registry. With Artifact Entitlements, you can control access to specific artifacts and their tags in your registry. You can grant access to all tags, specific tags, or future tags for one or multiple artifacts. Once you create your first artifact entitlement, customers will only see artifacts they have a valid entitlement for. Caution Creating your first entitlement will restrict what all your customers see. After you create your first entitlement, your customers will only see artifacts which they have a valid entitlement for. Without any entitlement, your customers will see all artifacts and tags. ## Use case Artifact Entitlements enable you to: * **Control registry access**: Restrict which container images, Helm charts, and other artifacts customers can pull * **Tag-based access control**: Grant access to specific tags (e.g., only stable releases) or all tags including future ones * **Tiered artifact access**: Offer different artifact sets based on customer subscription tiers * **Multi-artifact bundling**: Bundle multiple artifacts in a single entitlement for simpler management ## Entitlement features 1. Each entitlement can include one or multiple artifacts. 2. Each entitlement can grant access to specific tags, all tags, or all tags including future tags. 3. A customer can be associated with multiple entitlements. 4. Entitlement edits are reflected in the customer portal in real time. 5. Before creating your first entitlement, all customers can see all artifacts. After the first entitlement is created, customers only see entitled artifacts. 6. A [public artifact](/docs/registry/#public-artifacts) is exempt: every customer sees it and can pull it, with or without an entitlement. ## How to use it If you don’t see the feature yet, make sure you’re on a Pro plan or Pro Trial. Once you’re in, here’s how it works: 1. **Create a customer:** If none exist, [create a customer](/docs/platform/customer-management/#creating-a-customer) first 2. **Navigate to Licenses** in the sidebar 3. **Click the customer** you want to create an entitlement for 4. **Select the Artifact Entitlements tab** and click **“Create Entitlement”** 5. **Give it a name** (required) 6. **Set an expiration date** (optional) 7. **Select an artifact** (required) 8. **Choose the tags**: grant **All tags**, or **Specific tags** with the tags you select and optionally an [auto-add tag regex](#auto-add-tag-regex) for future tags 9. **Save**: click “Save” and you’re done The customer can now access and pull the assigned artifacts and tags directly from your registry through their [customer portal](/docs/platform/customer-portal/).  ## Choosing the granted tags An entitlement grants either **All tags** of its artifact, which includes every tag you push later, or **Specific tags**. With specific tags, you have to select at least one tag. The entitlement grants the manifest each selected tag points to, so the customer also gets every other tag pointing to one of these manifests, including tags you push later. A new tag with a new manifest is only added when it matches the [auto-add tag regex](#auto-add-tag-regex). ## Legacy view for multiple artifacts An entitlement that bundles several artifacts opens in the legacy view. There you add artifacts with **”+ Add Artifact”** and choose for each one whether it grants all tags or only the tags you select. The legacy view does not support an auto-add tag regex. ## Auto-add tag regex An entitlement with specific tags can grow with your releases. Enter a regular expression in **Auto-add Tag Regex** next to the tag picker, and every new tag of the artifact whose name matches it is added to the entitlement automatically. The regex is only available for an entitlement with a single artifact. See [Auto-add Regex](/docs/platform/auto-add-regex/) for when it runs, how to write it and examples. ## Managing existing entitlements You can view and manage all artifact entitlements for a customer from their detail view in the Licenses section: * **View entitlements**: See all entitlements with name, associated artifacts, and expiration * **Edit entitlements**: Click an entitlement to modify its settings * **Filter**: Use the search bar to filter by name or artifact ## Best practices * **Start with broad access**: Consider starting with “All tags” for new customers, then refine as needed * **Set expiration dates**: Use expiration dates for time-limited access or trial periods * **Bundle related artifacts**: Group related artifacts in a single entitlement for easier management * **Review regularly**: Periodically review entitlements to ensure they match your current access policies
# Auto-add Regex
> Learn how an auto-add regex adds new application versions and artifact tags to an entitlement automatically.
An entitlement that grants specific versions or tags can grow with your releases. Give it an auto-add regex, and every new application version or artifact tag whose name matches is added to the entitlement automatically. For example, `^2\.\d+\.\d+$` keeps a customer on every `2.x.y` release without you editing the entitlement after each one. Enter the regex in **Auto-add Version Regex** of an [application entitlement](/docs/platform/application-entitlements/) or in **Auto-add Tag Regex** of an [artifact entitlement](/docs/platform/artifact-entitlements/). An entitlement with an auto-add regex needs at least one selected version or tag, since an entitlement without any already grants all of them, including future ones. On an artifact entitlement, the regex is only available for an entitlement with a single artifact. Setting or changing the regex does not touch existing versions or tags, so select those yourself. ## When it runs ### Application entitlements * **New versions:** The regex is checked whenever you create an application version. * **Renamed versions:** A renamed version is added if its new name matches and its previous name did not. A version you removed by hand is therefore not added back by a rename that keeps it matching. * **Archived versions:** These are never added. ### Artifact entitlements * **New tags:** The regex is checked whenever you push a tag that did not exist yet, or move a tag to a new manifest when [mutable tags](/docs/registry/#artifact-details) are enabled. Tags synced from an upstream registry are not matched. * **What is added:** The manifest the tag points to is added to the entitlement, just like selecting it in the tag picker. Every other tag pointing to the same manifest becomes available to the customer as well. ## Writing the regex * **Syntax:** The regex uses [RE2 syntax](https://github.com/google/re2/wiki/Syntax) and may be up to 200 characters long. Lookaheads and backreferences are not supported. It must not start or end with whitespace; write `\s` or `[ ]` to match a space there. * **Partial matches:** The regex matches anywhere in the name unless you anchor it with `^` and `$`. Matching is case-sensitive; prefix the regex with `(?i)` to ignore case. ## Auto-added entries An auto-added version or tag is an ordinary entry of the entitlement, and you can remove it like any entry you selected yourself. * **Application versions:** The customer can deploy the version right away, and it is considered for automatic updates and update notifications. Renaming it to a name that no longer matches keeps it in the entitlement. * **Artifact tags:** The customer can pull the tag right away, and it is considered for update notifications. ## Examples | Regex | Adds | Does not add | | ----------------- | ------------------------------ | ------------------------ | | `^2\.\d+\.\d+$` | `2.0.0`, `2.14.3` | `12.0.0`, `2.1.0-rc.1` | | `^2\.` | `2.1.0`, `2.1.0-rc.1` | `12.0.0`, `v2.1.0` | | `^\d+\.\d+\.\d+$` | `1.4.2`, `3.0.0` | `1.5.0-beta.1`, `v1.4.2` | | `-lts$` | `3.2.0-lts` | `3.2.0`, `3.2.0-lts.1` | | `^[23]\.\d+\.\d+` | `2.1.0`, `3.0.4`, `3.0.4-rc1` | `4.0.0`, `1.2.3` | | `(?i)^release-` | `release-2026-10`, `RELEASE-7` | `pre-release-1` |
# Branding
> Apply custom branding and content to the Customer Portal, allowing end users to view release notes, deployment instructions, and operational guidance in a vendor-branded interface.
The Branding page of the Vendor Portal allows you to apply your own branding to the UI that customers use to deploy and manage your software. A well-configured Customer Portal should provide all the information your end users need to install, operate, and troubleshoot your software independently. To get started, go to the Branding tab in the sidebar of the Vendor Portal. At the top of the page, live previews show what the navigation bar will look like for your own team in the Vendor Portal and for your customers in the Customer Portal.  ## Customer Portal These settings configure what your customers see when they log in to their portal: * **Customer Portal Override**: Optional. Replaces the “Customer Portal” text next to the logo in the customer navigation bar. If not set, your customers see “Customer Portal”. * **Instructions**: Markdown content displayed on the home page of the Customer Portal. It is shown by default until the customer has created a deployment or pulled an artifact, and customers can hide it or show it again on the home page at any time. Recommended content: * Installation and setup instructions * Connection and upgrade instructions * Troubleshooting tips * Support contact details After saving, the [Customer Portal](/docs/platform/customer-portal/) is rebranded for your end users:  ## White-label These settings replace Distr’s branding across the application for users and customers of your organization: * **Portal Title**: Shown as the browser tab title. If not set, the default Distr title is used. * **Portal Logo**: Shown in the navigation bar for users and customers of your organization, and on the login page of your custom domain. SVG, PNG, JPG or GIF with a recommended height of 64px. If not set, the Distr logo is shown. * **Favicon**: Shown in the browser tab. SVG, PNG, GIF or ICO with a recommended size of 64px x 64px (square). If not set, the Distr favicon is shown. None of these settings require a custom domain: they apply to all logged-in users and customers of your organization on app.distr.sh as well. With a [custom domain](#custom-domains), they additionally apply to unauthenticated pages such as the login page.  ## Custom Domains For a fully white-labeled experience, Distr supports custom domains for the Customer Portal and the artifact registry. When your portal is accessed via your custom domain, all Distr-specific branding is removed and your white-label settings also apply to unauthenticated pages such as the login page. Organization admins can set up custom domains self-service under **Settings → Organization → Custom Domains & Identity Provider**, in the Vendor Portal, Customer Portal and Registry sections: 1. **Vendor Portal domain** (e.g. `app.your-company.com`): Serves the web UI and API for your own team (and your partners, if partner management is enabled). It also serves the artifact registry under the `/v2/` path, so a single domain is usually all you need. 2. **Customer Portal domain** (optional, e.g. `portal.your-company.com`): Serves the Customer Portal for all of your customers. When it is set, invitation links, password resets and notification mails sent to customer users point at it instead of your Vendor Portal domain; without it, they use your Vendor Portal domain like everyone else. 3. **Registry domain** (optional, e.g. `registry.your-company.com`): Only needed if you want a separate hostname for the artifact registry. Each of the two optional domains starts collapsed behind its own checkbox, so the page only asks for the one domain most organizations need. Tick a checkbox to enter that domain. Enter the domain as a bare hostname (no `https://`) and add it. Then create a CNAME record at your DNS provider, pointing your domain at the target shown below it; the copy button next to the target puts it on your clipboard. The TLS certificate is issued automatically on the first request once the DNS record has propagated — no certificate upload or renewal handling required. Each domain shows a status panel — green once its CNAME record resolves to the expected target, red with the reason otherwise (e.g. no record found, or it points somewhere else) — along with when it was last checked. Use the reload icon next to the panel to check again after updating your DNS record, without waiting for propagation to be picked up on its own. A domain is only used for links, mails, controller manifests and registry URLs once that check has succeeded; until then everything keeps using the default host, so a domain that is not set up yet never sends anyone to a hostname that does not answer. The check is repeated in the background, and a domain whose record is removed or repointed later falls back the same way. Point your domain at the target with a CNAME and not with an A record: the address behind the target can change, and only the CNAME follows it. A customer that needs its own hostname and its own identity provider, rather than sharing your customer portal domain, can get one: grant it the **Identity Provider** feature in the customer list, described in [Custom Identity Provider](/docs/platform/custom-identity-provider/#letting-a-customer-bring-its-own-provider). Login methods on your custom domain The Google, GitHub and Microsoft sign-in buttons are configured for the Distr instance as a whole, not for a single organization, so they are not offered on your domain. Visitors there sign in with email and password, or with a [custom identity provider](/docs/platform/custom-identity-provider/) you configure yourself. Self-registration is also disabled on your domain: new users are invited or provisioned by your identity provider. On self-hosted instances, the Custom Domains section only appears when the instance is configured for custom domain self-service. See the [configuration reference](/docs/self-hosting/configuration/#custom-domains) for the required setup. ## Controller Image Repository On Distr Cloud, the [Docker](/docs/controllers/docker-controller/) and [Kubernetes](/docs/controllers/kubernetes-controller/) controllers pull their images from `registry.distr.sh/distr`. If your organization has a [custom registry domain](#custom-domains), they are pulled through that domain instead, e.g. `registry.your-company.com/distr`. Self-hosted instances pull them from `ghcr.io/distr-sh/distr` unless the instance is [configured](/docs/self-hosting/configuration/) otherwise. To have your customers pull them from another registry, enable **Use an external controller repository** under **Settings → Organization → General** and enter its host and an optional path (e.g. `registry.distr.sh/your-org`). The setting applies to all of your customers. A single customer can pull from a repository of its own, so that its deployment targets show neither Distr nor your registry domain. Grant the customer the **Settings** feature in the customer list (requires the Business plan), then set the repository under **Settings** in its row of the customer list, or let its administrators set it on their own **Settings** page. It takes precedence over the repository of your organization. Only the prefix can be changed. Distr appends the image names `docker-controller`, `docker-autoheal` and `kubernetes-controller` with the controller version as the tag, so your registry has to host the images under these names. They have to be publicly available there, or every deployment target needs access to the registry before you save it. A new repository applies when a deployment target connects and at its next controller update. Caution The Kubernetes controller is replaced rather than rolled over. If the cluster nodes cannot pull the image from the new repository, the deployment target is left without a running controller until you fix the repository and apply the manifest again. ## Custom Email By default, all transactional e-mails — invitations, e-mail verifications, password resets, license key updates and deployment notifications — are sent by Distr. To send them from your own domain instead, configure your SMTP server under **Settings → Organization → Email Sending Provider**: 1. **Sender address** (e.g. `notifications@your-company.com`): The address your users and customers see as the sender. 2. **SMTP host and port**: Your mail provider’s SMTP endpoint, e.g. `smtp.your-company.com` on port `587`. 3. **Username and password**: Leave both empty to connect without authentication. 4. **Use implicit TLS**: Enable it if your provider expects a TLS connection right away instead of an upgrade via STARTTLS, which is usually the case on port `465`. Use **Send test email** to send a test message to your own address before saving. A failed test reports the error from your SMTP server verbatim, so you can see exactly what to fix. Your SMTP server must be authorized to send for the domain of your sender address. Set up SPF, DKIM and DMARC records for that domain at your DNS provider as documented by your mail provider — otherwise recipients may reject your e-mails or classify them as spam.
# Custom Identity Provider
> Let your team, your customer portal, or an individual customer sign in to Distr with your own OpenID Connect identity provider (single sign-on), with optional automatic account provisioning.
Your organization can connect its own OpenID Connect identity provider, so your team, your customer portal, or an individual customer signs in to Distr with accounts they already have. Provisioning, password policies and multi-factor authentication then stay in that identity provider. ## Where a provider applies Every domain carries its own set of providers. Nothing is inherited between them, so a user’s sign-in options are decided entirely by the host they open: | Domain | Providers configured by | Applies to | | ------------------------------------------------------ | ----------------------- | --------------------------------------------------- | | Your Vendor Portal domain, e.g. `app.your-company.com` | you | your own team | | Your customer portal domain | you | all of your customers, including ones created later | | A customer’s own portal domain | you or that customer | that one customer | All three are configured under **Settings → Organization → Custom Domains & Identity Provider**, which is also where the domains themselves are registered. A customer’s own domain additionally needs the **Identity Provider** feature, which you grant per customer in the customer list. Domains added anywhere show a status panel next to them — green once the CNAME resolves to the expected target, red with the reason otherwise — so you can tell without leaving the page whether a provider is actually reachable yet. A domain is only used for links, mails, controller manifests and registry URLs once that check has succeeded; sign-in on the domain itself works as soon as it resolves here. ## Requirements 1. A Vendor Portal domain (e.g. `app.your-company.com`) set up under **Settings → Organization → Custom Domains & Identity Provider**, and an organization slug, because both are part of every provider’s URLs. 2. An identity provider that serves an OpenID configuration under `/.well-known/openid-configuration`. Microsoft Entra ID, Google Workspace, Okta, Auth0, Keycloak, JumpCloud, Authentik and any other OpenID Connect provider work with the same fields. 3. An application (client) registered with that provider, using the authorization code flow. ## Connecting your identity provider Go to **Settings → Organization → Custom Domains & Identity Provider** and add a provider: 1. **Display name**: Shown on the sign-in button, e.g. `Acme SSO`. 2. **Issuer URL**: The provider’s issuer. Distr fetches its OpenID configuration when you save, verifies that the document belongs to that host, and stores the issuer exactly as the provider states it. So a URL that is a little off is corrected rather than rejected. 3. **Client ID** and **Client secret**: From the application you registered. The secret is never shown again; leave the field empty when editing to keep it. 4. Copy the **Callback URL** and register it as a redirect URI with your provider. The URLs of a provider are built from your organization slug and the provider slug:
```plaintext
https://app.your-company.com/api/v1/auth/oidc/custom//
https://app.your-company.com/api/v1/auth/oidc/custom///callback
```
The provider slug is derived from the display name (`Acme SSO` becomes `acme-sso`) and shown as part of the callback URL. Use the pencil next to it if you want a different one; changing it later changes both URLs, so your provider needs the new redirect URI. A name and a slug only have to be unique per domain, so the same provider can be offered under the same name on your Vendor Portal domain and on your customer portal domain. The requested scopes (`openid profile email`) and PKCE need no configuration: PKCE is used automatically when the provider announces support for it. Both can be changed through the [Distr API](/docs/integrations/api/) if your provider needs something else. Issuer URLs for the most common providers: | Provider | Issuer | | ------------------ | -------------------------------------------------------- | | Microsoft Entra ID | `https://login.microsoftonline.com//v2.0` | | Google | `https://accounts.google.com` | | Okta | `https://.okta.com` (or `/oauth2/`) | | Auth0 | `https://.eu.auth0.com/` | | Keycloak | `https:///realms/` | Microsoft Entra ID needs your tenant ID The `common`, `organizations` and `consumers` endpoints cannot be used: their OpenID configuration does not name a tenant, so the tokens they issue cannot be verified against a single issuer. Use the single-tenant issuer with your directory (tenant) ID. ## Customer portal domain A customer portal domain (e.g. `portal.your-company.com`) is the host all of your customers sign in on. Tick **Use a customer portal domain** in the **Customer Portal** section of the Custom Domains & Identity Provider tab, register it and create the shown CNAME record. Once it exists, it replaces your Vendor Portal domain in everything sent to a customer user: invitation links, password resets, email verification and notification mails. Your own team keeps the Vendor Portal domain, and controller manifests, connect commands and the artifact registry keep using it as well. Providers you attach to this domain apply to every customer at once. You cannot single out one customer here; a customer that needs its own provider gets its own domain instead. ## Letting a customer bring its own provider Grant a customer the **Identity Provider** feature in the customer list, which also grants the **Settings** feature it requires. Its administrators then get a **Settings** page of their own, where they register their own portal domain and connect their own provider. You can reach the same page from the **Settings** button in the customer list and configure it on their behalf. A provider on a customer’s own domain only ever authenticates users of that customer, and accounts created on first sign-in join that customer organization and count against its user limit rather than your billed seats. The feature can only be granted while your own plan includes custom identity providers. ## Who can sign in Distr matches an account either by an identity it has connected before or by the email address the provider asserts. Sign-in requires a membership in the organization the provider belongs to, so a provider can only ever authenticate its own members, and never a Distr staff account. A member of several organizations can use your provider, but the session it produces stays inside your organization. Such a session: * works only in the organization the provider belongs to, and cannot switch to another one or see which others the account is a member of, * cannot change the account’s email address, enroll in multi-factor authentication, or disconnect an identity provider. Password-confirmed actions such as disabling MFA or regenerating recovery codes remain available. Why a single sign-on session is confined A provider is controlled by the organization that registers it, not by the people it authenticates: it can assert any email address, including one that belongs to a member of a different organization. Confining the session is what keeps such an assertion from reaching data outside your organization, so it applies to every custom provider, including a customer’s own. The last rule follows from the others: a password or an email address the session could set would let its owner sign in again without the provider, and the new session would not be confined. Members who work in another organization as well, or who want to change their sign-in methods, sign in with a password instead. The **Request password reset** button on the user settings page sends a link that also sets a first password for an account that has only ever used single sign-on. ## Provisioning accounts automatically With **Create accounts on first sign-in**, everyone the provider authenticates gets an account with the role you select, so you do not have to invite people one by one. Where such an account lands depends on the domain the provider is attached to: your Vendor Portal domain creates a member of your own team, a customer’s own portal domain a user of that customer. * **Allowed email domains** appear once you enable it and are required: an account created this way is not something to hand out to every address an identity provider can assert. Accounts are only created for addresses in the domains you name here; existing members sign in regardless of their address. * Accounts for your own team are created up to your billed user seats, accounts for a customer up to that customer’s user limit. Limits are never raised automatically: beyond them, sign-in fails until an administrator raises them. * The shared customer portal domain cannot provision accounts at all, as described above. ## Making a provider the default With **Sign in with this provider automatically**, the login page on that domain redirects to the provider without asking. Only one provider per domain can do this. This is usually not recommended: everyone reaching the domain is sent to the provider and never sees the login form, even though some of them have a password rather than an account in that directory. `https://app.your-company.com/login?manual=1` still shows the login form. That is how anyone with a password gets in while the provider is unavailable, so keep at least one administrator with a password and a working recovery method. ## Signing in on app.distr.sh Your users can sign in on `app.distr.sh` with their password as before; they are then forwarded to your custom domain. Your own identity provider is only offered on your domain, because the login page of the shared host cannot know which organization a visitor belongs to before they identify themselves. ## Removing a provider Deleting a provider removes the connected identities with it. Everyone who signed in through it loses that login, and users who never set a password have to reset it before they can sign in again.
# Customer Management
> A detailed guide to the Customers section of the Vendor Portal: create customers, invite users, manage secrets, and control features per customer.
The **Customers** section in the [Vendor Portal](/docs/vendor-portal/) is where you create and manage customer accounts, invite customer users, manage customer-specific secrets, configure links, and control which features each customer can use. This guide walks you through the customer management interface and common tasks.  ## Overview From the Customers page you can: * **Create customers** and give them a name * **Invite customer users** (name, email, and [role](/docs/platform/rbac/)) and manage access per customer * **Manage secrets** for a specific customer. See [Manage Secrets](/docs/controllers/secrets/) for how secrets work * **Manage links** that appear in that customer’s [Customer Portal](/docs/platform/customer-portal/) sidebar * **Enable or disable features** per customer: Deployments, [Alerts](/docs/controllers/alerts/), Artifacts, [Update Notifications](/docs/controllers/update-notifications/), [Support Bundles](/docs/platform/support-bundles/) and [Security](/docs/platform/vulnerability-management/) Use the **Filter customers** search bar to find customers, and **+ Create Customer** to add a new one. ## Creating a customer 1. In the Vendor Portal sidebar, go to **Customers**. 2. Click **+ Create Customer**. 3. Enter a name for the customer. 4. Confirm to create the customer. The new customer appears in the list. You can then invite users, manage secrets, and configure features for them. ## Inviting customer users 1. In the **Customers** list, open the customer you want to add users to. 2. Click **Manage users** for that customer. 3. Click **Add user** (or **Invite User**). 4. Enter **name**, **email**, and **role** (see [RBAC](/docs/platform/rbac/) for Administrator, User, and Viewer). 5. Submit the invitation. The invited user receives an email to set up their account. The **first user** for a customer is always an **Administrator**. After that, customer admins can add or remove users themselves from the [Customer Portal](/docs/platform/customer-portal/). ## Managing secrets per customer For each customer you can manage secrets that are only available to that customer’s deployments: 1. In the **Customers** list, find the customer. 2. Click **Manage secrets** for that customer. For how to create, edit, and use secrets (including customer-specific secrets), see [Manage Secrets](/docs/controllers/secrets/). ## Managing links per customer You can add links for each customer, for example to your documentation, a support page, or a status page. They are shown at the bottom of the sidebar in that customer’s [Customer Portal](/docs/platform/customer-portal/) and open in a new tab. To add a link: 1. In the **Customers** list, find the customer. 2. Click **Manage links** for that customer. 3. Click **+ Create Link** and enter a **name** and the **URL**.  Existing links can be edited or deleted at any time, and changes are visible to the customer immediately. This is how a configured link shows up in the Customer Portal sidebar:  ## Enabling and disabling features per customer You can control which features are available to each customer organization. The available features are: * **Deployments**: access to controller-based deployments * **Alerts**: deployment health notifications (requires Deployments) * **Artifacts**: access to the artifact registry * **Update Notifications**: deciding which of their own users hears about a new application or artifact version * **Support Bundles**: ability to create and submit diagnostic bundles * **Security**: access to the security advisories you publish (requires the Business plan) * **Settings**: a settings page for the customer’s administrators, where they choose the [controller image repository](/docs/platform/branding/#controller-image-repository) of their deployment targets (requires the Business plan) * **Identity Provider**: a [portal domain and identity provider](/docs/platform/custom-identity-provider/#letting-a-customer-bring-its-own-provider) of the customer’s own, configured on its settings page (requires Settings and the Business plan) Each customer has a **Features** button in the customer list showing how many features are currently enabled. Click it to open a dropdown where you can check or uncheck individual features.  A few things to note: * **Alerts** depends on **Deployments**. Enabling Alerts automatically enables Deployments; disabling Deployments automatically disables Alerts. * **Identity Provider** depends on **Settings** in the same way. * **Support Bundles** and **Artifacts** are independent and can be toggled without affecting other features. * **Update Notifications** covers whichever of **Deployments** and **Artifacts** the customer also has, since a customer can only watch what it can reach. * **Deployments** and **Artifacts** are enabled by default for new customers. **Alerts**, **Update Notifications** and **Support Bundles** must be explicitly enabled. * **Security** is enabled by default for new customers once your organization has [Vulnerability Management](/docs/platform/vulnerability-management/). When your organization gains it, every existing customer gets it as well. You can switch it off for individual customers afterwards. * Changes take effect immediately. Disabled features are hidden entirely from the customer in the Customer Portal. Customers only see the sections that are enabled for them. *** Next steps: assign access with [Application Entitlements](/docs/platform/application-entitlements/) or [Artifact Entitlements](/docs/platform/artifact-entitlements/), or learn the [End-customer view of Distr](/docs/platform/customer-portal/registry/).
# Customer Portal
> A white-labeled customer-facing UI for managing deployments, pulling artifacts, viewing licenses, creating support bundles, and managing secrets.
The Customer Portal is a simplified, white-labeled UI built for end customers. Vendors control which sections each customer can access through [Customer Management](/docs/platform/customer-management/#enabling-and-disabling-features-per-customer).  ## Portal sections The sidebar shows the sections that are enabled for your organization. A fully configured portal includes: | Section | Description | Visibility | | ---------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------ | | **Home** | Getting started instructions, deployments, licenses, activity | Always visible | | **[Deployments](/docs/platform/customer-portal/deployments/)** | Deploy and manage controllers and applications | On by default | | **[Artifacts](/docs/platform/customer-portal/registry/)** | Browse and pull software artifacts from the registry | On by default | | **[Licenses](/docs/platform/customer-portal/licenses/)** | View license keys and tokens issued by your vendor | Requires Pro (or higher) | | **[Support](/docs/platform/customer-portal/support/)** | Create and manage support bundles for troubleshooting | Off by default | | **[Alerts](/docs/platform/customer-portal/deployments/#alerts)** | Configure deployment health and resource usage notifications | Off by default | | **Users** | Manage users in your organization (admin only) | Always visible | | **[Secrets](/docs/platform/customer-portal/secrets/)** | Store and manage deployment secrets | On by default | | **Access Tokens** | Generate Personal Access Tokens for registry authentication | Always visible | **Deployments** and **Artifacts** are enabled by default for new customers. **Alerts** and **Support Bundles** must be explicitly enabled by the vendor. Disabled sections are hidden entirely from the Customer Portal, so customers only see what has been enabled for them. In addition to these sections, vendors can configure [links](/docs/platform/customer-management/#managing-links-per-customer) per customer, for example to documentation or a support page. They are shown at the bottom of the sidebar and open in a new tab. Vendors manage these settings under **Customers** in the Vendor Portal. See [Enabling and disabling features per customer](/docs/platform/customer-management/#enabling-and-disabling-features-per-customer) for details. ## Access Tokens In the top-right user menu, navigate to **Settings > Access Tokens** to generate [Personal Access Tokens (PATs)](/docs/integrations/personal-access-token/). PATs are required for authenticating with the artifact registry.
# Customer Portal Deployments
> Guide for end customers on deploying and managing applications with Distr controllers from the Customer Portal.
As an end customer, you can deploy and manage applications with Distr controllers directly from the [Customer Portal](/docs/platform/customer-portal/). This guide walks you through the deployment controller quickstart from the Customer Portal.  ## Deployment controller quickstart from the Customer Portal ### Step 1: Select application Navigate to **Deployments** in the sidebar and click on the **+ New Deployment** button. Choose the application you want to deploy. ### Step 2: Deployment configuration Give your deployment a descriptive name. This name will help you identify and manage the deployment later. For Helm applications, you’ll also need to specify the Kubernetes namespace where it should be deployed. Make sure the namespace exists in your cluster before proceeding. ### Step 3: Application configuration Configure the environment variables for your Docker Compose application. These variables will be passed to the `docker compose` process via the `--env-file` argument. For more information on how to use them, refer to [our guide on working with environment variables](/docs/controllers/docker-env/). You can also enable Docker Swarm mode for deployments that should run in swarm mode. See [Docker Swarm](/docs/controllers/docker-controller/#docker-swarm) for more details. Additionally, you can enable container log collection to view application logs directly in the portal. Learn more about [Container Logs](/docs/controllers/logs-and-metrics/#container-logs). ### Step 4: Deploy Review your configuration and click **Create Deployment** to proceed to the deployment page. Caution **Important**: This command will automatically install the Distr controller, which will then automatically install the application. The controller runs in the customer environment and manages the full lifecycle of your application deployment. ### Step 5: Monitor deployment status View real-time updates as your deployment initializes. The status indicator shows the current health: * **Running**: The deployment is running (no healthchecks configured) * **Healthy**: The deployment is running and all healthchecks are passing * **Error**: Something is wrong, check the logs for details * **Stale**: The controller has not reported this deployment’s health in the last 60 seconds For the full list of statuses, see [Deployment Status](/docs/controllers/logs-and-metrics/#deployment-status). ### Step 6: Access environment logs Click the **Inspect** button on a deployment to view application logs directly from the portal. Container logs must be enabled per deployment. Use the **⋮** menu to toggle log collection on or off. ### Step 7: Update deployments Click the **Update** button to modify configuration values and update running deployments as needed. You can change environment variables, switch application versions, or adjust other settings. ## Alerts If your vendor has enabled alerts for your organization, you can configure deployment health notifications from the **Alerts** button in the Deployments view. Set up alert rules for deployment status changes and resource usage thresholds, and choose which users in your organization should receive email notifications. For details on alert types and configuration, see [Alerts](/docs/controllers/alerts/). ## Important notes * A single controller can manage multiple deployments in the same target environment * To remove a deployment, first **undeploy** it before **deletion** * If a deployment target shows **Stale** status, you can reconnect by generating new credentials from the **⋮** menu
# Customer Portal Licenses
> View and use license keys issued by your vendor directly from the Customer Portal.
As an end customer, you can view the license keys your vendor has issued to your organization directly from the [Customer Portal](/docs/platform/customer-portal/).  ## Viewing license keys Navigate to **Licenses** in the sidebar to see all license keys assigned to your organization. The list shows each key’s name, description, and expiration date. Expired keys are marked with an **(expired)** label. ## Referencing a license key in deployments If you deploy via Distr controllers, the **Reference** column shows the template variable to use in your deployment’s environment file or Helm values: `{{ .LicenseKeys.MY_LICENSE_KEY }}` Distr resolves this to the signed JWT token automatically at deploy time, so you do not need to copy and paste anything by hand. See [Referencing license keys in deployments](/docs/platform/license-keys/#referencing-license-keys-in-deployments) for full details. ## Getting the token Click a license key to view its signed JWT token. Copy the token and use it in your application environment. The token works offline and requires no callback to Distr at verification time. For details on how to inject the token into your application (via environment variables, Helm values, or secrets), see [Referencing license keys in deployments](/docs/platform/license-keys/#referencing-license-keys-in-deployments). ## What is in the token Each license token is a signed JWT containing: * Validity period (not before / expiration dates) * Custom claims defined by your vendor (plan tier, seat count, feature flags, etc.) Your application verifies the token using the vendor’s public key. See [Verifying tokens](/docs/platform/license-keys/#verifying-tokens-in-your-application) for implementation details.
# Customer Portal Artifact Registry
> Guide for end customers on using the Customer Portal to access and pull artifacts from the Distr registry.
As an end customer, you will be given access to a [Customer Portal](/docs/platform/customer-portal/) by the software vendor. The portal provides access to the artifact registry for downloading software distributed by your vendor. This guide walks you through using the registry from the Customer Portal. ## Registry quickstart from the Customer Portal A typical onboarding journey looks like this: ### 1. View available artifacts Navigate to **Artifacts** in the sidebar to browse the artifacts your vendor has made available to you:  ### 2. Explore artifact details Click on the artifact name to see details like available versions, creation date, and a download counter:  ### 3. Authenticate with a Personal Access Token Generate a [Personal Access Token (PAT)](/docs/integrations/personal-access-token/) in your Distr account and use it to log in:
```shell
echo "YOUR-ACCESS-TOKEN" | docker login registry.distr.sh:8585 --password-stdin -u -
```
### 4. Pull vendor artifacts Once authenticated, you can pull the artifacts using Docker, [ORAS](https://oras.land/docs/installation) or Helm for example:
```shell
docker pull registry.distr.sh/slug/hello-world:1.0.0
oras pull registry.distr.sh/slug/vendor-artifact:1.0.0
helm pull registry.distr.sh/slug/vendor-helm-chart:1.0.0
```
### 5. Deploy the artifacts Refer to the deployment instructions in your [Customer Portal](/docs/platform/customer-portal/) dashboard or coordinate directly with your vendor for specific deployment guidance.
# Customer Portal Secrets
> Manage deployment secrets from the Customer Portal to securely store sensitive configuration values.
As an end customer, you can create and manage secrets for your organization directly from the [Customer Portal](/docs/platform/customer-portal/). Secrets store sensitive configuration values such as API keys, passwords, and database credentials that your deployments can reference using template syntax.  ## Managing secrets Navigate to **Secrets** in the sidebar to view and manage your organization’s secrets. The page shows each secret’s key, template reference, creation date, and who last updated it. ### Creating a secret 1. Click **Create Secret**. 2. Enter a **Key** (must start with a letter, can contain letters, numbers, and underscores). 3. Enter the **Value**. 4. Click **Save**. ### Updating a secret 1. Click **Edit** next to the secret you want to update. 2. Enter the new value (the key cannot be changed). 3. Click **Save**. If any active deployments reference this secret, you will be shown which deployment targets are affected before saving. Confirming will save the new value and automatically trigger a redeployment on those targets. ### Deleting a secret Click the **Delete** button next to a secret and confirm. Make sure no active deployments reference the secret before deleting it. ## Using secrets in deployments Reference secrets in your deployment configuration using template syntax:
```plaintext
DATABASE_URL=postgresql://user:{{ .Secrets.DATABASE_PASSWORD }}@host:5432/db
API_KEY={{ .Secrets.API_KEY }}
```
The template reference for each secret is shown in the **Reference** column on the secrets page. Copy it directly into your deployment environment variables. For the full template syntax reference and advanced usage, see [Secrets Management](/docs/controllers/secrets/).
# Customer Portal Support Bundles
> Create and manage support bundles to share diagnostic data with your vendor from the Customer Portal.
As an end customer, you can create support bundles to share diagnostic data with your vendor when reporting an issue. Support bundles give your vendor the information they need to troubleshoot problems without requiring direct access to your infrastructure.  ## Creating a support bundle 1. Navigate to **Support** in the sidebar and click **New Support Bundle**. 2. Choose **Docker** or **Kubernetes** as the **Deployment Type**, enter a **Title** (required) and an optional **Description** of the issue. 3. Click **Create**. Distr opens the new bundle and shows a one-time `curl` command valid for 24 hours. 4. Run the command. It asks you before it collects or uploads anything and before it runs a script of your vendor. For a **Docker** bundle, run the command on the affected deployment host. The interactive script will: * List available Docker containers and prompt for which ones to exclude * Show environment variable groups that will be collected, with redacted values already masked, and prompt for which groups to exclude * Show the full source of any diagnostic script your vendor configured and prompt for which ones to exclude, then run the rest and show you their output before uploading it * Upload the remaining data to Distr For a **Kubernetes** bundle, run the command on a machine with access to the cluster, such as the one you run `kubectl` from. The machine needs access to `github.com`, where the script downloads the support collector from. Nothing is installed in the cluster. The interactive script will: * Ask for the kubectl context to collect from, unless your kubeconfig has only one * List the namespaces of the cluster with their Helm releases and ask which ones to collect * Ask for every part of the bundle whether to collect it: the cluster information, the resources of the namespaces, the Helm releases and their values, the events and the container logs * Write the files to a temporary directory, where you can look through them and edit or delete any of them before you confirm the upload * Show the full source of any diagnostic script your vendor configured and prompt for which ones to exclude, then run the rest against the same context To collect from a context without being asked, append `-s --` and the option to the command: `curl -fsSL '...' | sh -s -- --context prod`. See [Kubernetes bundles](/docs/platform/support-bundles/#kubernetes-bundles) for every option, the permissions the collector needs and what the collected resources contain. ## Viewing and commenting on bundles After the collection script runs, the bundle status changes from **Initialized** to **Created**. Click on any bundle to open the detail view where you can: * View all collected resources (container logs, environment variables, Kubernetes resources, script output) * Exchange comments with your vendor’s support team * Track the bundle status (Initialized, Created, Resolved, Canceled)  ## Bundle status lifecycle | Status | Meaning | | --------------- | ------------------------------------------------------------------------------- | | **Initialized** | Bundle created, collection script not yet run. Secret valid for 24 hours. | | **Created** | Collection script ran successfully. Resources are attached and ready to review. | | **Resolved** | Vendor has marked the bundle as resolved. | | **Canceled** | Bundle was canceled before data was collected. | You can cancel an **Initialized** bundle if you no longer need it. Once resolved or canceled, a bundle cannot be reopened. If you have the role **Administrator** or **User**, you can delete a bundle in any status, from the list or from its detail view. Deleting is permanent: the bundle, the collected resources and the comments are removed from Distr for you and for your vendor, and cannot be restored. ## Remote access for a support case If a support bundle does not answer the question, your vendor may ask to deploy a [remote access](/docs/integrations/remote-access/) application to your deployment target for the duration of the support case. It shows up on your **Deployments** page like any other deployment. Undeploy it there to end the vendor’s access at any time. For the vendor-side setup and configuration, see [Support Bundles](/docs/platform/support-bundles/).
# Kubernetes Compatibility Matrix
> Validate your Helm charts against multiple Kubernetes versions in CI/CD, generate compatibility reports, and share them with customers as version resources using the Distr GitHub Action.
 When you distribute a Kubernetes application to enterprise customers, you rarely control which Kubernetes version they run. A single cluster fleet can span three or four minor versions at once, and every Kubernetes release deprecates or removes APIs. A Helm chart that installs cleanly on 1.33 might fail on 1.35 because a beta API it relies on has graduated or been removed. The first person to discover that is usually a customer filing a support ticket. A **compatibility matrix** solves this by systematically validating your Helm chart against every Kubernetes version you claim to support, on every release, as part of your CI/CD pipeline. Instead of manually maintaining test clusters or relying on customer reports, you get an automated, versioned record of exactly which Kubernetes versions your application is compatible with. The benefits compound as your customer base grows: * **Catch breaking changes before customers do.** Kubernetes deprecates and removes APIs on a predictable schedule. Automated validation flags issues the moment they appear in your chart, not after a customer upgrade fails. * **Reduce support burden.** When every release ships with a tested compatibility matrix, your support team can immediately confirm whether a reported issue is a known incompatibility or something else entirely. * **Build customer confidence.** Sharing a compatibility report alongside each version lets customers verify support for their environment before upgrading, without guesswork or back-and-forth. * **Eliminate dedicated test infrastructure.** Schema-based validation against Kubernetes OpenAPI specs runs in seconds on a CI runner. There are no clusters to provision, no cloud bills to manage, and no teardown to worry about. * **Scale across versions effortlessly.** Adding a new Kubernetes version to your matrix is a one-line change. GitHub Actions runs them all in parallel, so validation time stays constant regardless of how many versions you test. In this guide, you’ll set up a complete compatibility testing pipeline that validates your Helm chart across multiple Kubernetes versions and publishes the results as a version resource in Distr, visible to your customers in their portal. By the end of this guide, you’ll have: * A GitHub Actions workflow that validates your Helm chart across multiple Kubernetes versions in parallel * A unified compatibility matrix report generated from the per-version validation results * Automated attachment of the compatibility report as a version resource visible to customers in Distr ## Prerequisites for Kubernetes Compatibility Testing Before starting, ensure you have: 1. A Distr account with an organization set up 2. A Helm application configured in Distr (see [Create Application](/docs/controllers/application/)) 3. A GitHub repository containing your Helm chart 4. The [Automatic Deployments from GitHub](/docs/integrations/github-actions/) workflow already configured. This guide extends that pipeline with a compatibility validation stage 5. Familiarity with [GitHub Actions matrix strategies](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) ## How It Works The compatibility matrix is generated as part of your CI/CD pipeline and attached as a version resource to your Distr application version. The [hello-distr workflow](https://github.com/distr-sh/hello-distr/blob/main/.github/workflows/hello-distr.yaml) provides a complete working example you can use as a starting point for your own setup.  The workflow consists of three jobs that run in sequence: 1. **validate-chart**: Uses a [GitHub Actions matrix strategy](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) to validate the Helm chart against each Kubernetes version in parallel using [kubeconform](https://github.com/yannh/kubeconform). Each matrix job uploads per-version markdown and JSON artifacts. 2. **compatibility-matrix-report**: Downloads all per-version artifacts and merges them into a single unified compatibility matrix report. 3. **distr-kubernetes**: Creates the Distr application version using the [distr-create-version-action](https://github.com/distr-sh/distr-create-version-action) and attaches the compatibility report as a customer-visible version resource. ## Understanding Version Resources in Distr Version resources are supplementary markdown content items attached to application versions. They appear alongside the version details in both the vendor and customer portals. The `visibleToCustomers` flag controls visibility: * When `true`, the resource appears in the customer portal, which is useful for compatibility matrices, release notes, and getting-started guides * When `false`, the resource is only visible to vendor team members, which is useful for internal notes, known issues, or deployment checklists For teams that need to create versions programmatically outside of GitHub Actions, the Distr SDK supports version resources directly:
```typescript
import {DistrService} from '@distr-sh/distr-sdk';
const distr = new DistrService({
apiKey: process.env.DISTR_API_TOKEN,
});
await distr.createKubernetesApplicationVersion(appId, '1.5.0', {
chartType: 'oci',
chartUrl: 'oci://ghcr.io/yourorg/your-chart',
chartVersion: '1.5.0',
resources: [
{
name: 'Kubernetes Compatibility Matrix',
content: compatibilityMatrixMarkdown,
visibleToCustomers: true,
},
{
name: 'Internal Release Notes',
content: '# Internal Notes\n\nThis version includes...',
visibleToCustomers: false,
},
],
});
```
See the [Distr SDK](/docs/integrations/sdk/) documentation for more details. ## Example Kubernetes Compatibility Pipeline from hello-distr The [hello-distr](https://github.com/distr-sh/hello-distr) repository provides a complete working example of this setup. File layout:
```plaintext
hello-distr/
.github/workflows/
hello-distr.yaml # Workflow with validate-chart + report jobs
deploy/
charts/hello-distr/ # The Helm chart
scripts/
distr-compatibility-matrix.sh # Per-version validation
distr-compatibility-matrix-merge-reports.sh # Report merging
distr-compatibility-matrix-selftest.sh # kubeconform self-tests
```
The hello-distr implementation: * Tests against Kubernetes 1.32.0, 1.33.0, 1.34.0, and 1.35.0 * Uses `fail-fast: false` so all versions are always tested * Writes per-version reports to the GitHub Actions job summary for easy review * Merges results into a unified `compatibility-matrix.md` * Includes a self-test script that verifies kubeconform correctly detects version-specific resources (e.g., the `Workload` kind introduced in Kubernetes 1.35) You can fork or copy from the hello-distr repository to get started quickly, then customize the scripts and workflow for your own chart. ## Troubleshooting Kubernetes Compatibility Validation ### Helm Template Rendering Fails for Specific Kubernetes Versions **Problem:** `helm template` fails with errors about unknown API versions when targeting newer or older Kubernetes versions. **Solution:** Check that your chart’s `apiVersion` fields are compatible with the target versions. Use `Capabilities.KubeVersion` in your Helm templates to conditionally select API versions. Ensure the `kubeVersion` constraint in `Chart.yaml` covers your target range. ### kubeconform Reports Missing Schemas for Custom Resources **Problem:** Validation fails with “no schema found” for CRDs. **Solution:** Use the `-skip` flag to exclude CRD kinds, or provide custom schemas via the `-schema-location` flag. The CRDs-catalog schema location included in the scripts covers many popular CRDs. For custom CRDs, you can host your own schema files and add another `-schema-location` entry. ### Artifact Upload Fails in Kubernetes Version Matrix Jobs **Problem:** The `actions/upload-artifact` step fails with conflicts when multiple matrix jobs write to the same artifact name. **Solution:** Ensure each matrix job uses a unique artifact name that includes the Kubernetes version: `name: compatibility-matrix-${{ matrix.kubernetes-version }}`. Use `merge-multiple: true` in the download step. ### Compatibility Matrix Report Shows Unexpected Validation Failures **Problem:** Resources that should pass are showing as failed in the matrix. **Solution:** Verify that kubeconform has the correct schema version. Strict mode (`-strict`) will fail on unknown fields, so consider removing it for charts that include non-standard annotations. Check the detailed per-version reports in the GitHub Actions artifacts for specific error messages. ### Version Resource Not Visible in the Customer Portal **Problem:** The compatibility report was attached but customers cannot see it. **Solution:** Verify that `visibleToCustomers` is set to `true` in the `resources` JSON. Check the workflow logs to confirm the resource was included in the version creation request. ## Next Steps After Setting Up Kubernetes Compatibility Testing * **[Automatic Deployments from GitHub](/docs/integrations/github-actions/)**: If you haven’t already, set up automatic version creation and deployment updates * **[Application Entitlements](/docs/platform/application-entitlements/)**: Control which customers can access specific application versions and their compatibility reports * **[Configuring Helm Charts for Distr](/docs/controllers/helm-registry-auth/)**: Set up authenticated image pulls with imagePullSecrets * **[Distr SDK](/docs/integrations/sdk/)**: Build custom automation for generating and attaching compatibility reports programmatically ## Additional Resources for Kubernetes Compatibility Testing * [hello-distr Example Application](https://github.com/distr-sh/hello-distr): Complete working example with compatibility matrix scripts and workflow * [distr-create-version-action GitHub Repository](https://github.com/distr-sh/distr-create-version-action): GitHub Action documentation including the resources input * [kubeconform](https://github.com/yannh/kubeconform): Kubernetes manifest validation tool * [CRDs-catalog](https://github.com/datreeio/CRDs-catalog): Community-maintained catalog of CRD schemas for kubeconform * [Kubernetes Version Skew Policy](https://kubernetes.io/releases/version-skew-policy/): Official Kubernetes version support policy * [GitHub Actions Matrix Strategy](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs): Matrix build documentation * [Distr Community Forum](https://github.com/distr-sh/distr/discussions) *** Have questions? [Get help](https://github.com/distr-sh/distr/discussions) in our community forum or check out the [FAQs](/docs/faqs/).
# License Keys
> Create and manage License Keys to issue signed JWT tokens your application can verify to enforce usage limits, seat counts, and feature access.
This guide walks you through how to use License Keys to issue cryptographically signed tokens that your application can verify at runtime to enforce usage limits, seat counts, feature flags, or any other constraint you define. ## What license keys are for License Keys are different from [Application Entitlements](/docs/platform/application-entitlements/) and [Artifact Entitlements](/docs/platform/artifact-entitlements/). Entitlements control what a customer can access within Distr. License keys carry arbitrary data (seat counts, plan tier, feature flags) that your *application* reads and enforces independently of Distr. When you request a token for a license key, Distr generates a signed JWT. Your application verifies it using the public key you generate and distribute. No call back to Distr is needed at verification time, which means license key validation works in air-gapped and offline environments. ## Creating a license key 1. Navigate to **Licenses** in the sidebar 2. Click the customer you want to create a license key for 3. Select the **License Keys** tab and click **“Create License Key”** 4. Fill in the form: * **Name** (required): must be unique within your organization * **Description** (optional) * **Not Before**: the date from which the token is valid (defaults to today) * **Expires At**: the date the token expires (defaults to one year from today) * **Payload**: a JSON object with your custom claims (see [Payload](#payload) below) 5. **Save**: the key is created immediately  ## Payload The payload is a JSON object containing the custom claims you want to embed in the token. You define what these mean. Distr treats them as opaque data. Example payloads:
```json
{"seats": 25, "plan": "pro"}
```
```json
{
"instances": 3,
"modules": ["analytics", "reporting"],
"expires_notice_days": 30
}
```
The payload must be a JSON object (not an array or primitive). The following field names are reserved and cannot be used: the JWT-standard claims `exp`, `nbf`, `iss`, `sub`, `aud`, `iat`, as well as the Distr-specific claim `org`. ## Getting the token Once a license key exists, you can retrieve the signed JWT at any time: **Vendor:** In the customer’s detail view, open the actions menu (⋮) of the license key and choose **View license key**. Distr generates the token and displays it, so you can copy it to deliver to your customer. **Customer:** In the customer portal, navigate to **Licenses** and click the key. The token is available there directly. Customers can copy and use it in their environment. ## Verifying tokens in your application The token is a standard JWT signed with EdDSA (Ed25519). Use any JWT library that supports EdDSA to verify it. The token contains: * `iss`: your Distr host URL * `sub`: the license key UUID * `aud`: `["license-key"]` * `iat`: issued at (when the key was created in Distr) * `nbf`: not before * `exp`: expiration * `org`: the UUID of your Distr organization that issued the license key * All fields from your payload as top-level claims ### Retrieving the public key Your application needs the public key to verify license tokens. Distr exposes it via a public API endpoint that requires no authentication:
```plaintext
GET /api/public/v1/license-keys/public-key
```
The response is the PEM-encoded Ed25519 public key as plain text. This endpoint is available to anyone, so your application can fetch it at startup or embed it at build time. Example (curl):
```shell
curl https://your-distr.example.com/api/public/v1/license-keys/public-key
```
### Example verification Node.js with `jose`:
```js
import {importSPKI, jwtVerify} from 'jose';
const publicKey = await importSPKI(PUBLIC_KEY_PEM, 'EdDSA');
const {payload} = await jwtVerify(token, publicKey, {
audience: 'license-key',
});
console.log(payload.seats); // your custom claim
```
Your application is responsible for deciding what to do when verification fails or the token is expired. ## Editing a license key You can update the **description** of an existing license key at any time. The name is set at creation and cannot be changed. If you need to change the **payload**, **Not Before**, or **Expires At**, Distr generates a new license key with the updated values; the original is not modified. You can view all previously generated license keys in the **Revisions** section of the edit view. If any active deployments reference this license key, Distr will show you which deployment targets are affected before saving. Confirming will save the new revision and automatically trigger a redeployment on those targets. To edit: in the customer’s detail view, click the license key. ## Deleting a license key Caution Deleting a license key does **not** revoke tokens that have already been issued. A token remains valid until its expiration date regardless of whether the key still exists in Distr. If you need to invalidate a token before it expires, you must implement a revocation check in your application (e.g., a blocklist checked at verification time). To delete: open the actions menu (⋮) of the license key, choose **Delete** and confirm. ## Referencing license keys in deployments When you deploy via Distr controllers (Docker or Kubernetes), license keys assigned to the customer are automatically available as template variables in deployment environment files and Helm values. You don’t need to copy or distribute tokens manually. Distr generates and injects them at deploy time. ### Finding the reference syntax Each license key has a **Reference** column in the license keys list that shows the exact template variable to use: `{{ .LicenseKeys.MY_LICENSE_KEY }}` Copy this reference directly from the UI and paste it into your deployment configuration. ### Docker (env file) Reference a license key in the deployment’s environment file using Go template syntax:
```dotenv
LICENSE_TOKEN={{ .LicenseKeys.MY_LICENSE_KEY }}
```
In the application’s Compose file, read the environment variable as usual:
```yaml
services:
app:
image: your-app:latest
environment:
- LICENSE_TOKEN
```
The token is resolved at deploy time. The application reads `process.env.LICENSE_TOKEN` (or the equivalent in your language) at startup and verifies it. ### Helm (values YAML) Reference a license key in the deployment’s Helm values:
```yaml
app:
licenseToken: {{.LicenseKeys.MY_LICENSE_KEY}}
```
The resolved token is passed into the chart at deploy time. ### Registry-only deployments For customers who pull artifacts directly from your Distr registry without using deployment controllers, provide them with the token out-of-band. The customer is responsible for injecting it into their own deployment pipeline, typically as an environment variable, a mounted secret file, or a Kubernetes secret. ## Customer portal view Customers see their license keys under **Licenses** in the Customer Portal sidebar. For the full customer-side guide, see [Customer Portal Licenses](/docs/platform/customer-portal/licenses/).
# License Management
> Control which versions of your software each customer can access, enforce usage limits, and generate signed license tokens using Distr's licensing system.
License Management gives you granular control over what your customers can access, deploy, and use. You can restrict which application versions and artifacts each customer sees, and issue cryptographically signed license keys that let your application enforce usage limits and resource constraints at runtime. ## Overview Distr’s License Management system has three components: 1. **Application Entitlements**: Control which application versions each customer can deploy via Distr controllers 2. **Artifact Entitlements**: Control which artifacts and tags each customer can pull from your registry 3. **License Keys**: Issue signed JWT tokens your application can verify to enforce usage limits and resource constraints Entitlements and license keys are separate tools for different purposes. Entitlements control access at the Distr platform level. License keys carry arbitrary claims that your application reads and enforces independently of Distr. ## Navigating the Licenses section In the Vendor Portal sidebar, click **Licenses** to open the overview. The overview lists all your customer organizations, each showing a summary of their active entitlements and license keys. Click any customer to open their detail view, which shows all three types (Application Entitlements, Artifact Entitlements, and License Keys) for that customer in one place. ## Application Entitlements Application Entitlements control which versions of your applications customers can deploy through Distr controllers. When a customer has an entitlement, they can only see and deploy the specific application versions it grants. Key properties: * Linked to a single customer and application pairing * Grants access to one or more application versions * Once a version is granted, it cannot be revoked * Changes reflect immediately in the customer portal Learn how to create and manage Application Entitlements in the [Application Entitlements guide](/docs/platform/application-entitlements/). ## Artifact Entitlements Artifact Entitlements control which artifacts and tags customers can pull from your registry. You can grant access to specific tags, all current tags, or all current and future tags. Key properties: * Can include one or multiple artifacts * Tag access options: specific tags, all tags, or all tags including future ones * Once you create your first entitlement, customers only see artifacts they’re entitled to (before the first entitlement, all customers see everything) * Changes reflect immediately in the customer portal Learn how to create and manage Artifact Entitlements in the [Artifact Entitlements guide](/docs/platform/artifact-entitlements/). ## License Keys License Keys let you issue signed tokens that your application can verify to enforce usage limits, seat counts, feature flags, or any other runtime constraint you define. A license key contains: * **Name**: A unique identifier within your organization * **Description**: Optional, for your own reference * **Payload**: A JSON object with arbitrary custom claims (e.g. `{"seats": 10, "plan": "pro", "feature_x": true}`) * **Validity window**: A `notBefore` and `expiresAt` date License keys can optionally be scoped to a specific customer, or left unscoped for organization-wide use. ### How tokens work When you request a token for a license key, Distr generates a signed JWT. The token includes your payload as custom claims alongside standard JWT fields (issuer, subject, audience, issued-at, not-before, expiration). It is signed with an Ed25519 private key configured on your Distr instance. Your application verifies the token using the corresponding public key, with no call back to Distr required. This makes verification fast and lets it work in air-gapped or offline environments. Learn how to create and manage License Keys, including how customers inject them into Docker, Helm, and registry-only deployments, in the [License Keys guide](/docs/platform/license-keys/). ## Use cases * **Tiered pricing**: Grant different application versions or artifact sets based on subscription tier * **Targeted updates**: Deliver hotfixes or patches to specific customers only * **Early access**: Provide access to pre-release versions for premium customers * **Seat enforcement**: Embed seat or instance limits in a license key; your app reads and enforces them * **Feature flags**: Encode which product features a customer’s plan includes in the key payload * **Offline validation**: Customers in air-gapped environments can verify license tokens without contacting Distr ## Getting started 1. Ensure you’re on a Pro, Enterprise, or Pro Trial plan 2. Navigate to **Licenses** in the Vendor Portal sidebar 3. Select a customer to open their detail view 4. Create an Application Entitlement, Artifact Entitlement, or License Key from that view
# Role-Based Access Control (RBAC)
> Understand user roles and permissions, invite users with specific roles, manage access control, and learn how roles differ across subscription plans.
Distr provides role-based access control (RBAC) to help you manage who can access and modify different parts of your organization. Understanding roles and permissions is essential for maintaining security and proper access control across your vendor organization and customer organizations. ## Overview of User Roles Distr uses a role-based permission system with three standard roles that apply to both vendor organizations (your team) and customer organizations (your end customers): * **Administrator** - Full access to all features and settings * **User** - Can view and modify most resources, but cannot manage users or organization settings * **Viewer** - Can view resources but cannot make changes ## Roles and Permissions Matrix ### Vendor Organization Roles Vendor roles apply to your internal team members who access the Vendor Portal. | Permission | Admin | User | Viewer | | ------------------------------------- | ----- | ---- | ------ | | **View Dashboard** | ✅ | ✅ | ✅ | | **View Applications and Deployments** | ✅ | ✅ | ✅ | | **Edit Applications and Deployments** | ✅ | ✅ | ❌ | | **View Artifacts and Downloads** | ✅ | ✅ | ✅ | | **Create Personal Access Tokens** | ✅ | ✅ | ✅ | | **Push Artifacts** | ✅ | ✅ | ❌ | | **Pull Artifacts** | ✅ | ✅ | ✅ | | **View Licenses** | ✅ | ✅ | ✅ | | **Create/Edit/Delete Licenses** | ✅ | ✅ | ❌ | | **View Customers** | ✅ | ✅ | ✅ | | **Invite/Manage Customers** | ✅ | ✅ | ❌ | | **View Users** | ✅ | ❌ | ❌ | | **Invite/Manage Users** | ✅ | ❌ | ❌ | | **Manage Branding** | ✅ | ✅ | ❌ | | **View Subscription** | ✅ | ❌ | ❌ | | **Manage Subscription** | ✅ | ❌ | ❌ | | **View and Manage Org Settings** | ✅ | ❌ | ❌ | ### Customer Organization Roles Customer roles apply to end users who access the Customer Portal for a specific customer organization. | Permission | Admin | User | Viewer | | ---------------------------------- | ----- | ---- | ------ | | **View Dashboard** | ✅ | ✅ | ✅ | | **View Deployments** | ✅ | ✅ | ✅ | | **Create/Edit/Delete Deployments** | ✅ | ✅ | ❌ | | **Create Personal Access Tokens** | ✅ | ✅ | ✅ | | **Push Artifacts** | ✅ | ✅ | ❌ | | **Pull Artifacts** | ✅ | ✅ | ✅ | | **View Documentation** | ✅ | ✅ | ✅ | | **View Users** | ✅ | ❌ | ❌ | | **Invite/Manage Users** | ✅ | ❌ | ❌ | | **Manage Customer Settings** | ✅ | ❌ | ❌ | ## Customer Lens With Customer Lens, vendor users open the portal of any of their customers with their own role. Partner users can do the same for the customers assigned to their partner organization. To switch, open the context switcher in the top navigation bar (or press `Ctrl`+`K`, `⌘`+`K` on macOS). It lists the customers of the organization you are working in below that organization. To open a customer of another organization, switch to that organization first. Select the customer to open its portal. While you are working in a customer’s portal: * You keep your own role: a vendor administrator is an administrator in the customer portal, a vendor viewer stays a viewer. * Everything you change applies to that customer, and Distr records it under your own name. * A banner at the top of the page names the portal you are in. Click **Return to Vendor Portal** (or **Return to Partner Portal**) or select your organization in the switcher to go back. * Personal access tokens are unavailable, since they belong to your own organization membership. Return to your own portal to manage them. ## How to Invite Users with Specific Roles ### Inviting Vendor Organization Users To add team members to your vendor organization: 1. Log in to the [Vendor Portal](https://app.distr.sh) 2. Navigate to the **Users** section in the sidebar 3. Click **Add User** in the top right corner 4. Enter the user’s name, email address and select the role. 5. Click **Submit** The invited user will receive an email with a link to set up their account and password. Once they complete registration, they’ll have access according to their assigned role. ### Inviting Customer Organization Users To add users to a customer organization: 1. Log in to the [Vendor Portal](https://app.distr.sh) 2. Navigate to the **Customers** section in the sidebar (see [Customer Management](/docs/platform/customer-management/) for the full Customers UI) 3. Click **Manage users** for the customer organization you want to add users to 4. Click **Invite User** (or **Add user**) 5. Enter the user’s name and email address and select the role 6. Click **Submit** The invited user receives an email to set up their account. Alternatively, customer organization administrators can invite users directly from the Customer Portal: 1. Log in to the Customer Portal 2. Navigate to **Users** 3. Click **Add User** 4. Enter the name, email and select the role 5. Click **Submit** ## How Roles Differ Between Plans ### Community Edition **Role Management:** Not available * All internal users automatically have **Administrator** privileges * No role selection when inviting users * All team members have full access to all features * Customer organizations can only have one user. **Use case:** Ideal for small teams or POCs where simplified access control is sufficient. Caution If you upgrade to a paid plan, existing users will automatically be assigned the Administrator role. You can then change their roles as needed. ### Pro and Business Plans **Role Management:** Full RBAC available * Three roles available: **Administrator**, **User**, **Viewer** * Role selection available when inviting users * Can assign different roles to different team members (internal users) * Internal users can have granular permissions based on their role * Customer organizations can also use role-based access * Multiple customer users per organization with role-based permissions * Login with Google, GitHub & Microsoft; the Business plan adds enterprise SSO (bring-your-own OIDC) * Full control over who can view, edit, or manage different parts of the platform **Use case:** Ideal for teams that need granular access control and security compliance. Perfect for organizations where different team members need different levels of access to applications, deployments, licenses, and customer management. ### Enterprise Plan **Role Management:** Advanced RBAC with custom roles * All Pro plan roles available * **Custom roles** can be created with specific permission sets * Custom workflows and permission combinations * Advanced identity provider integrations, including SAML SSO * Fine-grained access control for complex organizational structures **Use case:** Ideal for large enterprises with complex access requirements and compliance needs. ## Managing User Roles Administrators can edit or remove any user by locating the user, selecting a new role to update their access, or clicking the delete button to remove them entirely.
# Support Bundles
> Let customers collect and share diagnostic data with your support team directly from within Distr.
Support Bundles give your customers a structured way to share [diagnostic data](/glossary/support-bundle/) when they report an issue. A customer initializes a bundle, runs a single `curl` command, and the collected data appears in your Vendor Portal. For a Docker deployment the command runs on the deployment host, for a Kubernetes deployment on a machine with access to the cluster. Nothing is uploaded without the customer’s explicit approval. ## How it works 1. The customer creates a support bundle from the Customer Portal, choosing Docker or Kubernetes and giving it a title and optional description. 2. Distr generates a one-time `curl` command tied to that bundle. The command is valid for 24 hours. 3. The customer runs the command. An interactive script shows the customer what will be collected and lets them exclude parts of it before anything runs or is sent. See [Docker bundles](#docker-bundles) and [Kubernetes bundles](#kubernetes-bundles) for what each collects. 4. Once the script finishes, the bundle appears in the Vendor Portal with all collected resources attached. 5. You and the customer can exchange comments on the bundle. When the issue is resolved, you mark it as resolved. Every collected resource is limited to 1 MiB by default, and container logs additionally to the most recent 1000 lines per container. Container logs keep the most recent output, script output the first, and a truncated resource says so in its content. On a self-hosted instance, both limits can be changed with [`SUPPORT_BUNDLE_RESOURCE_MAX_BYTES` and `SUPPORT_BUNDLE_LOG_TAIL_LINES`](/docs/self-hosting/configuration/#support-bundles). ## Docker bundles The customer runs the command on the affected host. The script shows the available Docker containers, the environment variable groups (with redacted values already masked) and the source of every custom script you configured. The customer can exclude any containers, env var groups or scripts before anything runs or is sent. ## Kubernetes bundles The customer runs the command on a machine with access to the cluster, typically the one they run `kubectl` from. Nothing is installed in the cluster. The machine needs Linux or macOS on amd64 or arm64 with `curl`, `tar`, `base64` and `sha256sum` or `shasum`. The script downloads the support collector of your Distr version from the [Distr releases on GitHub](https://github.com/distr-sh/distr/releases) and checks it against the checksums of the release before running it, so the machine needs access to `github.com`. The collector then: 1. Asks for the kubectl context to collect from when the kubeconfig has more than one, with the current context as the default. 2. Lists the namespaces of the cluster together with the Helm releases in them and asks which namespaces to collect, with the namespace of the context as the default. 3. Asks for every part of the bundle whether to collect it: * the cluster information: the Kubernetes version, nodes, namespaces, custom resource definitions, storage and ingress classes, admission webhooks and the persistent volumes of the selected namespaces * all resources of the selected namespaces, custom resources included * the Helm releases with their chart and app version, status and history, and separately the values they were installed with * the events of the selected namespaces * the last 1000 lines of every container log, including the previous run of restarted containers 4. Writes the files to a temporary directory and lets the customer look through them and edit or delete any of them before they confirm the upload. After the upload, the script runs the [custom scripts](#configure-custom-scripts) of the Kubernetes tab, which the customer can exclude just like on Docker. Anything the cluster refuses or fails to return is recorded in `collection-errors.txt` in the bundle, and the collection continues. `summary.yaml` records the context, the namespaces and the parts the customer selected. ### What the resources contain The collector stores every object as YAML as the cluster returns it, without its managed fields and its `kubectl.kubernetes.io/last-applied-configuration` annotation. That annotation is a full copy of the object, so it would carry ConfigMap and Secret values past the settings below. Endpoints, controller revisions, leases, the ReplicaSets of former rollouts and the Secrets Helm stores its releases in are left out, since they explain nothing that the rest of the bundle does not. Whether ConfigMap and Secret values are collected depends on the [ConfigMap and Secret settings](#configure-configmap-and-secret-values). Values that are not collected show up as `[REDACTED, bytes]`, so the keys stay visible. Service account and bootstrap tokens are always redacted. The environment variables in pod specs are collected as they are specified, since a pod spec only holds what the deployment set. The [environment variable list](#configure-environment-variables) applies to Docker only, and the [redaction](#redaction) below masks the values of variables whose name suggests a credential. ### Permissions The support collector only reads, with the credentials of the selected context. It needs `list` on the resources of the selected namespaces, `get` on `pods/log` and `list` on Secrets to find the Helm releases. The cluster information needs read access to the cluster-scoped resources listed above. A customer who can read their namespaces only still gets a useful bundle, and what is missing is recorded in `collection-errors.txt`. The built-in `view` ClusterRole does not grant access to Secrets, so it leaves out the Secrets and the Helm releases. ### Options The customer can pass arguments to the support collector by appending `-s --` and the arguments to the `sh` at the end of the command:
```sh
curl -fsSL '' | sh -s -- --context prod
```
| Option | Effect | | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | `--context ` | Collect from this context without asking. | | `--kubeconfig ` | Read this kubeconfig instead of the default one. | | `--include-configmap-data=true\|false` | Collect ConfigMap values or not, overriding the [settings](#configure-configmap-and-secret-values) of the vendor. | | `--include-secret-data=true\|false` | Collect Secret values or not, overriding the [settings](#configure-configmap-and-secret-values) of the vendor. | ## Redaction Distr redacts every resource before storing it, regardless of how the environment variables are configured. It masks with `********`: * the values of the customer’s [secrets](/docs/controllers/secrets/) * credentials in URLs, such as `postgres://user:password@host` * values of keys ending in `password`, `secret`, `token`, `api_key`, `access_key`, `private_key` or `credentials`, as in `DB_PASSWORD=...` or `"client_secret": "..."` * `Password` and `Pwd` fields of connection strings * values of Kubernetes environment variables whose name contains one of these words * `Authorization` headers and bearer tokens * well-known token formats: AWS access key IDs, GitHub, GitLab, Slack, Stripe and Google API keys, JWTs and Distr access tokens * PEM private keys The same redaction applies to deployment logs and controller logs. Redaction is based on patterns, so treat it as a safety net rather than a guarantee, and mark sensitive environment variables as **Redacted** as well. ## Vendor setup In the Vendor Portal sidebar, navigate to **Support Bundles**, then click **Settings**. The settings have a **Docker** and a **Kubernetes** tab, one for each kind of bundle. ### Configure environment variables On the **Docker** tab, you can configure which environment variables should be collected from the host and containers. The script collects only the variables on this list. Variables marked as **Redacted** have their values replaced with `[REDACTED]` in the collected data. The customer sees the redacted placeholder before confirming the upload. If no environment variables are configured, the script only collects container logs from running containers.  To add variables manually, click **Add Variable** and enter the variable name. To import from an existing file, click **Import** and paste the contents of a `.env` or config file. Lines in the format `KEY=value` or `KEY: value` are accepted; only the variable name is imported, not the value. Lines starting with `#` are ignored. Toggle **Redacted** for any variable whose value should not appear in collected bundles. Click **Save** when done. ### Configure ConfigMap and Secret values On the **Kubernetes** tab, choose whether Kubernetes bundles include the values of ConfigMaps and Secrets. ConfigMap values are collected by default and Secret values are not. Without them, a bundle still lists the ConfigMaps and Secrets with their keys, but shows each value as `[REDACTED, bytes]`. Collected Secret values are uploaded decoded in plain text, so only turn them on when you need them. The support collector tells the customer which values it collects before anything is collected, and the customer can override your choice with the [options](#options) `--include-configmap-data` and `--include-secret-data`. Click **Save** when done. ### Configure custom scripts Environment variables, logs and resources do not always answer the question you need answered. Each tab of the **Settings** page has its own custom scripts. What a script writes to standard output is attached to the bundle as a resource named after the script, once the customer has seen its first 30 lines and confirmed the upload. Docker scripts run on the customer’s host during collection. Kubernetes scripts run on the customer’s machine after the support collector. While they run, `KUBECONFIG` points to a kubeconfig that holds only the context and namespace the collector used, so `kubectl` and `helm` reach the same cluster and namespace without any arguments. Check that `kubectl` or `helm` is installed before relying on it. Click **Add Script** and give it a name, an optional description and the script body. The name is what the resource is called in the bundle and in the downloaded archive, so pick something you will recognise later, such as `database-status`. The description is shown to the customer next to the script. A script runs with the interpreter named in its shebang, so `#!/usr/bin/env bash` gets you Bash. Without a shebang it runs with `sh`. Keep in mind that you are writing for the customer’s machine, not yours: check that a command exists before relying on it, and do not assume Bash is installed. Use the **Enabled** toggle to park a script without deleting it. Disabled scripts are never sent to a customer. Caution Custom scripts execute on infrastructure you do not control, so the customer is shown the full source of every script and can exclude any of them before anything runs. Write scripts that only read diagnostic state, and never include credentials in them — anyone who can collect a bundle can read them. If a script fails or writes to standard error, its exit code and standard error are appended to the collected output so you can tell an empty result apart from a broken script. A script is stopped after one minute so that a command waiting for something that never happens cannot leave the customer with a collection that never finishes. The collected output says so when a script was stopped, and self-hosted instances can change the limit with [`SUPPORT_BUNDLE_SCRIPT_TIMEOUT`](/docs/self-hosting/configuration/#support-bundles). Write scripts that finish quickly and never wait for input. ### Enable the feature for a customer Support Bundles must be enabled per customer organization before customers can create bundles. See [Enabling features per customer](/docs/platform/customer-management/#enabling-and-disabling-features-per-customer) for how to do this. ## Reviewing support bundles In the Vendor Portal, navigate to **Support Bundles** to see all bundles across all customers.  The list shows each bundle’s title, type, customer, status, resource count, comment count and when it was last updated. Click any bundle to open the detail view. In the detail view: * **Collected resources** are listed under **Resources** as a folder tree. Click a folder to open it and a file to read its content. * **Comments** appear below the resources. Both vendor and customer users can leave comments. * Click **Mark as Resolved** to close the bundle once the issue is addressed. * Click **Delete** to remove the bundle. The list has a delete button on every row as well. ## When a bundle is not enough Some issues only show up while you look at the running containers, and Kubernetes Support Bundles are only available on request. For those cases, and with the customer’s consent, you can deploy a [tunnel](/glossary/reverse-tunnel/) next to your application and debug the installation yourself. See [Remote Access for Debugging](/docs/integrations/remote-access/). ## Customer flow When Support Bundles is enabled for a customer organization, customers see **Support** in their Customer Portal sidebar. For the full customer-side guide, see [Customer Portal Support Bundles](/docs/platform/customer-portal/support/). ## Bundle status lifecycle | Status | Meaning | | --------------- | ------------------------------------------------------------------------------- | | **Initialized** | Bundle created, collection script not yet run. Secret valid for 24 hours. | | **Created** | Collection script ran successfully. Resources are attached and ready to review. | | **Resolved** | Vendor has marked the bundle as resolved. | | **Canceled** | Bundle was canceled before data was collected. | Either party can cancel an **Initialized** bundle. Only vendors can resolve a bundle. Once resolved or canceled, a bundle cannot be reopened. Vendor, partner and customer users with the role **Administrator** or **User** can delete a bundle in any status. Deleting is permanent: the bundle, its collected resources and its comments are removed from Distr and cannot be restored.
# Vulnerability Management
> Track security issues from triage through disclosure, mark the versions they affect, see which customers are impacted and publish security advisories to your customers from within Distr.
When a security issue lands in your product, two questions need answering fast: which customers are exposed, and how do you tell them. Vulnerability Management answers both from inside Distr. You record the issue as a security advisory, mark the versions it affects, and Distr tells you which customers deployed or downloaded those versions. When you are ready, you publish, and the affected customers see the advisory in their portal. A **security advisory** is the record you write and disclose. It is not the same thing as the underlying vulnerability: one advisory describes one issue for your product, in your words, scoped to your versions. ## How it works 1. You create a security advisory. It starts in **Draft** and is visible only to your team. 2. You mark the application and artifact versions it affects, and the versions that carry the patch. 3. Distr shows you the affected customers: every deployment that has run an affected application version, labelled by where it stands now, and registry pulls of an affected artifact version. 4. You write the description in Markdown, add tags and link to public CVE databases or your own release notes. 5. When the advisory is ready, you **Publish** it. Affected customers now see it. 6. Once a patch has shipped, you mark the advisory as **Resolved**. Publishing opens the advisory’s timeline, which records every step from there on, together with any notes your team adds. ## Status lifecycle | Status | Customer visible | Meaning | | ------------ | ---------------- | --------------------------------------------------------------------------------- | | **Triage** | No | Reported through the API and waiting to be assessed. Nothing is committed to yet. | | **Draft** | No | The advisory is being written. Content is settled but not yet disclosed. | | **Active** | Yes | Disclosed to affected customers. | | **Resolved** | Yes | A patch has shipped. Stays visible so customers can confirm they are covered. | | **Canceled** | No | Closed without disclosure: a duplicate, a false report or not applicable. | These are the vendor’s own labels and only your team sees them. The status is called `published` in the [API](/docs/integrations/api/) and the [SDK](/docs/integrations/sdk/), where the name has not changed; **Active** is how the same status reads in the interface, because that is what it means once the advisory is out. ### Where an advisory starts An advisory you create in Distr starts in **Draft**, because you are writing it yourself and there is nothing to assess first. The form lets you pick another status right away if the advisory is ready to go out. **Triage** is the inbox for issues that arrive through the [API](/docs/integrations/api/) or the [SDK](/docs/integrations/sdk/), typically from a researcher intake form, a security mailbox or a scanner pipeline. Those land somewhere your team can review them before deciding whether they are worth an advisory. Creating an advisory programmatically therefore defaults to triage; send `"status": "draft"` to skip the inbox. ### Changing the status The status badge on the advisory list and on the detail page is itself a dropdown: click it and pick any status. There is no prescribed order, so you can disclose an advisory straight out of triage, unpublish one you sent out too early, resolve it once the patch has shipped and reopen it later. The severity badge works the same way, which is what a re-assessment usually comes down to. A status change that crosses the line between the statuses customers can see and the ones they cannot asks you to confirm it first, because it either discloses the advisory or withdraws it from the customer portal. Changes on one side of that line, such as resolving an advisory that is already **Active** or moving a triaged report to **Draft**, apply straight away. Canceling is the right ending for a report that turns out to be a duplicate, a false positive or an issue that does not apply to your product. A canceled advisory keeps its timeline, so the reasoning behind the decision stays on record. Caution Setting an advisory to **Active** discloses it to every affected customer immediately. Moving it back to a status they cannot see removes it from their portal, but it cannot retract what they have already read or been notified about. Publish once you are ready for the information to be out. ## CVE ID An advisory can carry the CVE ID of the issue it describes. It is optional: plenty of issues worth disclosing never get a CVE, and those advisories are identified by their title alone. On the detail page it is shown in the **References** panel, above the links. A CVE ID can be used by at most one advisory per organization, so that customers never have to work out which of two entries about the same CVE is the current one. Matching ignores case, and saving an advisory with a CVE ID that another one already carries is rejected. If you find yourself wanting a second entry for the same CVE, edit the existing advisory instead. ## Severity Severity is a hand-picked label rather than a computed CVSS score: **None**, **Low**, **Medium**, **High** or **Critical**. You decide what the issue means in the context of your product, which is usually more useful to your customers than an upstream score computed without knowledge of how the affected component is used. If you want to publish the underlying CVSS vector as well, add it to the description or link to the CVE entry as a reference. ## Filtering the list The list has a free-text search that matches the title, CVE ID, status, severity and tags, next to three dropdowns for severity, status and tags. Each dropdown takes any number of values, and picking several widens the result rather than narrowing it: selecting **High** and **Critical** shows both. Leaving a dropdown empty means it does not filter at all. The dropdowns combine with each other and with the search, which is what you want for a query like “critical and high advisories tagged `runtime` that are still in triage”. The status dropdown starts with every status except **Canceled** selected, so advisories you decided not to disclose stay out of the way. Tick **Canceled** to bring them back, or use **Select all** to see everything. Customers and partners get the search and the severity dropdown only. There is no status filter, because they are shown [**Affected** or **Not affected**](#what-customers-see) rather than the status, and no tag dropdown for customers, because the list of tags in use across your organization is not exposed to them. ## Marking affected versions Affected versions drive both the impact analysis and customer visibility, so it is worth being precise. In the **Versions** tab of the advisory form you can mark, per version: * **Affected**: the version contains the vulnerability. * **Patched**: the version carries the patch. Customers use this to work out where to upgrade to, and the advisory lists these versions under **Patched In**. “Affected” is always the exposure and “patched” is always the remedy, which is why neither word is used for the advisory’s own status. Both application versions and registry artifact versions can be marked. For artifacts, selecting a version also covers every tag pointing at the same image digest, so selecting a digest will not miss customers who pulled it by tag. Artifact versions are listed by their tags with the digest underneath, the same way they appear when you pick versions for an artifact entitlement, and the version panel on the advisory shows them the same way. Marking an artifact version does not pin it. Registry tags stay deletable and overwritable while an advisory refers to them, and deleting or overwriting one drops the marking with it. If that was the only affected version left, the advisory stops being shown to customers until you mark a current one. ## Seeing affected customers The advisory detail page shows two impact tables. Every row of every customer is only ever visible to your own team: partners see only the customers assigned to their partner organization, and a customer sees only itself, as described under [What customers see](#what-customers-see). **Deployments** lists one row per deployment that has ever run an affected application version. Each row is classified by the version its current revision runs: * **Affected**: it still runs a version you marked as affected. These are the customers to contact. * **Patched**: it now runs a version you marked as patched. The upgrade has landed and no further action is needed. * **Not affected**: it has moved off the affected version, but onto one you marked neither affected nor patched. It is no longer running a release you have flagged as vulnerable, though Distr cannot confirm it carries the patch. Alongside the state, each row shows the most recent affected version the deployment ran and when it last ran it. That stays visible even once a deployment is patched, because it is the exposure window you need when deciding who to notify. A large number of **Not affected** rows usually means you marked the affected versions but never marked the release carrying the patch. Marking it turns those rows into **Patched**. **Artifact Downloads** lists registry pulls of affected artifact versions, grouped by customer and version, with a pull count and the last pull time. Note that a download is not the same as a deployment. Distr records who pulled an artifact, but nothing links an artifact version to an application version, so this table tells you who obtained the affected artifact rather than who is currently running it. There is no state column for the same reason: the closest thing to evidence that a customer took the patch is that they later pulled a version you marked as patched, which is a fact about the artifact as a whole rather than about any one of these rows. ## What customers see A customer sees an advisory only when all of the following hold: * Vulnerability Management is enabled for your organization. * The advisory is **Active** or **Resolved**. * The customer has deployed an affected application version, or is entitled to at least one affected version. An advisory without an affected version is not shown to customers. Mark at least one version as affected before publishing if customers should receive the advisory. **Deployments** are the first thing checked, because they are the strongest evidence that a customer is exposed. If a customer’s deployment ever ran an affected application version, they see the advisory, whether or not they hold a matching entitlement. This is the same set of customers that the Deployments impact table reports to you, so the two views never disagree. Customers who have already upgraded stay included: the advisory is how they confirm they are covered. There is no equivalent for artifacts, because a gated artifact cannot be pulled without an entitlement in the first place. **Entitlements** are checked next, and are evaluated per resource type. For applications, the customer must hold an unexpired [application entitlement](/docs/platform/application-entitlements/) covering an affected application version; an entitlement that does not pin specific versions covers every version of its application. For artifacts, the customer must hold an unexpired [artifact entitlement](/docs/platform/artifact-entitlements/) covering an affected artifact. As elsewhere in Distr, entitlements are only a restriction once you use them. If you have configured no application entitlements at all, every customer is treated as entitled to every application version, and the same holds independently for artifacts. Vendors who do not use the licensing feature therefore still reach all of their customers. Customers see the title, severity, CVE ID, tags, description, references and the affected and patched versions. They do not see the timeline or who on your team wrote the advisory, since the timeline is an internal record and often contains notes you would not want to disclose. Neither does a partner. ### Which versions a customer is shown Entitlements decide not only whether an advisory is visible but also which of its versions it discloses. A customer is shown a marked version when they are entitled to it, or when they already have it because they deployed or downloaded it. Everything else is withheld, on both the affected and the patched side, and the version count in their list reflects only what they can see. If none of the patched versions are theirs, the advisory shows no patch at all rather than naming a release they cannot obtain, and the summary above their exposure table says that no patched version has been released yet. This matters most for backported patches. An advisory covering `1.3.0` and `1.5.0` with patches in `1.3.1` and `1.5.1` should not tell a customer on the 1.3 line to upgrade to `1.5.1`, and it must not disclose a patch published in an application they have no access to at all. Partners read advisories on behalf of the customers assigned to them rather than for themselves, so they are gated by disclosure alone: a partner sees every **Active** and **Resolved** advisory that marks an affected version, with all of its versions, and none of your drafts or triage. What is scoped to their own customers are the impact tables. Caution A consequence worth planning for: a customer whose entitlement pins exactly `1.3.0` will see no patch even after you ship `1.3.1`, because `1.3.1` is not theirs yet. Entitle them to the patched version as part of shipping it. An entitlement covering a whole application rather than pinned versions is unaffected, and so is a vendor who uses no entitlements of that kind. In place of the status they see whether the advisory is a live problem for them, **Affected** or **Not affected**. The status is never shown to them, and neither is the date you resolved it: the editorial workflow is your business, and telling a customer an advisory is “resolved” says nothing about whether they have taken the upgrade. Partners see the same two labels, computed across the customers assigned to them. A customer is **Affected** when either of the following holds: * One of their deployments still runs a version you marked as affected. * They pulled an affected version of an artifact and have not since pulled a version of that same artifact that you marked as patched. Because a pull cannot be observed the way a running deployment can, taking the patch is the only signal available, and it is tracked per artifact: pulling the patch for one artifact does not settle an advisory that covers two. Alongside it, **Your Exposure** shows the customer their own half of the impact tables: their deployments that have run an affected version and their own downloads of an affected artifact version, with the same Affected, Patched and Not affected states you see. Rows belonging to other customers are never included. A summary above the table states whether they are still exposed and what to do about it, so a customer who has already upgraded is told that they might no longer be affected instead of having to compare version numbers themselves. It is worded as a possibility on purpose: Distr knows which versions they deployed or downloaded, not what each of their own installations is running right now. This is also why an advisory stays visible after a customer upgrades. Customers reach advisories under **Security** in their portal sidebar. ## Tags Tags are free-form labels you define as you go, useful for grouping advisories by component, by upstream source or by whatever taxonomy your team already uses. Tags are visible to customers, so keep internal shorthand out of them and use the timeline for that instead. ## References References are links displayed alongside the advisory. Typical uses are the [NVD](https://nvd.nist.gov/) or [GitHub Advisory Database](https://github.com/advisories) entry for a CVE, an upstream project’s advisory or your own release notes. Each reference can carry an optional label; without one, the URL is shown. ## Timeline Every advisory keeps an append-only timeline recording who published it, who changed its status afterwards and who edited it. One save writes one entry listing everything it changed, so an edit reads as the single action it was. Your team can add notes to the timeline, which is a good place for investigation findings, decisions about severity and coordination with upstream maintainers. The timeline is the record of a disclosure, so it begins at the disclosure: publishing is always its first entry, and the drafting that came before it is not recorded. An advisory is rewritten until it is right, and none of that is worth reading afterwards. Notes are the exception and are kept whenever you write them, including during triage. The timeline is never shown to customers. ## Relationship to vulnerability scanning Security advisories and [Vulnerability Scanning](/docs/platform/vulnerability-scanning/) solve different problems and work well together. Scanning is automated and runs in your CI pipeline, producing a report of everything known CVE databases flag in a given build. It is broad and noisy by design. Security advisories are manual and curated. They cover the issues you have decided are worth communicating, whether they came from a scan, a security researcher, an upstream advisory or your own code review. Use scanning to find candidates, and advisories to triage, assess and disclose the ones that matter. ## Next steps * **[Application Entitlements](/docs/platform/application-entitlements/)**: Control which customers can access specific application versions, which in turn controls who sees an advisory. * **[Vulnerability Scanning](/docs/platform/vulnerability-scanning/)**: Automate CVE discovery in CI and attach reports to your versions. * **[Support Bundles](/docs/platform/support-bundles/)**: Collect diagnostic data from customer environments when investigating a report.
# Vulnerability Scanning
> Scan your application's source dependencies and container images for known vulnerabilities in CI/CD, generate severity-classified reports, and share them with customers as version resources using the Distr GitHub Action.
 When you distribute software to enterprise customers, shipping versions with known vulnerabilities erodes trust, slows adoption during security reviews, and creates a reactive support burden. Customers increasingly expect transparency about the security posture of the software they deploy. The first time they discover a known CVE in your application shouldn’t be during their own security audit. **Automated vulnerability scanning** solves this by adding a scanning stage to your CI/CD pipeline that checks both source dependencies (lockfiles) and container images on every release. The results are compiled into a severity-classified report and attached as a customer-visible version resource in Distr. The benefits compound as your customer base grows: * **Catch vulnerabilities before customers do.** Automated scanning on every release flags known CVEs in your dependencies and container images before they reach customer environments. * **Reduce security review friction.** When every version ships with a vulnerability report, customer security teams can review findings upfront rather than running their own scans and raising tickets. * **Build customer confidence with transparency.** Sharing a vulnerability report alongside each version demonstrates proactive security practices, without back-and-forth or surprises. * **Cover both source dependencies and container images.** Scanning lockfiles catches dependency-level vulnerabilities while image scanning catches issues in base images and system packages. * **Non-blocking by default, informational rather than a gate.** The scan always exits with code 0. Vulnerabilities are reported, not enforced, so you can ship while tracking known issues. In this guide, you’ll set up an automated vulnerability scanning pipeline that checks your application’s dependencies and container images on every build and publishes the results as a version resource in Distr, visible to your customers in their portal. By the end of this guide, you’ll have: * A GitHub Actions workflow that scans lockfiles and container images on every build * A unified vulnerability report with per-service breakdowns classified by CVSS severity * Automated attachment of the vulnerability report as a version resource visible to customers in Distr ## Prerequisites for Vulnerability Scanning Before starting, ensure you have: 1. A Distr account with an organization set up 2. A Docker or Helm application configured in Distr (see [Create Application](/docs/controllers/application/)) 3. A GitHub repository containing your application 4. The [Automatic Deployments from GitHub](/docs/integrations/github-actions/) workflow already configured. This guide extends that pipeline with a vulnerability scanning stage 5. Container images published to a registry accessible from your CI runner (e.g., GHCR, Docker Hub) ## How Distr Vulnerability Scanning Works in CI/CD The vulnerability scan runs as part of your CI/CD pipeline and attaches a report as a version resource to your Distr application version. The [hello-distr workflow](https://github.com/distr-sh/hello-distr/blob/main/.github/workflows/hello-distr.yaml) provides a complete working example you can use as a starting point. The workflow defines three core jobs with the following dependency chain: 1. **build**: Builds and pushes container images for each service to your container registry. 2. **vulnerability-scan**: Runs the scan script against source dependency lockfiles and container images. Uploads the report as a workflow artifact and writes it to the GitHub Actions job summary. 3. **distr-docker / distr-kubernetes**: Downloads the vulnerability scan artifact and attaches `vulnerability-scan.md` as a customer-visible version resource alongside the version creation using [distr-create-version-action](https://github.com/distr-sh/distr-create-version-action). These jobs are ordered via dependencies so they run in this sequence relative to each other, while still allowing any non-dependent jobs in your workflow to run in parallel where applicable. The scan covers two dimensions: * **Source dependencies:** The scanner reads lockfiles (`requirements.txt`, `package-lock.json`, etc.) and checks each dependency against public vulnerability databases for known issues. * **Container images:** The scanner analyzes image layers to identify vulnerable packages in base images and system-level dependencies. Results are classified using [CVSS](https://www.first.org/cvss/) scores into severity levels: Critical (9.0+), High (7.0+), Medium (4.0+), Low (0.1+), and None (0.0 or unscored). Output is generated in both Markdown (`vulnerability-scan.md`) for human review and JSON (`vulnerability-scan.json`) for programmatic processing. ## Understanding Version Resources in Distr Version resources are supplementary markdown content items attached to application versions. They appear alongside the version details in both the vendor and customer portals. The `visibleToCustomers` flag controls visibility: * When `true`, the resource appears in the customer portal, which is useful for vulnerability reports, compatibility matrices, and release notes * When `false`, the resource is only visible to vendor team members, which is useful for internal notes and deployment checklists For a detailed explanation of version resources including programmatic creation via the Distr SDK, see [Understanding Version Resources](/docs/platform/kubernetes-compatibility-matrix/#understanding-version-resources-in-distr) in the Kubernetes Compatibility Matrix guide. ## Example Vulnerability Scanning Pipeline from hello-distr The [hello-distr](https://github.com/distr-sh/hello-distr) repository provides a complete working example of this setup. File layout:
```plaintext
hello-distr/
.github/workflows/
hello-distr.yaml # Workflow with vulnerability-scan job
deploy/
scripts/
distr-vulnerability-scan.sh # Vulnerability scanning script
backend/
requirements.txt # Python dependencies (pinned versions)
frontend/
package-lock.json # Node.js dependencies
mise.toml # Tool versions including scanner
```
The hello-distr implementation: * Scans 4 services: backend, frontend, proxy, and jobs * Scans lockfiles for services that have them (`requirements.txt` for Python, `package-lock.json` for Node.js) * Scans container images for all 4 services * Classifies vulnerabilities by CVSS severity with color-coded indicators * Writes the report to the GitHub Actions job summary for easy review * Merges per-scan JSON results into a unified `vulnerability-scan.json` * Always exits with code 0; vulnerabilities are informational and do not block the pipeline * Supports two execution modes: `ci ` for tag builds (scans registry images) and local mode for development (scans locally built images) You can fork or copy from the hello-distr repository to get started quickly, then customize the scan script for your own services and lockfile paths. ## Running Vulnerability Scans Locally You can run the same vulnerability scan locally during development. If you use [mise](https://mise.jdx.dev/) for tool management, the scan script’s dependencies are already declared in `mise.toml`:
```bash
mise install
```
Then execute the scan from the repository root:
```bash
# Local mode — scans lockfiles and locally built images tagged :local
./deploy/scripts/distr-vulnerability-scan.sh
# CI mode — scans lockfiles and pulls images from the registry for a specific version
./deploy/scripts/distr-vulnerability-scan.sh ci 0.3.0
```
The script generates `vulnerability-scan.md` and `vulnerability-scan.json` in the current directory. ## Troubleshooting Vulnerability Scanning ### Scanner Not Found During Vulnerability Scanning **Problem:** The workflow or local scan fails because the scanner binary is not available on the PATH. **Solution:** In CI, ensure the install step downloads the correct binary for your runner’s architecture and adds it to `$GITHUB_PATH`. Locally, run `mise install` to install all declared tool dependencies. ### Container Image Not Found During Vulnerability Scanning **Problem:** The scan script skips image scanning with “image not found” for one or more services. **Solution:** In local mode, build the images first with `docker build -t /:local ./`. In CI mode, ensure the `docker/login-action` step runs before the scan and that the image tags match the version being scanned. Verify the container registry URL in the scan script matches your actual registry. ### Vulnerability Scan Report Shows No Findings for Container Images **Problem:** The report lists vulnerabilities from lockfiles but shows zero findings for container images. **Solution:** Verify that images are available to the scanner. In local mode, images must be built and present in the local Docker daemon. In CI mode, images must be pushed to the registry and the runner must be authenticated to pull them. Check the workflow logs for “SKIP: image not found” messages. ### Vulnerability Scanning Takes Too Long in CI **Problem:** The `vulnerability-scan` job significantly increases overall pipeline duration. **Solution:** Container image scanning is inherently slower than lockfile scanning because the scanner must pull and analyze image layers. Consider scanning only critical services or using smaller base images. Since the scan job runs in parallel with non-dependent jobs, it typically does not add to the critical path. ### Vulnerability Scan Version Resource Not Visible in the Customer Portal **Problem:** The vulnerability report was attached but customers cannot see it. **Solution:** Verify that `visibleToCustomers` is set to `true` in the `resources` JSON. Check the workflow logs to confirm the artifact was downloaded successfully and the file path in the `resources` input is correct. ## Next Steps After Setting Up Vulnerability Scanning * **[Vulnerability Management](/docs/platform/vulnerability-management/)**: Triage the findings that matter, mark the versions they affect, see which customers are impacted, and publish advisories from within Distr * **[Kubernetes Compatibility Matrix](/docs/platform/kubernetes-compatibility-matrix/)**: Validate Helm charts against multiple Kubernetes versions and share compatibility reports with customers * **[Automatic Deployments from GitHub](/docs/integrations/github-actions/)**: If you haven’t already, set up automatic version creation and deployment updates * **[Application Entitlements](/docs/platform/application-entitlements/)**: Control which customers can access specific application versions and their vulnerability reports * **[Distr SDK](/docs/integrations/sdk/)**: Build custom automation for generating and attaching vulnerability reports programmatically ## Additional Resources for Vulnerability Scanning * [hello-distr Example Application](https://github.com/distr-sh/hello-distr): Complete working example with vulnerability scanning scripts and workflow * [distr-create-version-action GitHub Repository](https://github.com/distr-sh/distr-create-version-action): GitHub Action documentation including the resources input * [osv-scanner](https://github.com/google/osv-scanner): The open-source vulnerability scanner used under the hood * [CVSS Specification](https://www.first.org/cvss/): Common Vulnerability Scoring System documentation * [Distr Community Forum](https://github.com/distr-sh/distr/discussions) *** Have questions? [Get help](https://github.com/distr-sh/distr/discussions) in our community forum or check out the [FAQs](/docs/faqs/).
# Artifact Registry
> The Artifact Registry is a private, OCI-compliant registry built into Distr for publishing container images, Helm charts, and other artifacts to self-managed environments. It includes tag-based access control, a registry UI, and detailed usage insights per customer.
The Distr Artifact Registry is a built-in, [OCI-compliant](/glossary/oci-container-artifact-registry/) registry designed for AI and software companies to distribute Docker images and [Helm Charts](/glossary/helm-chart/), [SBOMs](/glossary/sbom-software-bill-of-materials/) and other OCI artifacts to [self-managed](/glossary/self-hosted-software/) and [BYOC](/glossary/byoc-definition/) environments. It also includes tag-based access and licensing controls. The registry also provides detailed download analytics that let you monitor which versions of your software are being used by each customer. Use it to publish versioned artifacts, enforce entitlement rules, and track consumption across your customer base.  ### Core capabilities * **Multi-artifact support**: Distribute Docker Images, Helm Charts, Terraform Modules, [Zarf packages](/docs/integrations/zarf/), and any OCI-compliant artifact * **Software supply chain security**: Store SBOMs and signatures for image verification * **Visibility**: Get insights into which customers are using which artifacts and versions * **Open standards**: Built on the OCI specification and compatible with existing tooling (Docker, ORAS, Helm, etc.) * **Built-in licensing (beta)**: Bind artifact versions to entitlements for fine-grained customer access control ## Getting started Want a quick overview of how it works? Watch this short walkthrough: [YouTube video player](https://www.youtube-nocookie.com/embed/gM9WCx61owQ?si=rWP7n4UR1liAKi_6) ## Artifact Registry UI ### Artifact List The Artifact List page lets you view all artifacts stored in your registry. It provides an overview of pull counts across all tags, along with insights into which users and customers are using each artifact.  ### Artifact Details The artifact details page gives you a complete view of all tags associated with a specific artifact. You can see the OCI URL, upload date, and artifact size, along with pull counts for each tag.  ## Versioning Strategy Every artifact has a versioning strategy, which determines how its versions are sorted on the artifact details page and which tag counts as the newest: * **Chronological versioning** orders versions by the time they were pushed, whatever their tags are named. It is the default and accepts any tag. * **Semantic versioning** orders versions by [SemVer](https://semver.org/) precedence, so `1.10.0` is newer than `1.9.0` and `2.0.0` is newer than `2.0.0-rc.1`. A version with several tags is ranked by its highest one. Under semantic versioning, every tag has to be a SemVer version with exactly three numbers, optionally prefixed with `v`: `1.2.3`, `v1.2.3` and `1.2.3-rc.1` are accepted, `1.2`, `latest` and `main` are not. The registry rejects a push of any other tag with `403 Forbidden` and the error code `DENIED`. Signature and attestation tags (`sha256-.sig`, `.att`, `.sbom` and `.cosign`) are exempt, so signing an image with cosign keeps working. Change the strategy on the artifact details page. Switching an artifact that holds tags that are not SemVer versions to semantic versioning deletes those tags, after Distr has named them and you have confirmed. Their pull history is deleted with them, and pushed tags cannot be restored. The switch is refused if one of them cannot be deleted, for example because an entitlement grants exactly that version, and if none of the artifact’s tags is a SemVer version. ## Public Artifacts A single artifact can be made public, so anyone who knows its name can pull it without credentials. This is meant for what you want to hand out freely, an installer image, a CLI, an agent chart or a public demo, while everything else in the registry stays private. Open the artifact details page and pick **Make public** from the menu in the top right. The artifact then carries a **Public** badge everywhere it is listed, and **Make private** in the same menu requires credentials again. Only organization admins can change it. Caution Making an artifact public exposes every version and tag it has, present and future, and [artifact entitlements](/docs/platform/artifact-entitlements/) no longer restrict who may pull it. It also appears in the artifact list of every customer of your organization, whether they hold an entitlement for it or not. For a [pull-through cache](/docs/registry/pull-through-cache/) artifact this extends to the upstream: a pull that misses the cache is fetched from the upstream registry with the credentials stored on the artifact. ### Pulling without credentials Docker, Podman, Skopeo, ORAS, Helm and anything speaking the HTTP API directly pull a public artifact with no setup at all:
```sh
docker pull registry.example.com/acme/my-image:1.0.0
oras pull registry.example.com/acme/my-artifact:1.0.0
helm pull oci://registry.example.com/acme/my-chart --version 1.0.0
curl -sSL https://registry.example.com/v2/acme/my-image/manifests/1.0.0 \
-H 'Accept: application/vnd.oci.image.manifest.v1+json'
```
Private artifacts still need credentials: log in with `docker login`, `podman login` or `helm registry login`, using a PAT as the password. Anonymous pulls are rate limited per client IP address, considerably more strictly than the pull limits of the large public registries. A client that exceeds them gets `401 Unauthorized` with a request to authenticate and a `Retry-After` header. Authenticated pulls are never rate limited, so a client that holds a PAT authenticates with it and pulls on, and a customer who runs into the limit only has to log in. The answer is a 401 rather than `429 Too Many Requests` because OCI clients send their credentials only once they have seen a 401, so a 429 would lock out a customer whose credentials are sitting unused in the client’s config file. Self-hosted instances can change the limits, see the [`REGISTRY_ANONYMOUS_*` variables](/docs/self-hosting/configuration/#oci-registry). Every anonymous pull is recorded in the [download analytics](/docs/registry/analytics/) like any other pull, marked as **Anonymous** since there is no user or customer behind it. ## Global Dashboard Artifact View The main Distr dashboard also provides a global view of which artifacts each end customer has consumed, including version details and a health status.  ## Artifact Deletion The Distr registry protects artifacts and tags that are referenced in entitlements, so customers keep access to their licensed software. ### Deleting Artifact Tags You can delete individual tags from an artifact through the API, the UI and the registry itself (`DELETE /v2//manifests/`). However, the system enforces several validation rules to prevent breaking customer access. Only named tags such as `v1.0.0` can be deleted. A digest reference (`sha256:…`) is rejected with `400 Bad Request`, which also affects clients that resolve a tag to its digest before deleting it. #### When Tag Deletion is Allowed Tag deletion succeeds when all of these conditions are met: * The tag exists * No [artifact entitlement](/docs/platform/artifact-entitlements/) grants all versions of the artifact * If an entitlement grants exactly the version the tag points at, another tag must point at that version as well * If it is the last tag of the artifact, no entitlement references the artifact at all Deleting the last tag of an artifact deletes the entire artifact, as described in [Deleting Artifacts](#deleting-artifacts). When this happens through the registry API, the response carries a `Warning` header saying so. A [pull-through cache](/docs/registry/pull-through-cache/) artifact is the exception: its last tag cannot be deleted, and the next sync restores a deleted tag unless it has been removed from the upstream repository. #### What Deleting a Tag Removes Deleting a tag also deletes the version the tag pointed at, so that its blobs can be reclaimed. For a multi-arch image, this extends to the per-architecture manifests the index referenced. A version is only deleted when nothing references it any more, that is when no other tag points at it and no other version references it (a per-architecture manifest shared with another index is kept). An entitlement that grants a version deleted this way loses that version, and keeps every other artifact and version it grants. Once a version is deleted, it can no longer be pulled by its digest. The blobs themselves are removed by the [blob cleanup job](/docs/self-hosting/maintenance/#database-cleanup-jobs), which a self-hosted instance has to schedule. #### Example: Tag Deletion Scenarios **Scenario 1: Safe deletion** > Artifact: myapp Tags: v1.0.0, v1.0.1, latest (all point to different digests) License: References sha256:abc123 (v1.0.0’s digest) > > Action: Delete tag “v1.0.1” Result: Success - v1.0.1 is not licensed **Scenario 2: Blocked deletion - licensed digest** > Artifact: myapp Tags: v1.0.0 (points to sha256:abc123) License: References sha256:abc123 > > Action: Delete tag “v1.0.0” Result: Blocked (400) - Cannot delete last non-SHA tag for licensed digest **Scenario 3: Last tag deletes the artifact** > Artifact: myapp Tags: v1.0.0 (only tag remaining) No licenses > > Action: Delete tag “v1.0.0” Result: Success - the artifact myapp is deleted as well ### Deleting Artifacts You can delete entire artifacts from your registry, which will cascade to all associated versions, tags and historical download data. #### When Artifact Deletion is Allowed Artifacts can be deleted when they are not referenced in any entitlement, including an expired one. Caution Deleting an artifact is a cascade operation that automatically removes all associated artifact versions, tags, and parts. This action cannot be undone. Ensure the artifact is not referenced in any entitlements before deletion. #### Best Practices * **Check entitlements first**: Before deleting artifacts or tags, verify they are not referenced in customer entitlements * **Use caution with tags**: Deleting tags can affect customer access if not done carefully * **Monitor usage**: Review the Downloads section to understand which artifacts and versions are actively used * **Mind the last tag**: Deleting the last tag of an artifact deletes the artifact with it
# Artifact Download Analytics
> Track and analyze artifact pulls across your customer base with filtering by customer, user, IP address, artifact, and version, plus CSV export for reporting.
Every artifact pull from the Distr registry is recorded automatically. The **Downloads** page in the vendor portal gives you a chronological log of every pull, with filters to narrow down exactly what you’re looking for and a CSV export for offline analysis.  ## What gets tracked Each pull event records: | Field | Description | | -------------- | ---------------------------------------------------------------------- | | **Date** | Timestamp of the pull | | **Customer** | The customer organization that performed the pull (if associated) | | **User** | The name or email of the authenticated user, or `Anonymous` | | **Deployment** | The deployment target whose controller performed the pull | | **Address** | The IP address the pull originated from | | **Artifact** | The artifact name (e.g. `myapp`, `backend`) | | **Version** | The tag or digest that was pulled (e.g. `v1.2.0`, `sha256:d2b712d...`) | ## Filtering pull data The filter bar at the top of the Downloads page lets you narrow results by any combination of: * **Date range**: Set a **From** and **To** date to limit results to a specific time window * **Customer**: Select a specific customer organization * **User**: Select a specific user account, or **Anonymous** for the pulls that came without credentials * **Deployment**: Select a specific deployment target whose controller pulled artifacts * **Address**: Select a specific IP address * **Artifact**: Select a specific artifact * **Version**: When an artifact is selected, filter further by a specific tag or digest All filters are combined and applied in real time. Click **Reset** to clear all filters at once. ### Cascading version filter The **Version** dropdown only appears after you select an **Artifact**. It then shows only the tags and digests that belong to that artifact, keeping the filter options relevant. ## Exporting to CSV Click the **Export CSV** button to download the current filtered view as a CSV file. The export respects all active filters, so you can narrow results first and then export only the data you need. The CSV file contains these columns: | Column | Format | | ----------------- | ----------------------------- | | Date | ISO 8601 timestamp (RFC 3339) | | Customer | Customer organization name | | User | User display name | | Email | User email address | | Deployment Target | Deployment target name | | Anonymous | `true` or `false` | | Address | IP address | | Artifact | Artifact name | | Version | Tag or digest | The file is named `YYYY-MM-DD_artifact_pulls.csv` using the current date. ## Pagination The Downloads page loads 50 pull records at a time. If more records match your filters, a **Show more** button appears at the bottom of the table to load the next batch. Changing any filter resets the list and loads fresh results. ## Use cases for download analytics * **Audit customer usage**: Filter by customer to see exactly which artifacts and versions they have pulled and when * **Detect unusual activity**: Filter by IP address to spot pulls from unexpected locations, including anonymous pulls from public artifacts * **Track adoption**: Filter by a new artifact version to see how quickly customers are pulling it after release * **Generate compliance reports**: Export filtered pull data as CSV for security audits or license compliance reviews * **Debug access issues**: If a customer reports problems pulling an artifact, check whether their pulls appear in the log and from which IP address
# Registry Configuration
> Set up your registry, push your first artifact, and start distributing your software to customers with fine-grained access control.
A quick guide to configuring and using the Distr Artifact Registry for secure, tag-based software distribution. ## 1. Set your Registry Slug Before you can push or pull artifacts, you must configure a registry slug at the organization level. This slug becomes part of your registry URL.  *** ## 2. Authenticate with a Personal Access Token Generate a [Personal Access Token (PAT)](/docs/integrations/personal-access-token/) in your Distr account. Use this token to log in to the registry:
```shell
echo "YOUR-ACCESS-TOKEN" | docker login registry.distr.sh:8585 --password-stdin -u -
```
*** ## 3. Push Your First Artifact Now that you’re authenticated, you can start pushing artifacts to the registry. Before uploading, you need to tag your artifact using the correct registry slug and version. You can try it with a sample image:
```shell
docker pull hello-world
docker tag hello-world registry.distr.sh/slug/hello-world:1.0.0
docker push registry.distr.sh/slug/hello-world:1.0.0
```
Replace slug with your configured registry slug, and 1.0.0 with your desired version tag. *** ## 4. Monitor Usage * Use the Distr dashboard to view artifact pull counts, customer usage, and download analytics. * Use the Downloads panel to view a chronological list of all downloaded artifacts, including which user downloaded them and from which IP address. * By default, the registry uses immutable tags, so once pushed, a tag cannot be changed. Immutable tags are a safer and more secure default. If you need to overwrite existing tags, mutable tags can be enabled on the organization settings page (“Artifact versions are mutable”).  *** ## 5. Customer Access * Customers should authenticate with their own [PAT](/docs/integrations/personal-access-token/) and can only pull artifacts they are licensed for. * The [customer portal](/docs/platform/customer-portal/registry/#registry-quickstart-from-the-customer-portal) provides a simplified view, the registry UI only shows the artifacts and versions that are accessible to the user. 
# Pull-Through Cache
> Configure the Distr registry to proxy and cache artifact tags from an upstream OCI-compatible registry.
The Distr registry can act as a pull-through cache for any OCI-compatible upstream registry. Configure an artifact with an upstream URL and Distr will sync tags from the upstream and serve blobs to your customers on demand, with no direct upstream access required. This lets you consolidate all image pulls through a single registry endpoint with unified access control, download analytics, and entitlement enforcement, regardless of where the images are originally hosted. ## How it works After a sync, Distr stores the tag list and manifest metadata from the upstream. Blob data (layers, image configs) is fetched from the upstream on first pull and cached in the Distr registry. Subsequent pulls are served entirely from Distr. A synced tag counts toward your registry storage only once it has been pulled. ## Setting up a pull-through cache artifact  Caution Pull-through and direct push are mutually exclusive. Once an artifact is configured with an upstream, it cannot be pushed to manually. If you need both, use separate artifacts. When creating or editing an artifact, set the **Upstream URL** to the fully qualified image reference of the upstream repository. The URL must point to a specific repository, not the entire registry. Each pull-through artifact maps to exactly one upstream repository. The upstream registry must be reachable at a public address: Distr rejects hosts that resolve to private, loopback, link-local or other special-purpose addresses. | Upstream registry | Example URL | | ------------------------- | ------------------------------------------------------ | | Docker Hub | `docker.io/library/redis` | | AWS ECR | `123456789012.dkr.ecr.us-east-1.amazonaws.com/my-repo` | | GitHub Container Registry | `ghcr.io/org/repo` | | Google Artifact Registry | `us-docker.pkg.dev/project/repo/image` | ## Authentication If the upstream requires authentication, select one of the supported auth types. Credentials are validated against the upstream when saved. | Type | Credentials | | ------- | --------------------------------------- | | Basic | Username and password | | AWS ECR | AWS Access Key ID and Secret Access Key | Public repositories do not require authentication. Select “No authentication”. ### AWS ECR For AWS Elastic Container Registry, select “AWS ECR” and provide an AWS access key ID and secret access key. Distr automatically exchanges these credentials for a short-lived ECR authorization token and refreshes it before it expires. The IAM identity associated with the credentials must have the following permissions:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DistrPullThroughCache",
"Effect": "Allow",
"Action": [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
"ecr:DescribeImages",
"ecr:GetAuthorizationToken",
"ecr:DescribeRepositories",
"ecr:ListImages"
],
"Resource": "*"
}
]
}
```
## Pulling images through the cache Once configured, pull images using the standard Docker CLI (or any OCI client) via the Distr registry URL:
```shell
docker pull registry.distr.sh//:
```
Replace `` with your organization’s registry slug, `` with the name you gave the artifact in Distr, and `` with the upstream tag you want to pull. Clients must [authenticate with a Personal Access Token](/docs/integrations/personal-access-token/) the same way they do for any other artifact in the Distr registry. ## Tag synchronization Distr runs a background sync job to keep the local tag list in sync with the upstream repository. The sync fetches all tags and their manifest metadata, making them available for HEAD requests and entitlement enforcement without requiring an actual pull. On Distr Cloud, the sync runs twice per hour (at :15 and :45). For self-hosted instances, the schedule is controlled by the `REGISTRY_UPSTREAM_SYNC_CRON` environment variable. See [Upstream Tag Synchronization](/docs/self-hosting/maintenance#upstream-tag-synchronization). You can also trigger a manual sync at any time from the artifact details page or via the API:
```shell
curl -X POST https://app.distr.sh/api/v1/artifacts//sync \
-H "Authorization: AccessToken "
```
You can delete a synced tag like any other tag, but the next sync restores it unless it has been removed from the upstream repository. The last tag of a pull-through cache artifact cannot be deleted; delete the artifact instead. ## Versioning strategy A pull-through cache artifact can use [semantic versioning](/docs/registry/#versioning-strategy) like any other artifact. Since the upstream decides which tags exist, the sync then skips every upstream tag that is not a SemVer version, such as `latest`, instead of failing. Signature and attestation tags are synced as usual. A manual sync from the artifact details page lists the tags it skipped. Switching to semantic versioning deletes the tags the artifact already holds that are not SemVer versions, as for any other artifact. The sync does not restore them afterwards. ## Monitoring sync status The artifact details page shows: * **Last synced at**: when the most recent sync completed successfully. * **Last sync error**: the error message from the most recent failed sync, if any. If the sync error field is populated, verify that the upstream URL is correct and that the configured credentials have not expired or been revoked.
# Self-Hosting Distr
> Distr can be easily self-hosted in your own environment to use it as an internal software distribution platform and artifact registry.
While the easiest way to use Distr is to use our [hosted offering](/onboarding/), self-hosting is also an option. The free and open source Community Edition is the perfect option to try Distr locally on your own machine. Distr comes as a statically compiled Go binary packaged as a container image, and has minimal dependencies: * A PostgreSQL 18+ database * Loki for log processing * Two S3 compatible object storage buckets for registry blobs and log chunks Before you get started, review the [System Requirements](/docs/self-hosting/system-requirements/) to make sure your environment is sized correctly. Check out our [Docker Compose](/docs/self-hosting/docker/) or [Kubernetes](/docs/self-hosting/kubernetes/) deployment options, or find out more information about the inner workings of Distr at [`github.com/distr-sh/distr`](https://github.com/distr-sh/distr/). ## Configuration Whichever way you deploy it, Distr is configured entirely through environment variables, in the `.env` file next to the Compose file or under `distr.env` in the Helm values. Only `DATABASE_URL`, `JWT_SECRET`, `DATABASE_ENCRYPTION_KEY`, `DISTR_HOST` and `LOKI_URL` are needed to start it. Everything else either has a default or belongs to a feature you turn on, such as the OCI registry, OIDC sign-in, outgoing mail, custom domains or the maintenance jobs. The [Configuration Reference](/docs/self-hosting/configuration/) lists every variable, grouped by area, and is the place to look up what a setting does and when it is required. ## Semantic Versioning We are using [semantic versioning](https://semver.org/) for the releases of Distr, the Distr Controllers and the Distr SDKs. ## Changelog See the [changelog](/changelog/) for a list of all releases and the changes they include. ## Self-Hosting a Paid Plan Every plan can also be self-hosted, with the same feature set as on Distr Cloud (see [Choosing a Plan](/docs/subscription/)). Paid plans run the Distr Enterprise image, which unlocks the plan its license key was issued for, so [get in touch](/contact/) if you are interested. How to obtain the image and where to put the license key is described for [Docker Compose](/docs/self-hosting/docker/#distr-enterprise) and for the [Helm chart](/docs/self-hosting/kubernetes/#distr-enterprise). Reference setups for a paid plan ship with the repository, as Compose stacks under [`deploy/docker`](https://github.com/distr-sh/distr/tree/main/deploy/docker) and as Helm values files under [`deploy/charts/distr/examples`](https://github.com/distr-sh/distr/tree/main/deploy/charts/distr/examples). One of each runs everything on a single VM or cluster, and two run Distr against a managed database and managed object storage on AWS or GCP. The [Docker Compose](/docs/self-hosting/docker/#running-in-production) and [Kubernetes](/docs/self-hosting/kubernetes/#running-in-production) pages walk through both clouds.
# Configuration Reference
> Complete reference of all environment variables used to configure a self-hosted Distr instance, grouped by area.
This page lists all environment variables used to configure a self-hosted Distr instance. Variables marked as **required** must be set for Distr to start (some are only required when a related feature is enabled). Durations use Go’s duration syntax (e.g. `5s`, `10m`, `24h`) and cron values use standard cron syntax (e.g. `0 * * * *`). ## General | Variable | Required | Default | Description | | ------------------------------------- | -------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `DATABASE_URL` | yes | — | PostgreSQL connection string (e.g. `postgres://user:pass@host:5432/distr`). | | `DATABASE_MAX_CONNS` | no | — | Overrides the maximum number of connections in the pgx pool. | | `JWT_SECRET` | yes | — | Base64-encoded secret every token is signed with, see [Security & Encryption](/docs/self-hosting/security#jwt-signing-secret). Generate with `openssl rand -base64 32`. | | `DATABASE_ENCRYPTION_KEY` | yes | — | Base64-encoded key that sensitive database columns are encrypted with, see [Security & Encryption](/docs/self-hosting/security#database-encryption). | | `DATABASE_ENCRYPTION_MIGRATE_ON_BOOT` | no | `false` | Encrypt values that are still stored in plaintext during startup. Single instance deployments only. | | `DISTR_HOST` | yes | — | Base URL of your Distr instance. Its scheme is used for every link, callback URL and email. | | `DISTR_ENV` | no | — | Path to a dotenv file to load on startup (a matching `.secret` file is also loaded if present). | | `REGISTRATION` | no | `enabled` | Sign-up mode, see below: `enabled`, `hidden` or `disabled`. | | `BLOCKED_EMAIL_DOMAINS` | no | — | Comma-separated email domains that cannot sign up, log in or reset a password, see [Blocklists](#blocklists). | | `BLOCKED_IPS` | no | — | Comma-separated IP addresses and CIDR ranges that cannot sign up, log in or reset a password, see [Blocklists](#blocklists). | | `USER_EMAIL_VERIFICATION_REQUIRED` | no | `true` | Whether new users must verify their email address before signing in. | | `SERVER_SHUTDOWN_DELAY_DURATION` | no | — | Delay between receiving a shutdown signal and stopping the server (useful for rolling deploys). | | `ENABLE_QUERY_LOGGING` | no | `false` | Logs all database queries. Intended for debugging only. | | `MAINTENANCE_MODE` | no | `false` | Answers every API and registry request with 503, see below. The frontend keeps being served. | | `SUPPORT_EMAIL` | no | — | Address users can contact for help, offered as a `mailto:` link where the frontend mentions support. Unset means support is mentioned without a link. | | `REGISTRATION_LEGAL_TEXT` | no | — | Markdown shown below the sign-up buttons on the registration page, e.g. links to your terms. Links open in a new tab. | ### Sign-up modes `REGISTRATION` accepts three values: * `enabled`: the login page links to the registration page and anyone can sign up. * `hidden`: the link is removed from the login page, but the registration page stays reachable at `/register` and sign-ups still succeed. Use it when you want to hand out the registration URL yourself instead of offering it to every visitor. * `disabled`: sign-up is rejected, both on `/register` and for OIDC logins with an unknown email address. Existing users can still sign in, and new users can still be added through an invitation. ### Blocklists `BLOCKED_EMAIL_DOMAINS` (e.g. `example.com,spam.io`) refuses registration, password login, password resets, invitations, email changes and login through the built-in OIDC providers for addresses of a listed domain or any of its subdomains, so `example.com` also covers `mail.example.com`. Matching ignores case. Organizations’ own OIDC providers are not affected. `BLOCKED_IPS` (e.g. `203.0.113.7,198.51.100.0/24,2001:db8::/32`) refuses every request to the sign-up, login and password reset endpoints whose client IP is a listed address or lies in a listed range. Behind a reverse proxy, the client IP is the rightmost entry of the `X-Forwarded-For` header. Both answer with `403 Forbidden`, except a blocked email domain on a built-in OIDC login, which redirects back to the login page and shows the reason there. ### Maintenance mode `MAINTENANCE_MODE=true` announces planned downtime instead of stopping the instance. Distr keeps serving the frontend, but answers every API request, including the ones from controllers, and every request to the OCI registry with `503 Service Unavailable`, so that nothing reaches the database while you work on it. The frontend picks that up and shows a maintenance page that reconnects on its own once the instance is back. The Kubernetes probes target `/`, which keeps being served, so the pod stays in its service, while `/ready` reports `503` for the whole maintenance window. ## Key Management Service Distr unwraps `JWT_SECRET`, `DATABASE_ENCRYPTION_KEY` and `LICENSE_KEY_PRIVATE_KEY` with AWS KMS or GCP Cloud KMS during startup, so that no key material is kept in your configuration. See [Security & Encryption](/docs/self-hosting/security#key-management-service) for details. | Variable | Required | Default | Description | | ------------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | | `KMS_AWS_KEY_ID` | for AWS | — | Key ARN, key id or `alias/` of the AWS KMS key. Setting it selects AWS KMS. | | `KMS_AWS_REGION` | no | — | Region of that key. Defaults to the region of `KMS_AWS_KEY_ID` when it is an ARN, then to the AWS SDK’s own resolution. | | `KMS_AWS_ENDPOINT` | no | — | Overrides the AWS KMS endpoint. Intended for testing against a local stand-in. | | `KMS_GCP_KEY_NAME` | for GCP | — | Full resource name of the Cloud KMS key (`projects/…/locations/…/keyRings/…/cryptoKeys/…`). Setting it selects Cloud KMS. | ## Tokens & Sessions | Variable | Required | Default | Description | | ------------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- | | `INVITE_TOKEN_VALID_DURATION` | no | `24h` | How long user invite links remain valid. | | `RESET_TOKEN_VALID_DURATION` | no | `1h` | How long password reset links remain valid. | | `CONTROLLER_TOKEN_MAX_VALID_DURATION` | no | `24h` | Maximum validity of a controller access token before it is refreshed. Replaces the deprecated `AGENT_TOKEN_MAX_VALID_DURATION`. | ## Bot Protection Registrations can optionally be protected with a [Cloudflare Turnstile](https://www.cloudflare.com/products/turnstile/) widget, which blocks automated sign-ups without asking users to solve a puzzle. It is disabled unless **both** variables below are set: the site key renders the widget in the browser and the secret verifies its token on the server, so a half-configured widget could only ever reject valid registrations. Distr logs a warning and stays unprotected when just one of them is present. Create a widget in the Cloudflare dashboard under **Turnstile**, add the hostname of your instance to it and copy both keys. Turnstile does not require your instance to be proxied through Cloudflare. Because a widget only accepts challenges from its configured hostnames, registrations made through an organization’s custom app domain do not show the widget and are not verified; they remain subject to the rate limits of the authentication endpoints. | Variable | Required | Default | Description | | -------------------- | ----------------------- | ------- | ---------------------------------------------------------------------------------- | | `TURNSTILE_SITE_KEY` | if `TURNSTILE_SECRET` | — | Public site key of the Turnstile widget, rendered on the registration form. | | `TURNSTILE_SECRET` | if `TURNSTILE_SITE_KEY` | — | Secret key used to verify tokens with Cloudflare’s siteverify API. Keep it secret. | ## Controllers Distr still reads every controller variable under its deprecated `AGENT_*` name when the new one is unset, and logs a warning on startup for each one it found that way. | Variable | Required | Default | Description | | ----------------------------- | -------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `CONTROLLER_HOST` | no | — | Host (and optional port, no scheme) controllers and connect commands reach this instance at, taking precedence over an organization’s custom app domain. Its scheme is taken from `DISTR_HOST`. Unset, controllers use the organization’s custom app domain if it has one and `DISTR_HOST` otherwise. Replaces the deprecated `AGENT_HOST`. | | `CONTROLLER_INTERVAL` | no | `5s` | Interval at which controllers poll Distr for updates. Replaces the deprecated `AGENT_INTERVAL`. | | `CONTROLLER_DOCKER_CONFIG` | no | — | Base64-encoded Docker config JSON provided to Docker controllers for registry authentication. Replaces the deprecated `AGENT_DOCKER_CONFIG`. | | `CONTROLLER_IMAGE_REPOSITORY` | no | `ghcr.io/distr-sh/distr` | Registry host and optional path the controller images (`docker-controller`, `kubernetes-controller` and `docker-autoheal`) are pulled from, e.g. `registry.distr.example.com/distr` for the Distr registry. The image names and tags cannot be changed, so the registry has to host them under the same names, either publicly or with access set up on every deployment target. If the host is `REGISTRY_HOST`, organizations with a custom registry domain pull the images through that domain with the same path, e.g. `registry.vendor.com/distr`. An organization can override it in its general settings. | ## Mailer Email sending is disabled unless `MAILER_TYPE` is set. `MAILER_SMTP_*` values only apply when `MAILER_TYPE=smtp`. | Variable | Required | Default | Description | | --------------------------------- | ----------------- | ------- | ------------------------------------------------------------------------------------------------- | | `MAILER_TYPE` | no | — | Mailer backend: `smtp`, `ses` or empty (disabled). | | `MAILER_FROM_ADDRESS` | if mailer enabled | — | Sender address used for outgoing emails. | | `MAILER_SMTP_HOST` | no | — | SMTP server hostname. | | `MAILER_SMTP_PORT` | if `smtp` | — | SMTP server port. | | `MAILER_SMTP_USERNAME` | no | — | SMTP username. | | `MAILER_SMTP_PASSWORD` | no | — | SMTP password. | | `MAILER_SMTP_IMPLICIT_TLS` | no | `false` | Use implicit TLS instead of STARTTLS (typically required on port 465). | | `NOTIFICATION_EMAIL_HOURLY_QUOTA` | no | `120` | Max status/metrics notification emails sent to a single address per hour. `0` disables the limit. | ## OCI Registry Registry variables are only read when `REGISTRY_ENABLED=true`. See [Registry Configuration](/docs/registry/configuration/) for a feature overview. | Variable | Required | Default | Description | | ------------------------------------------ | ------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `REGISTRY_ENABLED` | no | `false` | Enables the built-in OCI-compatible artifact registry. | | `REGISTRY_HOST` | if registry enabled | — | Host (and optional port) clients use to reach the registry. Clients are sent to it with the scheme of `DISTR_HOST` to authenticate, so the registry has to be served with the same scheme as Distr. | | `REGISTRY_S3_BUCKET` | if registry enabled | — | S3 bucket used to store registry blobs. | | `REGISTRY_S3_REGION` | if registry enabled | — | S3 region of the bucket. | | `REGISTRY_S3_CREATE_BUCKET` | no | `false` | Creates the bucket on startup (requires `s3:CreateBucket`). | | `REGISTRY_S3_ENDPOINT` | no | — | Custom S3 endpoint (for MinIO or other S3-compatible storage). | | `REGISTRY_S3_ACCESS_KEY_ID` | no | — | S3 access key ID (falls back to the default AWS credential chain if unset). | | `REGISTRY_S3_SECRET_ACCESS_KEY` | no | — | S3 secret access key. | | `REGISTRY_S3_USE_PATH_STYLE` | no | `false` | Use path-style bucket addressing (required by most non-AWS S3 implementations). | | `REGISTRY_S3_ALLOW_REDIRECT` | no | `true` | Allow redirecting blob downloads directly to S3. | | `REGISTRY_S3_REQUEST_CHECKSUM_CALCULATION` | no | `false` | Only calculate request checksums when required (compatibility with some backends). | | `REGISTRY_S3_RESPONSE_CHECKSUM_VALIDATION` | no | `false` | Only validate response checksums when required. | | `REGISTRY_RESIGN_FOR_GCP` | no | `false` | Re-sign requests for Google Cloud Storage compatibility. | | `REGISTRY_SCRATCH_DIR` | no | — | Directory used for temporary files during uploads. | | `ARTIFACT_TAGS_DEFAULT_LIMIT_PER_ORG` | no | `0` | Default maximum number of artifact tags per organization. `0` means unlimited. | | `REGISTRY_UPSTREAM_SYNC_CRON` | no | — | Cron schedule for syncing tags from upstream registries (pull-through cache). | | `REGISTRY_UPSTREAM_SYNC_TIMEOUT` | no | `10m` | Timeout for a single upstream sync run. | | `REGISTRY_UPSTREAM_BLOB_FETCH_TIMEOUT` | no | `1h` | Timeout for fetching and storing a single blob from an upstream registry on pull. | ### Anonymous pull rate limits These limit what a single client IP address may pull from [public artifacts](/docs/registry/#public-artifacts) without credentials. Authenticated pulls are not rate limited. A value of `0` disables the limit it stands for. The limits are counted per Distr replica and in memory, so they reset on a rollout and a client spread across replicas may exceed them by up to a factor of the replica count. | Variable | Required | Default | Description | | --------------------------------------------------- | -------- | ------- | ------------------------------------------------------------ | | `REGISTRY_ANONYMOUS_MANIFEST_RATE_LIMIT_PER_MINUTE` | no | `10` | Anonymous manifest and tag list requests per IP, per minute. | | `REGISTRY_ANONYMOUS_MANIFEST_RATE_LIMIT_PER_HOUR` | no | `30` | Anonymous manifest and tag list requests per IP, per hour. | | `REGISTRY_ANONYMOUS_BLOB_RATE_LIMIT_PER_MINUTE` | no | `60` | Anonymous blob requests per IP, per minute. | | `REGISTRY_ANONYMOUS_BLOB_RATE_LIMIT_PER_HOUR` | no | `300` | Anonymous blob requests per IP, per hour. | ## Custom Domains Custom domain self-service lets vendor organizations serve Distr under their own domains. It requires an edge proxy with on-demand TLS (e.g. Caddy, included in the Helm chart) in front of Distr. The feature is only offered in the UI when `CUSTOM_DOMAIN_TARGET` is set. A domain is only used for links, mails, controller manifests and registry URLs once a CNAME check has found it to point at the CNAME target; until then the organization keeps the default host. The check runs when a domain is registered, can be triggered from the organization settings and needs to be [scheduled](/docs/self-hosting/maintenance#custom-domain-verification) so that domains recover on their own once a record is fixed. Serving requests on a domain does not depend on the check. | Variable | Required | Default | Description | | ------------------------------------------ | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- | | `CUSTOM_DOMAIN_TARGET` | no | — | Hostname customers point every custom domain’s CNAME record at (e.g. `whitelabel.distr.sh`). Enables custom domain self-service. | | `CUSTOM_DOMAIN_VERIFICATION_CRON` | no | — | Cron schedule of the built-in domain verification job. If unset, no verification is scheduled in Distr. | | `CUSTOM_DOMAIN_VERIFICATION_TIMEOUT` | no | `4m` | Timeout for a single verification run. Must be greater than `0`. | | `CUSTOM_DOMAIN_VERIFICATION_REFRESH_AFTER` | no | `12h` | How long a verified domain is left alone before it is checked again. Failing domains are checked on every run. | | `INTERNAL_SERVER_ADDR` | no | `:8085` | Listen address of the internal server exposing the Caddy on-demand TLS ask endpoint. Never expose it outside the cluster. | ## Support Bundles | Variable | Required | Default | Description | | ----------------------------------- | -------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SUPPORT_BUNDLE_RESOURCE_MAX_BYTES` | no | `1048576` | Maximum size of a single resource collected by the support bundle collect script, e.g. the logs of one container or the output of one script. | | `SUPPORT_BUNDLE_LOG_TAIL_LINES` | no | `1000` | Number of container log lines collected per container. The most recent lines are kept, and `SUPPORT_BUNDLE_RESOURCE_MAX_BYTES` still applies on top. | | `SUPPORT_BUNDLE_SCRIPT_TIMEOUT` | no | `1m` | How long a single custom script may run on the customer’s host before the collect script stops it. Must be greater than `0`. | | `SUPPORT_COLLECTOR_DOWNLOAD_URL` | no | — | URL the Kubernetes collect script downloads the support collector from, in place of the GitHub release of this Distr version. It has to serve the release assets `support-collector--.tar.gz` and `support-collector-checksums.txt` under their names, e.g. a mirror for customers that cannot reach GitHub. | ## Log Processing (Loki) Deployment and deployment target log records are stored in [Grafana Loki](https://grafana.com/oss/loki/). All shipped deployment methods (Docker Compose and the Helm chart) include a preconfigured Loki instance with a time-based retention of 30 days. Log retention is managed entirely by the Loki configuration (`limits_config.retention_period`). | Variable | Required | Default | Description | | -------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------- | | `LOKI_URL` | yes | — | Base URL of the Loki instance, e.g. `http://loki:3100`. | | `LOKI_BEARER_TOKEN` | no | — | Bearer token for authenticating against Loki. | | `LOKI_BASIC_AUTH_USERNAME` | no | — | Username for basic authentication against Loki. Ignored when `LOKI_BEARER_TOKEN` is set. | | `LOKI_BASIC_AUTH_PASSWORD` | no | — | Password for basic authentication against Loki. Only used when `LOKI_BASIC_AUTH_USERNAME` is set. | | `LOKI_REQUEST_TIMEOUT` | no | `30s` | Timeout for a single Loki HTTP request. | ## Scheduled Jobs & Retention These control the built-in job scheduler and retention limits. See [Maintenance Jobs](/docs/self-hosting/maintenance/) for details and Kubernetes CronJob alternatives. If a `*_CRON` variable is unset, the corresponding job is not scheduled. For the timeout variables listed below, `0` means no timeout. | Variable | Required | Default | Description | | ------------------------------------------- | -------- | ------- | --------------------------------------------------------------------------- | | `METRICS_ENTRIES_MAX_AGE` | no | — | Max age of deployment target metrics entries before cleanup removes them. | | `CLEANUP_DEPLOYMENT_TARGET_METRICS_CRON` | no | — | Cron schedule for pruning deployment target metrics. | | `CLEANUP_DEPLOYMENT_TARGET_METRICS_TIMEOUT` | no | `0` | Timeout for the metrics cleanup run. | | `CLEANUP_OIDC_STATE_CRON` | no | — | Cron schedule for pruning expired OIDC state entries. | | `CLEANUP_OIDC_STATE_CRON_TIMEOUT` | no | `0` | Timeout for the OIDC state cleanup run. | | `CLEANUP_ARTIFACT_BLOB_CRON` | no | — | Cron schedule for pruning unreferenced registry blobs from S3. | | `CLEANUP_ARTIFACT_BLOB_TIMEOUT` | no | `0` | Timeout for the artifact blob cleanup run. | | `CLEANUP_ARTIFACT_BLOB_MIN_AGE` | no | `24h` | Minimum age of an unreferenced blob before it is eligible for deletion. | | `CLEANUP_ORGANIZATION_CRON` | no | — | Cron schedule for permanently deleting soft-deleted organizations. | | `CLEANUP_ORGANIZATION_TIMEOUT` | no | `0` | Timeout for the organization cleanup run. | | `CLEANUP_ORGANIZATION_MIN_AGE` | no | `720h` | Retention period before a soft-deleted organization is permanently deleted. | | `CLEANUP_USER_ACCOUNT_CRON` | no | — | Cron schedule for deleting user accounts that belong to no organization. | | `CLEANUP_USER_ACCOUNT_TIMEOUT` | no | `0` | Timeout for the user account cleanup run. | | `CLEANUP_USER_ACCOUNT_MIN_AGE` | no | `720h` | Time since the last login, or creation if never logged in, before deletion. | | `CLEANUP_FILE_CRON` | no | — | Cron schedule for deleting files that nothing references any more. | | `CLEANUP_FILE_TIMEOUT` | no | `0` | Timeout for the file cleanup run. | | `CLEANUP_FILE_MIN_AGE` | no | `24h` | Minimum age of an unreferenced file before it is deleted. | | `DEPLOYMENT_STATUS_NOTIFICATION_CRON` | no | — | Cron schedule for sending deployment status notification emails. | | `DEPLOYMENT_STATUS_NOTIFICATION_TIMEOUT` | no | `0` | Timeout for the deployment status notification run. | ## OIDC Authentication Each provider is enabled independently and its credentials are only required when it is enabled. | Variable | Required | Default | Description | | ----------------------------------------------- | ------------------ | ------- | ---------------------------------------------------------------------------------- | | `OIDC_GITHUB_ENABLED` | no | `false` | Enables GitHub sign-in. | | `OIDC_GITHUB_CLIENT_ID` | if GitHub enabled | — | GitHub OAuth App client ID. | | `OIDC_GITHUB_CLIENT_SECRET` | if GitHub enabled | — | GitHub OAuth App client secret. | | `OIDC_GOOGLE_ENABLED` | no | `false` | Enables Google sign-in. | | `OIDC_GOOGLE_CLIENT_ID` | if Google enabled | — | Google OAuth 2.0 client ID. | | `OIDC_GOOGLE_CLIENT_SECRET` | if Google enabled | — | Google OAuth 2.0 client secret. | | `OIDC_MICROSOFT_ENABLED` | no | `false` | Enables Microsoft (Entra ID) sign-in. | | `OIDC_MICROSOFT_CLIENT_ID` | if MS enabled | — | Entra ID application (client) ID. | | `OIDC_MICROSOFT_CLIENT_SECRET` | if MS enabled | — | Entra ID client secret. | | `OIDC_MICROSOFT_TENANT_ID` | if MS enabled | — | Directory (tenant) ID, or `common`/`organizations`/`consumers`. | | `OIDC_GENERIC_ENABLED` | no | `false` | Enables a generic OIDC provider. | | `OIDC_GENERIC_CLIENT_ID` | if generic enabled | — | Client ID issued by the provider. | | `OIDC_GENERIC_CLIENT_SECRET` | if generic enabled | — | Client secret issued by the provider. | | `OIDC_GENERIC_ISSUER` | if generic enabled | — | Issuer URL exposing `/.well-known/openid-configuration`. | | `OIDC_GENERIC_SCOPES` | if generic enabled | — | Comma- or space-separated scopes (e.g. `email,profile`); `openid` is always added. | | `OIDC_GENERIC_PKCE_ENABLED` | no | `false` | Enables PKCE (`S256`) for the generic provider. | | `WELLKNOWN_MICROSOFT_IDENTITY_ASSOCIATION_JSON` | no | — | Base64-encoded JSON served at `/.well-known/microsoft-identity-association.json`. | Every provider needs a callback URL registered at the identity provider. It is built from `DISTR_HOST` and must match exactly, including the scheme: | Provider | Callback URL | Where to register it | | -------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | Google | `{DISTR_HOST}/api/v1/auth/oidc/google/callback` | [Google Cloud Console](https://console.cloud.google.com/apis/credentials), as an authorized redirect URI of a **Web application** client | | GitHub | `{DISTR_HOST}/api/v1/auth/oidc/github/callback` | [GitHub OAuth Apps](https://github.com/settings/developers), as the **Authorization callback URL** | | Microsoft (Entra ID) | `{DISTR_HOST}/api/v1/auth/oidc/microsoft/callback` | [Microsoft Entra admin center](https://entra.microsoft.com/), as a **Web** redirect URI of an app registration | | Generic | `{DISTR_HOST}/api/v1/auth/oidc/generic/callback` | at your provider, which must expose a `/.well-known/openid-configuration` document | With GitHub, only the primary and verified email address is accepted, so a user whose primary address is unverified there cannot sign in. The first sign-in connects the identity the provider reports (its issuer and the `sub` claim, or the numeric user ID for GitHub) to the Distr account, and every later sign-in is matched on that identity rather than on the email address, so the account survives an email change at the provider. Users see and disconnect their connections under **User Settings → Connected identities**. A sign-in started on the sign-up page creates an account and an organization for an unknown email address; invite the user beforehand to place them in an existing organization instead, or set `REGISTRATION=disabled` (see [Sign-up modes](#sign-up-modes)) to reject unknown addresses. Vendor organizations on the Business plan can also configure their own providers in the UI, which requires no instance configuration. Those issuer URLs are entered by organization administrators and fetched by Distr, so they must be `https` and must not resolve to a private network address. Both restrictions are lifted when `DISTR_HOST` is an `http` URL, so that an instance running locally can be developed against an identity provider next to it. An operator whose identity provider only exists inside their own network configures it as the instance-wide generic provider above instead. ## Observability Tracing and error reporting via Sentry and OpenTelemetry. Sampler variables accept `always_on`, `always_off`, `traceidratio`, `parentbased_always_on`, `parentbased_always_off` or `parentbased_traceidratio`. | Variable | Required | Default | Description | | ------------------------------ | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------- | | `SENTRY_DSN` | no | — | Sentry DSN for backend error reporting. | | `SENTRY_DEBUG` | no | `false` | Enables Sentry debug logging. | | `SENTRY_ENVIRONMENT` | no | — | Environment name reported to Sentry (e.g. `production`). | | `OTEL_EXPORTER_SENTRY_ENABLED` | no | `false` | Exports OpenTelemetry traces to Sentry. | | `OTEL_EXPORTER_OTLP_ENABLED` | no | `false` | Exports OpenTelemetry traces via OTLP (configured with standard `OTEL_*` variables). | | `OTEL_CONTROLLER_SAMPLER` | no | — | Trace sampler used for controller requests. Replaces the deprecated `OTEL_AGENT_SAMPLER`. | | `OTEL_CONTROLLER_SAMPLER_ARG` | no | `1.0` | Argument for the controller sampler (e.g. ratio for `traceidratio`). Replaces the deprecated `OTEL_AGENT_SAMPLER_ARG`. | | `OTEL_REGISTRY_SAMPLER` | no | — | Trace sampler used for registry requests. | | `OTEL_REGISTRY_SAMPLER_ARG` | no | `1.0` | Argument for the registry sampler. | ## Prometheus Metrics Exposes an internal Prometheus metrics endpoint. See [Prometheus Integration](/docs/self-hosting/prometheus/) for details. | Variable | Required | Default | Description | | ----------------------- | -------- | ------- | ------------------------------------------------------------------------------ | | `METRICS_ENABLED` | no | `false` | Enables the Prometheus metrics endpoint. | | `METRICS_ADDR` | no | `:3000` | Address the metrics endpoint listens on. | | `METRICS_BEARER_TOKEN` | no | — | Bearer token required to scrape the metrics endpoint, if set. | | `METRICS_PPROF_ENABLED` | no | `false` | Serves Go runtime profiles under `/debug/pprof/` next to the metrics endpoint. | ## Frontend These values are injected into the compiled frontend at runtime. | Variable | Required | Default | Description | | ----------------------------------- | -------- | ------- | ------------------------------------------------- | | `FRONTEND_SENTRY_DSN` | no | — | Sentry DSN for frontend error reporting. | | `FRONTEND_SENTRY_TRACE_SAMPLE_RATE` | no | — | Frontend trace sample rate (`0.0`–`1.0`). | | `FRONTEND_POSTHOG_TOKEN` | no | — | PostHog project API token for frontend analytics. | | `FRONTEND_POSTHOG_API_HOST` | no | — | PostHog API host. | | `FRONTEND_POSTHOG_UI_HOST` | no | — | PostHog UI host. | ## Licensing & Billing Options relevant to Distr Pro and hosted billing. | Variable | Required | Default | Description | | ------------------------------------------ | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `LICENSE_KEY` | no | — | Distr license key unlocking the plan it was issued for. | | `LICENSE_KEY_PRIVATE_KEY` | no | — | PEM-encoded private key used to sign customer license keys, see [Security & Encryption](/docs/self-hosting/security#license-signing-key). | | `STRIPE_API_KEY` | no | — | Stripe API key for billing integration. | | `STRIPE_WEBHOOK_SECRET` | no | — | Secret used to verify incoming Stripe webhooks. | | `STRIPE_WEBHOOK_VERSION_MISMATCH_BEHAVIOR` | no | `error` | Behavior on Stripe API version mismatch: `error` or `ignore`. |
# Docker Compose
> Run Distr with Docker Compose, from an all-in-one stack for trying it out locally to production reference stacks for AWS and GCP with managed PostgreSQL and object storage.
The easiest way to host your own Distr instance is Docker Compose. You need Docker Engine 29 or later. The `quickstart` stack runs on any current Docker Compose plugin, while the four production stacks need version 5.3 or later for their `pre_start` hooks. All five Compose stacks under [`deploy/docker`](https://github.com/distr-sh/distr/tree/main/deploy/docker) run Distr and [Loki](/docs/self-hosting/configuration/#log-processing-loki) for log processing. They differ in the edition they run and in what they bring along: | Example | Edition | Includes | Intended for | | -------------------------------------------------------------------------------------------- | ---------- | ------------------------------------------------ | -------------------------------------- | | [`quickstart`](https://github.com/distr-sh/distr/tree/main/deploy/docker/quickstart) | Community | PostgreSQL, RustFS object storage | Trying Distr out locally | | [`community`](https://github.com/distr-sh/distr/tree/main/deploy/docker/community) | Community | PostgreSQL, RustFS, Caddy with https | Community production on a generic VM | | [`enterprise`](https://github.com/distr-sh/distr/tree/main/deploy/docker/enterprise) | Enterprise | PostgreSQL, RustFS, Caddy with https | Enterprise production on a generic VM | | [`enterprise-aws`](https://github.com/distr-sh/distr/tree/main/deploy/docker/enterprise-aws) | Enterprise | Caddy with https (database and S3 are external) | Stateless enterprise production on AWS | | [`enterprise-gcp`](https://github.com/distr-sh/distr/tree/main/deploy/docker/enterprise-gcp) | Enterprise | Caddy with https (database and GCS are external) | Stateless enterprise production on GCP | ## Trying it out locally First, download and unpack the Distr Docker Compose deployment manifest from the latest release:
```shell
mkdir distr && cd distr && curl -fsSL https://github.com/distr-sh/distr/releases/latest/download/deploy-quickstart.tar | tar -x
```
This command creates a new directory called `distr` containing two files: `docker-compose.yaml` and `.env`. For a basic setup, you don’t have to modify `docker-compose.yaml`, but please open `.env` in your favorite text editor and change the values of `POSTGRES_PASSWORD`, `JWT_SECRET`, `DATABASE_ENCRYPTION_KEY` and `RUSTFS_SECRET_KEY`. Feel free to also change the value of `DISTR_HOST`, if you intend to make your instance publicly available. Once you are happy with your configuration, simply start Distr using Docker Compose:
```shell
docker compose up -d --remove-orphans
```
Open [`http://localhost:8080`](http://localhost:8080) to access Distr. Use the same command to apply later changes. `--remove-orphans` drops containers that the stack no longer defines, which a plain `up` would leave running and holding on to their published ports. ## Running in production In production, run PostgreSQL and the object storage as managed services so that the Compose stack stays stateless. That is what the `enterprise-aws` and `enterprise-gcp` stacks do: they run `distr`, `loki` and `caddy` in Docker and nothing else. All of their configuration lives in the `.env` file next to the Compose file. Whichever cloud you use, you need the same pieces: * A VM with at least 2 CPUs and 4 GB RAM (see [System Requirements](/docs/self-hosting/system-requirements/)). * Two public hostnames, one for the app and one for the registry, both pointing at the VM. Caddy obtains and renews their certificates via ACME, so TCP `80` and `443` have to be reachable from the internet. * A managed PostgreSQL 18+ instance the VM can reach over a private network, with TLS enforced. We test with 2 CPUs and 2 GB RAM. * Two buckets, one for the registry blobs and one for Loki’s log chunks. * Disk space for the scratch volume, where the registry buffers layer uploads instead of holding them in memory. Every stack mounts one into Distr, so give the VM room for the layers you expect to be pushed at the same time. * A `JWT_SECRET` and a `DATABASE_ENCRYPTION_KEY`, each from `openssl rand -base64 32`, and a `LICENSE_KEY` if you run a paid plan. Back the encryption key up somewhere other than the database, since it is what makes the encrypted columns readable. On a single VM, keep running the [maintenance jobs](/docs/self-hosting/maintenance/) inside the Distr process through the `*_CRON` variables in `.env`. Switch them off and trigger the `cleanup` and `maintenance` subcommands from outside only once you run more than one Distr replica, since every replica would otherwise run every job. ### Distr Enterprise The `quickstart` and `community` stacks run the Community Edition image (`ghcr.io/distr-sh/distr-ce`), which is free and needs no license. The three enterprise stacks run the Enterprise image `registry.distr.sh/enterprise/distr-ee` instead. It comes from our own registry, so run `docker login registry.distr.sh` with the credentials you received from us before you start the stack. ### Distr Enterprise on AWS We recommend [Amazon Lightsail](https://aws.amazon.com/lightsail/) for the VM. It bundles the instance, a static IP, a DNS zone, a firewall and optional daily snapshots at a fixed monthly price: 1. Create a Linux instance with a plan that has at least 2 vCPUs and 4 GB RAM, and install Docker with the Compose plugin. 2. Attach a static IP and point both hostnames (app and registry) at it, either in a Lightsail DNS zone or at your registrar. 3. Open TCP `80` and `443` in the instance firewall. A Lightsail managed database is the simplest choice. It sits in the same Lightsail VPC as the instance, is not publicly reachable unless you ask for it and takes daily backups. Pick RDS for PostgreSQL when you need Multi-AZ failover, larger instance classes or a read replica, which Distr can use via `DATABASE_READONLY_URL`. RDS instances run in the region’s default VPC, so a Lightsail instance only reaches them once you enable VPC peering under Account → Advanced in the Lightsail console. Neither option creates the database Distr expects, so connect to the new instance from the VM and create it yourself:
```shell
psql "postgres://dbmasteruser:@ls-abc123.abcdefg.us-east-2.rds.amazonaws.com:5432/postgres?sslmode=require" \
-c 'CREATE DATABASE distr'
```
Create the two buckets in the region of the VM: * Keep them private. Distr always reaches the buckets with credentials, and pull traffic that is offloaded to the object storage uses short-lived pre-signed URLs. * Leave object versioning off. The [artifact blob cleanup job](/docs/self-hosting/maintenance/) reclaims storage by deleting unreferenced blobs, and versioning would keep them around as noncurrent versions. * On plain S3, add a lifecycle rule that aborts incomplete multipart uploads after a day. The registry uploads large layers as multipart uploads, and an interrupted push leaves parts behind that you keep paying for. Buckets created in Lightsail come with their own access keys, listed under Permissions on the bucket, so there is no IAM user or bucket policy to manage. Copy one key pair per bucket into the matching `REGISTRY_S3_*` and `LOKI_S3_*` variables. Neither of them needs an endpoint, since the regional one follows from `REGISTRY_S3_REGION` and `LOKI_S3_REGION`. Do not add `REGISTRY_S3_ENDPOINT` back with an empty value, which Distr reads as a custom endpoint and the AWS SDK then rejects. If you do set one, use the plain regional endpoint (`https://s3.us-east-2.amazonaws.com`) without the bucket in it. The relevant part of `deploy/docker/enterprise-aws/.env` then looks like this:
```dotenv
LICENSE_KEY="eyJhbGciOi..."
DISTR_APP_HOSTNAME="distr.example.com"
DISTR_REGISTRY_HOSTNAME="pkg.example.com"
CADDY_ACME_EMAIL="ops@example.com"
DISTR_HOST="https://${DISTR_APP_HOSTNAME}"
JWT_SECRET="Zm9vYmFyYmF6..."
DATABASE_ENCRYPTION_KEY="cXV1eGNvcmdl..."
DATABASE_URL="postgres://distr:@distr-db.abc123.us-east-2.rds.amazonaws.com:5432/distr?sslmode=require"
REGISTRY_ENABLED=true
REGISTRY_HOST="${DISTR_REGISTRY_HOSTNAME}"
REGISTRY_S3_BUCKET="example-distr-registry"
REGISTRY_S3_REGION="us-east-2"
REGISTRY_S3_ACCESS_KEY_ID="AKIA..."
REGISTRY_S3_SECRET_ACCESS_KEY="..."
REGISTRY_S3_USE_PATH_STYLE=false
REGISTRY_S3_ALLOW_REDIRECT=true
REGISTRY_SCRATCH_DIR="/scratch"
LOKI_URL="http://loki:3100"
LOKI_S3_BUCKET="example-distr-logs"
LOKI_S3_REGION="us-east-2"
LOKI_S3_ENDPOINT=""
LOKI_S3_ACCESS_KEY_ID="AKIA..."
LOKI_S3_SECRET_ACCESS_KEY="..."
LOKI_S3_USE_PATH_STYLE=false
```
`REGISTRY_S3_ALLOW_REDIRECT=true` answers layer downloads with a redirect to a pre-signed S3 URL, which keeps pull bandwidth off Distr. Turn it off if your clients cannot reach S3 directly. ### Distr Enterprise on GCP Use a Compute Engine instance in the same region as the buckets, `e2-medium` (2 vCPU, 4 GB) or larger, with a reserved static external IP and a firewall rule for TCP `80` and `443`. Attach a dedicated service account to the instance and grant it `roles/storage.objectAdmin` on the two buckets. For the database, use Cloud SQL for PostgreSQL with a private IP in the same VPC as the instance, plus automated backups and point-in-time recovery. The stack talks to Google Cloud Storage in two different ways, one per bucket: * The registry bucket goes through the S3 interoperability (XML) API, because the OCI registry speaks S3. Create an HMAC key for the service account under Cloud Storage → Settings → Interoperability, use it as `REGISTRY_S3_ACCESS_KEY_ID` and `REGISTRY_S3_SECRET_ACCESS_KEY`, and point `REGISTRY_S3_ENDPOINT` at `https://storage.googleapis.com` with path-style addressing. The interoperability API also needs the three compatibility settings the shipped `.env` contains (`REGISTRY_S3_REQUEST_CHECKSUM_CALCULATION`, `REGISTRY_S3_RESPONSE_CHECKSUM_VALIDATION` and `REGISTRY_RESIGN_FOR_GCP`). * The logs bucket goes through the native GCS API, so Loki only needs its name in `LOKI_GCS_BUCKET_NAME`. The Compose stack passes no storage credentials to Loki. Loki falls back to Google’s application default credentials, which on Compute Engine are the credentials of the service account attached to the instance, fetched from the metadata server (see Loki’s [storage configuration](https://grafana.com/docs/loki/latest/configure/storage/)). Whatever you grant that service account is therefore what Loki can do with the logs bucket, and on an instance without one it cannot write any chunks. Create both buckets with uniform bucket-level access and public access prevention, in a single region rather than multi-region, and add a lifecycle rule on the registry bucket that aborts incomplete multipart uploads. The relevant part of `deploy/docker/enterprise-gcp/.env`:
```dotenv
LICENSE_KEY="eyJhbGciOi..."
DISTR_APP_HOSTNAME="distr.example.com"
DISTR_REGISTRY_HOSTNAME="pkg.example.com"
CADDY_ACME_EMAIL="ops@example.com"
DISTR_HOST="https://${DISTR_APP_HOSTNAME}"
JWT_SECRET="Zm9vYmFyYmF6..."
DATABASE_ENCRYPTION_KEY="cXV1eGNvcmdl..."
DATABASE_URL="postgres://distr:@10.42.0.3:5432/distr?sslmode=require"
REGISTRY_ENABLED=true
REGISTRY_HOST="${DISTR_REGISTRY_HOSTNAME}"
REGISTRY_S3_BUCKET="example-distr-registry"
REGISTRY_S3_REGION="europe-west3"
REGISTRY_S3_ENDPOINT="https://storage.googleapis.com"
REGISTRY_S3_ACCESS_KEY_ID="GOOG1E..."
REGISTRY_S3_SECRET_ACCESS_KEY="..."
REGISTRY_S3_USE_PATH_STYLE=true
REGISTRY_S3_ALLOW_REDIRECT=true
REGISTRY_S3_REQUEST_CHECKSUM_CALCULATION=true
REGISTRY_S3_RESPONSE_CHECKSUM_VALIDATION=true
REGISTRY_RESIGN_FOR_GCP=true
REGISTRY_SCRATCH_DIR="/scratch"
LOKI_URL="http://loki:3100"
LOKI_GCS_BUCKET_NAME="example-distr-logs"
```
# Feature Flags
> Enable beta features and customize your Distr instance by managing feature flags in your PostgreSQL database.
Distr uses a primitive approach to feature management. As long as a feature is not generally available or we don’t think it should be activated by default, it is hidden behind a feature flag. Feature flags are just an array in the postgres database. All feature types can be found in [`types.go`](https://github.com/distr-sh/distr/blob/main/internal/types/types.go). If you want to enable a feature for an organization, you can do this by running the following command in your postgres database:
```sql
update organization set features ='{pre_post_scripts}' where id = 'your-organization-id';
```
Caution Distr Pro feature flags will be reset on application start and require the Distr Enterprise license.
# Kubernetes
> Deploy Distr in your Kubernetes cluster with our Helm chart, from a local test install with bundled PostgreSQL and RustFS to production values for EKS on AWS and GKE on GCP.
Distr is available as a [Helm chart](/glossary/helm-chart/) distributed via ghcr.io. Every setting mentioned on this page is documented in the chart’s reference [values.yaml](https://artifacthub.io/packages/helm/distr/distr?modal=values). Upgrading from an earlier chart version The top-level `hub` values key is now called `distr`, so move `hub.env`, `hub.envFrom` and `hub.scratch` to `distr.env`, `distr.envFrom` and `distr.scratch` in your values file. A value under `hub` is still read as long as the matching one under `distr` is untouched, and the chart warns about it on every install, so an unmigrated values file does not break the upgrade. The pods are also relabelled from `app.kubernetes.io/component: hub` to `distr` and the container is renamed from `hub` to `distr`. Since the Service selects on that label, it has no endpoints until the first new pod is ready, which makes this upgrade briefly interrupt traffic. Anything outside the chart that addresses the old names, such as `kubectl logs -c hub`, Kustomize patches or dashboards, has to be updated too. Complete values files for the setups below live under [`deploy/charts/distr/examples`](https://github.com/distr-sh/distr/tree/main/deploy/charts/distr/examples), one per folder, and match the [Docker Compose examples](/docs/self-hosting/docker/) of the same name. Every one of them deploys Distr and [Loki](/docs/self-hosting/configuration/#log-processing-loki) for log processing, and they differ in the edition they run and in what they bring along: | Example | Edition | Includes | Intended for | | ----------------------------------------------------------------------------------------------------------- | ---------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------- | | [`quickstart`](https://github.com/distr-sh/distr/tree/main/deploy/charts/distr/examples/quickstart) | Community | PostgreSQL, RustFS object storage | Trying Distr out on a local [minikube cluster](https://minikube.sigs.k8s.io/) | | [`community`](https://github.com/distr-sh/distr/tree/main/deploy/charts/distr/examples/community) | Community | PostgreSQL, RustFS, Ingress with cert-manager | Community production on a generic cluster | | [`enterprise`](https://github.com/distr-sh/distr/tree/main/deploy/charts/distr/examples/enterprise) | Enterprise | PostgreSQL, RustFS, Ingress with cert-manager | Enterprise production on a generic cluster | | [`enterprise-aws`](https://github.com/distr-sh/distr/tree/main/deploy/charts/distr/examples/enterprise-aws) | Enterprise | ALB Ingress (database and S3 are external) | Stateless enterprise production on EKS | | [`enterprise-gcp`](https://github.com/distr-sh/distr/tree/main/deploy/charts/distr/examples/enterprise-gcp) | Enterprise | Ingress with cert-manager (Cloud SQL and GCS are external) | Stateless enterprise production on GKE | ## Trying it out locally To install Distr in [Kubernetes](/glossary/kubernetes/) with its dependencies bundled, run:
```shell
helm upgrade --install --wait --namespace distr --create-namespace \
distr oci://ghcr.io/distr-sh/charts/distr \
--set postgresql.enabled=true --set rustfs.enabled=true
```
This deploys Distr together with PostgreSQL, the RustFS object storage and Loki, so you don’t have to modify any values to get a working instance. Both bundled dependencies keep their data in a single `ReadWriteOnce` volume each and use the default credentials from the values file, which makes them fine for a test cluster and unsuitable for production. The same install as a values file is [`examples/quickstart/values.yaml`](https://github.com/distr-sh/distr/blob/main/deploy/charts/distr/examples/quickstart/values.yaml). For a local cluster with custom domains enabled, see [`examples/quickstart/custom-domains-values.yaml`](https://github.com/distr-sh/distr/blob/main/deploy/charts/distr/examples/quickstart/custom-domains-values.yaml). ## Verifying the chart signature Every released chart version is signed with [cosign](https://docs.sigstore.dev/cosign/signing/overview/) keyless signing by the workflow that publishes it. To check a version before installing it:
```shell
cosign verify \
--certificate-identity-regexp '^https://github\.com/distr-sh/distr/\.github/workflows/build-chart\.yaml@' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
ghcr.io/distr-sh/charts/distr:
```
## Running in production For production, disable the bundled dependencies and point the chart at managed services instead. This part is the same on every cloud: * Leave `postgresql.enabled` at `false` and set `externalDatabase.existingSecret` to a secret holding the connection URI of a PostgreSQL 18+ database. The alternative, `externalDatabase.uri`, puts the URI into the release values in plain text. * Use external object storage for both the registry (`REGISTRY_S3_*` in `distr.env`) and Loki (`loki.loki.storage`). Create both buckets up front, set `REGISTRY_S3_CREATE_BUCKET` to `false` and drop the `create-loki-bucket` init container with `loki.singleBinary.initContainers: []`, which only exists to provision a bucket in the in-cluster RustFS. * Put `JWT_SECRET`, `DATABASE_ENCRYPTION_KEY`, the license key and the object storage credentials in a `secretKeyRef` or in `distr.envFrom`, not in your `distr.env` values. * Enable a scratch volume with `distr.scratch.enabled`, so the registry buffers layer uploads on disk instead of in memory. * Add an Ingress for the two hostnames the chart serves, the app and the registry. Registry pushes have no size limit, so raise or disable the request body limit of your ingress controller on the registry host. The rest of the defaults are already shaped for production: two Distr replicas with a `PodDisruptionBudget`, and the [maintenance jobs](/docs/self-hosting/maintenance/) as `CronJob`s under `cronJobs` instead of in-process cron, which is what you want as soon as more than one replica runs. Set `resources` and consider `autoscaling` based on the [System Requirements](/docs/self-hosting/system-requirements/). Without managed services next door, the [`community`](https://github.com/distr-sh/distr/blob/main/deploy/charts/distr/examples/community/values.yaml) and [`enterprise`](https://github.com/distr-sh/distr/blob/main/deploy/charts/distr/examples/enterprise/values.yaml) examples keep PostgreSQL and RustFS in the cluster and put an Ingress with a cert-manager certificate in front, which is the trade-off the self-contained Compose examples make as well. ### Distr Enterprise The chart defaults to the Community Edition image (`ghcr.io/distr-sh/distr-ce`), which is free and needs no license. Paid plans run the Enterprise image `registry.distr.sh/enterprise/distr-ee`. It comes from our own registry, so create a pull secret from the credentials you received from us and reference it in `imagePullSecrets`.
```yaml
image:
repository: registry.distr.sh/enterprise/distr-ee
imagePullSecrets:
- name: distr-registry
distr:
env:
- name: LICENSE_KEY
valueFrom:
secretKeyRef:
name: distr-license
key: licenseKey
# ... the rest of your environment
```
Keep in mind that Helm replaces the `distr.env` list rather than merging it, so every variable you need has to be in the same list. ### Distr Enterprise on AWS Run Distr on EKS, the database on RDS for PostgreSQL and both buckets on S3 in the region of the cluster. The buckets need the same setup as for the [Docker Compose example](/docs/self-hosting/docker/#distr-enterprise-on-aws): private, public access blocked, versioning off so blob cleanup can reclaim storage and a lifecycle rule that aborts incomplete multipart uploads. For access, use IRSA rather than static keys. Annotate Distr’s service account with a role that carries the S3 policy and leave the access keys unset, so the AWS SDK picks up the web identity credentials by itself. Loki needs the same on its own service account. The values file for all of it is [`examples/enterprise-aws/values.yaml`](https://github.com/distr-sh/distr/blob/main/deploy/charts/distr/examples/enterprise-aws/values.yaml), which also carries the Enterprise image and the secrets it expects. The `null` values it sets under `loki.loki.storage.s3` delete the RustFS endpoint and credentials the chart ships as defaults, which is what makes Loki fall back to the credentials of its service account. An Application Load Balancer applies no request body limit, so registry pushes work without further configuration, and [`REGISTRY_S3_ALLOW_REDIRECT`](/docs/self-hosting/configuration/#oci-registry) stays enabled so that layer downloads are offloaded to pre-signed S3 URLs. If you prefer static credentials over IRSA, drop the service account annotations and provide `REGISTRY_S3_ACCESS_KEY_ID` / `REGISTRY_S3_SECRET_ACCESS_KEY` from a secret, along with `accessKeyId` and `secretAccessKey` under `loki.loki.storage.s3`. ### Distr Enterprise on GCP Run Distr on GKE, the database on Cloud SQL for PostgreSQL with a private IP in the cluster’s VPC and both buckets on Cloud Storage in the region of the cluster. As in the Compose example, the two buckets are reached in different ways: the registry uses the S3 interoperability API with an HMAC key, while Loki uses the native GCS API and authenticates through Workload Identity. So bind a Google service account with `roles/storage.objectAdmin` on the logs bucket to Loki’s Kubernetes service account, and keep the HMAC key of a service account with access to the registry bucket in a secret. The values file for all of it is [`examples/enterprise-gcp/values.yaml`](https://github.com/distr-sh/distr/blob/main/deploy/charts/distr/examples/enterprise-gcp/values.yaml), which also carries the Enterprise image and the secrets it expects. Loki picks the object store client per schema period and for delete requests by name, so `schemaConfig` and `compactor` in that file name `gcs` as well. The chart’s defaults name `s3`, which would leave Loki looking for an S3 client that the release does not configure. For ingress, we recommend a controller you run yourself, such as Traefik, which applies no request body limit of its own. GKE’s built-in GCE ingress applies a 30 second backend response timeout, which is short enough to break the upload of a single large layer. Raising it takes a `BackendConfig` annotation on the Service, and this chart does not render one. ## Per customer custom domains and OIDC Vendor organizations on the Business plan can serve the Distr app under a separate customer portal domain per customer, each with its own OIDC provider. Serving those domains requires a proxy in front of Distr that obtains a certificate for every domain a vendor registers, so the chart ships an optional [Caddy](https://caddyserver.com/) deployment with [on-demand TLS](https://caddyserver.com/docs/automatic-https#on-demand-tls):
```yaml
distr:
env:
# DNS record your vendors point their domains at
- name: CUSTOM_DOMAIN_TARGET
value: whitelabel.example.com
caddy:
enabled: true
acmeEmail: ops@example.com
```
Point that hostname at the external address of the `-caddy` `LoadBalancer` Service. One target covers every domain a vendor registers, registry domains included, because Caddy routes registry traffic by the `/v2/` path prefix the OCI distribution API mandates rather than by hostname. Before issuing a certificate, Caddy asks Distr whether a domain is registered, using an internal Service that must never be exposed publicly. `CUSTOM_DOMAIN_TARGET` is what enables the feature in the UI, so the chart refuses to render a Caddy deployment without it. Helm replaces the `distr.env` list rather than merging it, so add the variable to the rest of your Distr environment instead of setting it on its own. Caddy stores the certificates it obtains on a persistent volume, which the chart keeps when the release is uninstalled so that a reinstall does not have to reissue a certificate for every custom domain. The default is a single replica, because Caddy instances form a cluster only when they use the same storage. Sharing storage is what lets them coordinate issuance, share certificates and solve each other’s ACME challenges. The last part is not optional behind a load balancer, which routes the certificate authority’s validation request to an arbitrary replica. To run more than one replica, give all of them the same storage in one of two ways: * Set `caddy.persistence.accessModes` to `[ReadWriteMany]` with a storage class that supports it (EFS, Filestore, Azure Files, CephFS, …), or point `caddy.persistence.existingClaim` at such a claim. * Set `caddy.storage` to a Caddyfile storage block for a distributed backend (Redis, Consul, …) and `caddy.image.repository` to an image built with that storage module, since Caddy has no runtime plugins. The chart refuses to render a `caddy.replicaCount` above 1 without either of them.
# Maintenance Jobs
> Configure automated cleanup jobs to prune metrics, logs, registry blobs, deleted organizations, orphaned user accounts and unreferenced files from your Distr database and storage.
## Database Cleanup Jobs Distr includes built-in CLI tasks for database and storage pruning to prevent unbounded growth of resources such as metrics, logs and status entries. The cleanup routine can be executed manually. One or more targets can be specified in a single invocation.
```shell
distr cleanup $CLEANUP_TARGET...
```
Available cleanup targets: | Target | Description | | ------------------------- | --------------------------------------------------------------------------------------------- | | `DeploymentTargetMetrics` | Deployment target metrics entries | | `OIDCState` | Expired OIDC state entries | | `ArtifactBlob` | Unreferenced registry blobs from S3 (requires registry to be enabled) | | `Organization` | Permanently delete soft-deleted organizations past the retention period | | `UserAccount` | Permanently delete user accounts that belong to no organization past the retention period | | `File` | Uploaded files that nothing references any more, such as logos and avatars that were replaced | For production deployments we recommend scheduling these jobs automatically, either using the built-in job scheduler for single instance deployments or using Kubernetes CronJobs for high-availability deployments. ### Automated job scheduling for Single Instance deployments If you only have one instance of Distr running (e.g., using Docker Compose), you can use the integrated job scheduling. The internal scheduling can be configured via environment variables. An example configuration file can be found on [`github.com/distr-sh/distr/deploy/docker/quickstart`](https://github.com/distr-sh/distr/blob/main/deploy/docker/quickstart/.env):
```dotenv
# Cron interval for cleaning metrics older than METRICS_ENTRIES_MAX_AGE
CLEANUP_DEPLOYMENT_TARGET_METRICS_CRON="0 * * * *"
CLEANUP_DEPLOYMENT_TARGET_METRICS_TIMEOUT="10m"
# Cron interval for cleaning expired OIDC state entries
CLEANUP_OIDC_STATE_CRON="0 * * * *"
CLEANUP_OIDC_STATE_CRON_TIMEOUT="10m"
# Cron interval for cleaning unreferenced artifact blobs from S3 (requires registry)
CLEANUP_ARTIFACT_BLOB_CRON="0 * * * *"
CLEANUP_ARTIFACT_BLOB_TIMEOUT="10m"
CLEANUP_ARTIFACT_BLOB_MIN_AGE="24h"
# Cron interval for permanently deleting soft-deleted organizations older than CLEANUP_ORGANIZATION_MIN_AGE
# CLEANUP_ORGANIZATION_CRON="0 0 * * *"
# CLEANUP_ORGANIZATION_TIMEOUT="10m"
# CLEANUP_ORGANIZATION_MIN_AGE="720h"
# Cron interval for permanently deleting user accounts without an organization older than CLEANUP_USER_ACCOUNT_MIN_AGE
# CLEANUP_USER_ACCOUNT_CRON="0 0 * * *"
# CLEANUP_USER_ACCOUNT_TIMEOUT="10m"
# CLEANUP_USER_ACCOUNT_MIN_AGE="720h"
# Cron interval for deleting unreferenced files older than CLEANUP_FILE_MIN_AGE
CLEANUP_FILE_CRON="0 * * * *"
CLEANUP_FILE_TIMEOUT="10m"
CLEANUP_FILE_MIN_AGE="24h"
```
If these variables are not set, no cleanup jobs are scheduled. ### Automated job scheduling for High-Availability deployments For high-availability deployments with multiple instances of Distr (e.g., using Kubernetes), the built-in job scheduling is not suitable, as it would lead to multiple instances trying to perform the same cleanup tasks concurrently. Therefore, we recommend using [CronJobs](https://kubernetes.io/docs/core-concepts/workloads/controllers/cron-jobs/) in Kubernetes to handle the cleanup tasks. But the concept can apply to any HA setup where the cleanup jobs are triggered externally. These jobs can also be configured via our Helm Chart. An example configuration can be found in [`github.com/distr-sh/distr/deploy/charts/distr`](https://github.com/distr-sh/distr/blob/main/deploy/charts/distr/values.yaml):
```yaml
cronJobs:
- name: deployment-target-metrics-cleanup
labels:
distr.sh/job: deployment-target-metrics-cleanup
args: [cleanup, DeploymentTargetMetrics, --timeout, 10m]
- name: oidcstate-cleanup
labels:
distr.sh/job: oidcstate-cleanup
args: [cleanup, OIDCState, --timeout, 10m]
- name: artifact-blob-cleanup
labels:
distr.sh/job: artifact-blob-cleanup
args: [cleanup, ArtifactBlob, --timeout, 10m]
- name: file-cleanup
labels:
distr.sh/job: file-cleanup
args: [cleanup, File, --timeout, 10m]
# - name: organization-cleanup
# labels:
# distr.sh/job: organization-cleanup
# args: [cleanup, Organization, --timeout, 10m]
# - name: user-account-cleanup
# labels:
# distr.sh/job: user-account-cleanup
# args: [cleanup, UserAccount, --timeout, 10m]
```
## Additional configuration Some cleanup targets allow for additional customization using the following environment variables:
```dotenv
METRICS_ENTRIES_MAX_AGE="24h"
CLEANUP_ARTIFACT_BLOB_MIN_AGE="24h"
CLEANUP_ORGANIZATION_MIN_AGE="720h"
CLEANUP_USER_ACCOUNT_MIN_AGE="720h"
CLEANUP_FILE_MIN_AGE="24h"
```
Caution `METRICS_ENTRIES_MAX_AGE` does not have a default value. If unset, the cleanup routine for that target will have no effect. Caution The `Organization` cleanup target permanently and irreversibly deletes organizations and all their associated data. The default retention period is 30 days (`720h`). Only enable this job if you are sure you want to purge soft-deleted organizations. Caution The `UserAccount` cleanup target permanently and irreversibly deletes user accounts that belong to no organization, which is the state an account is left in after its last organization was removed or purged. The default retention period is 30 days (`720h`) since the last login, or since the account was created if it never logged in. Super admin accounts are never deleted, as they belong to no organization by design. ## Upstream Tag Synchronization When the pull-through cache is in use, Distr can automatically sync tags from upstream registries on a schedule. This is configured via a single environment variable:
```dotenv
# Cron schedule for syncing tags from upstream registries
REGISTRY_UPSTREAM_SYNC_CRON="15,45 * * * *"
```
If `REGISTRY_UPSTREAM_SYNC_CRON` is not set, no automatic sync is scheduled. Tags are still fetched on demand when a client pulls an image, but the tag list will not be proactively refreshed. ## Custom Domain Verification When [custom domains](/docs/self-hosting/configuration#custom-domains) are enabled, a job checks that each registered domain still points at your CNAME target. A domain is only used for links, mails, controller manifests and registry URLs while that check succeeds.
```shell
distr maintenance verify-custom-domains --timeout 10m
```
For single instance deployments, schedule it with the built-in scheduler:
```dotenv
CUSTOM_DOMAIN_VERIFICATION_CRON="*/15 * * * *"
CUSTOM_DOMAIN_VERIFICATION_TIMEOUT="4m"
```
For high-availability deployments, use a CronJob instead, as our Helm Chart does:
```yaml
cronJobs:
- name: custom-domain-verification
labels:
distr.sh/job: custom-domain-verification
schedule: '*/15 * * * *'
args: [maintenance, verify-custom-domains, --timeout, 10m]
```
Caution If you set `CUSTOM_DOMAIN_TARGET` without scheduling this job, domains are only ever checked when they are registered or when a vendor triggers the check from the organization settings. A domain whose record is fixed afterwards keeps falling back to your instance host until someone does. ## Database Encryption Distr encrypts the [sensitive columns of its database](/docs/self-hosting/security#database-encryption). Values written before you upgraded to a version that does so are still in plaintext, and after a key rotation some values are still encrypted with the previous key. This command moves both to the active key:
```shell
distr maintenance encrypt-database --timeout 60m
```
Unlike the jobs above this is not recurring work, so do not schedule it. There are exactly two occasions on which it has anything to do, the upgrade to a version that encrypts and a rotation of `DATABASE_ENCRYPTION_KEY`, and both are things you do deliberately. Run it once afterwards. Nothing in Distr writes a plaintext value, so once it reports that there is nothing left, that stays true. It is safe to run while Distr is serving traffic, it can be interrupted and resumed, and it is a no-op once everything is on the active key. Until then, Distr logs a warning on every start naming the columns that are left. Caution If you run more than one replica, wait until the upgrade to a version that encrypts has rolled out completely before you run this. The command clears each plaintext column as it encrypts it, and a replica still running the previous version reads that column instead of the encrypted one, so it would see those values as empty until it is replaced. Once the migration is done no value is left in plaintext, so this cannot happen again. A key rotation never produces an empty value, since it only ever rewrites the encrypted column, but it has a rollout order of its own, see [Rotating the key](/docs/self-hosting/security#rotating-the-key). On Kubernetes, run it in a Distr pod, which already has the database URL and the encryption key in its environment:
```shell
kubectl exec deploy/distr -- /distr maintenance encrypt-database --timeout 60m
```
The command dies with the pod if it is replaced while running, and a long run can outlive the `kubectl exec` connection. Neither loses work: every batch is committed on its own, so run it again and it continues where it stopped. For single instance deployments you can instead have it run during startup:
```dotenv
DATABASE_ENCRYPTION_MIGRATE_ON_BOOT=true
```
Leave this off if you run more than one replica, for the reason above: the first replica of the new version would start encrypting while replicas of the previous one are still serving. ## Removed features ### Deployment Revision Status Cleanup (removed in v4.2.0) Prior to v4.2.0, every status a controller reported was appended to a `DeploymentRevisionStatus` table, which the portal showed as a status history per deployment. Since controllers report once per `CONTROLLER_INTERVAL` that table grew continuously, and the `DeploymentRevisionStatus` cleanup target pruned entries older than `STATUS_ENTRIES_MAX_AGE`, always keeping the newest one per deployment. Distr now stores only the latest status, on the deployment revision itself, so there is nothing left to prune. The cleanup target, its cron environment variables (`CLEANUP_DEPLOYMENT_REVISION_STATUS_CRON`, `CLEANUP_DEPLOYMENT_REVISION_STATUS_TIMEOUT`) and `STATUS_ENTRIES_MAX_AGE` have been removed, along with the `GET /api/v1/deployments/{id}/status` and `GET /api/v1/deployments/{id}/status/export` endpoints. Remove the `deployment-revision-status-cleanup` CronJob from your Helm values and the variables from your environment; Distr ignores them. What a controller reports is now written to the controller logs instead, which you reach from the menu of a deployment target in the portal. Their retention is the Loki retention described below. ### Deployment & Deployment Target Log Cleanup (removed in v3.0.0) Prior to v3.0.0, deployment and deployment target logs were stored in PostgreSQL and pruned by the `DeploymentLogRecord` and `DeploymentTargetLogRecord` cleanup targets, keeping the newest `LOG_RECORD_ENTRIES_MAX_COUNT` entries per deployment resource or deployment target (count-based retention). Logs are now stored in [Grafana Loki](https://grafana.com/oss/loki/) and retention is time-based, managed entirely by the Loki configuration (the shipped default is 30 days via `limits_config.retention_period`). The cleanup targets, their cron environment variables (`CLEANUP_DEPLOYMENT_LOG_RECORD_*`, `CLEANUP_DEPLOYMENT_TARGET_LOG_RECORD_*`), and `LOG_RECORD_ENTRIES_MAX_COUNT` have been removed. ### Deployment Target Status (removed in v2.20.0) Prior to v2.20.0, Distr tracked a separate `DeploymentTargetStatus` per deployment target. This concept has been removed and is no longer available as a cleanup target.
# Prometheus Integration
> Monitor your Distr instance with Prometheus by scraping built-in metrics for deployments, organizations and Go runtime data.
Distr exposes a Prometheus-compatible metrics endpoint that can be scraped by any Prometheus-compatible monitoring system. ## Configuration The metrics endpoint is configured via environment variables: | Variable | Default | Description | | ----------------------- | ------- | ---------------------------------------------------------------------------------- | | `METRICS_ENABLED` | `false` | Enable the metrics HTTP server | | `METRICS_ADDR` | `:3000` | Address and port the metrics server listens on | | `METRICS_BEARER_TOKEN` | (none) | If set, requires an `Authorization: Bearer ` header on every scrape request | | `METRICS_PPROF_ENABLED` | `false` | Serve Go runtime profiles under `/debug/pprof/` on the metrics server | ### Docker Compose An example configuration can be found in [`github.com/distr-sh/distr/deploy/docker/quickstart`](https://github.com/distr-sh/distr/blob/main/deploy/docker/quickstart/.env):
```dotenv
METRICS_ENABLED=true
# METRICS_ADDR=:3000
# METRICS_BEARER_TOKEN=my-secret-token
```
### Kubernetes (Helm) When deploying with the Distr Helm chart, the same environment variables can be set via `distr.env` in your `values.yaml`. The metrics server port is configured separately via `service.metricsPort`. If you run the [Prometheus Operator](https://prometheus-operator.dev/), set `serviceMonitor.enabled` to let the chart create a ServiceMonitor for the Distr pods. Add the label your Prometheus selects ServiceMonitors by to `serviceMonitor.labels`, and if `METRICS_BEARER_TOKEN` is set, point `serviceMonitor.bearerTokenSecret` at the Secret key holding it. An example configuration can be found in [`github.com/distr-sh/distr/deploy/charts/distr`](https://github.com/distr-sh/distr/blob/main/deploy/charts/distr/values.yaml): Once enabled, the metrics are available at `GET /metrics` on the configured address (e.g. `http://localhost:3000/metrics`). ## Securing the metrics endpoint If `METRICS_BEARER_TOKEN` is set, every request to the metrics endpoint must include the token in the `Authorization` header. Unauthenticated requests will receive a `401 Unauthorized` response. Example Prometheus scrape configuration with authentication:
```yaml
scrape_configs:
- job_name: distr
scheme: http
static_configs:
- targets: ['distr:3000']
authorization:
type: Bearer
credentials: my-secret-token
```
## Available metrics ### Distr-specific metrics These custom metrics are exposed under the `distr` namespace and provide insight into the state of your Distr instance. | Metric | Type | Labels | Description | | ------------------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | | `distr_organizations_total` | Gauge | (none) | Current number of organizations | | `distr_deployment_status` | Gauge | `organization`, `customerorganization`, `deploymenttarget`, `deploymentid`, `application`, `applicationversion`, `status` | Whether a deployment is in a given status (`1`) or not (`0`). One time series per deployment per status | | `distr_deployment_status_timestamp_seconds` | Gauge | `organization`, `customerorganization`, `deploymenttarget`, `deploymentid`, `application`, `applicationversion` | Unix timestamp of the most recent status update for a deployment | The `distr_deployment_status` metric uses a one-hot encoding pattern: for each deployment, there is one time series per possible status value (`healthy`, `running`, `progressing`, `error`), where exactly one is set to `1` and the rest to `0`. ### Go runtime and process metrics In addition to the Distr-specific metrics, the endpoint exposes standard Go runtime and OS process metrics: * **Go runtime** (`go_*`): goroutine count, GC duration, memory allocation, heap usage, GC configuration * **Process** (`process_*`): CPU time, memory usage (resident and virtual), open file descriptors, process start time ## Use cases ### Custom alerting for customer deployments Distr includes built-in [alerts](/docs/controllers/alerts/) that notify users by email when deployments become unhealthy or resource usage exceeds thresholds. For more advanced alerting workflows, the Prometheus metrics endpoint can be combined with [Alertmanager](https://github.com/prometheus/alertmanager) or [Grafana Alerts](https://grafana.com/docs/grafana/latest/alerting/) to build custom error reporting independently from the integrated Distr alerts. For example, you can define Prometheus alerting rules based on `distr_deployment_status` to trigger notifications via Slack, PagerDuty or other channels when a customer deployment enters an error state, or to escalate issues that remain unresolved after a certain period.
# Security & Encryption
> How a self-hosted Distr instance protects the key material it holds, how to rotate it and how to keep it out of your configuration with AWS KMS or GCP Cloud KMS.
Distr holds key material of its own: the key its sensitive database columns are encrypted with, the secret its tokens are signed with and, if you issue license keys to your customers, the key those are signed with. Each one is set as an environment variable, listed in the [configuration reference](/docs/self-hosting/configuration), and each can be stored as the ciphertext of a key management service instead, so that it never appears in your configuration. ## Database Encryption Distr encrypts the sensitive columns of its database with AES-256-GCM before writing them: secret values, OIDC client secrets, SMTP credentials, pull-through registry credentials, deployment value and env files, support bundle resources, MFA secrets, Stripe webhook secrets and entitlement registry credentials. `DATABASE_ENCRYPTION_KEY` is required and Distr refuses to start without it. Generate one with `openssl rand -base64 32`. Back up your encryption key or cipher text A database dump is worthless without the encryption key, and so is your data if you lose it. Keep the key somewhere that will not go down or get deleted together with the database. The variable can also hold a ciphertext instead of the key itself, which Distr unwraps with a [key management service](#key-management-service) while it starts. Encryption is transparent, so nothing else in your configuration changes, but the values that were written before you upgraded to a version with encryption are still in plaintext. Move them over in one of two ways: * run [`distr maintenance encrypt-database`](/docs/self-hosting/maintenance#database-encryption) once, in a Distr container, or * set `DATABASE_ENCRYPTION_MIGRATE_ON_BOOT=true` and restart Distr, which does the same during startup. This is for single instance deployments only. Either way it is safe to run while Distr is serving traffic, and it can be interrupted and resumed. Until it has finished, Distr logs a warning on every start listing the columns that are still unencrypted. With more than one replica, wait for the upgrade to roll out completely first, see [Database Encryption](/docs/self-hosting/maintenance#database-encryption). ### Rotating the key `DATABASE_ENCRYPTION_KEY` also accepts a comma-separated list of `:` entries, where the id is a number between 0 and 255 and the first entry is the key that new writes are encrypted with. Every stored value records the id of the key it was encrypted with, so the other entries keep older values readable. To rotate, put the new key first and keep the old one:
```sh
DATABASE_ENCRYPTION_KEY="1:,0:"
```
Then run `distr maintenance encrypt-database`, which re-encrypts every value that still uses the old key. Once it reports nothing left to do, drop the old entry and keep only `1:`. With more than one replica, put the new key on every replica before you make it active. A rolling update replaces one replica at a time, so an updated one would otherwise seal writes with a key the others do not have yet, and their reads of those values fail until the rollout finishes: 1. roll out `DATABASE_ENCRYPTION_KEY="0:,1:"`. The old key stays active, so nothing about how values are written changes, but every replica can read the new one. 2. roll out `DATABASE_ENCRYPTION_KEY="1:,0:"` to make the new key active. 3. run `distr maintenance encrypt-database` and drop the old entry as above. ## JWT Signing Secret `JWT_SECRET` signs every token Distr issues, with HS256: user sessions, the access tokens controllers call the API with and the invite, password reset and email verification links it sends out. Generate it with `openssl rand -base64 32` and wrap it with a [key management service](#key-management-service) to keep it out of your configuration as well. There is no keyring for this secret, so replacing it invalidates everything signed with the previous one at once: users are signed out and have to sign in again, and invite and password reset links that have been sent but not used stop working. Controllers recover on their own, because their manifest carries the access key of their deployment target, which they exchange for a new token. ## License Signing Key `LICENSE_KEY_PRIVATE_KEY` is the PEM-encoded private key that signs the [license keys](/docs/platform/license-keys) you issue to your customers, and it is only needed if you issue any. Your instance serves the matching public key, so that the software you distribute can [verify a license key](/docs/platform/license-keys#verifying-tokens-in-your-application) on its own. Treat it like a release signing key rather than a credential. Anyone holding it can mint license keys your own software accepts and there is nobody to revoke it at, so it belongs out of your configuration just like the two above. Wrapping it also turns the multi-line PEM into a single-line value. Replacing the key invalidates every license key you have issued so far, since they no longer verify against the new public key, so plan a rotation as a reissue of all of them. ## Key Management Service By default `JWT_SECRET`, `DATABASE_ENCRYPTION_KEY` and `LICENSE_KEY_PRIVATE_KEY` hold the key material itself. All three also accept a ciphertext that Distr unwraps with a key management service during boot, so the key material appears in neither your configuration nor a Kubernetes Secret, and reading it becomes an API call that your cloud logs and that you can revoke without touching the instance. Keeping a value and the key that opens it apart like this is called transient encryption, but it also means losing either part makes the other useless, if you have no backup. Two providers are supported: * AWS Key Management Service (KMS) * GCP Cloud Key Management Service (Cloud KMS) Which provider is used follows from the key you name: `KMS_AWS_KEY_ID` selects AWS KMS and `KMS_GCP_KEY_NAME` selects Cloud KMS. Only one provider can be configured at a time; setting the key of both is an error. See the [configuration reference](/docs/self-hosting/configuration#key-management-service) for both variables and for the optional AWS region and endpoint overrides. A wrapped value is the `kms:` prefix followed by the base64-encoded ciphertext:
```sh
KMS_AWS_KEY_ID=alias/distr
DATABASE_ENCRYPTION_KEY=kms:AQICAHhwPRWvSKbxYYqVjZ9…
```
A value without a `kms:` prefix is used as it is and you can wrap one variable while leaving the others in plaintext. Distr calls the service once for every wrapped value while it starts and keeps the plaintext in memory afterwards. Requests it serves later never wait for your cloud, and an outage of the service only stops instances that are starting up. Each call has 30 seconds to come back, and if the service is unreachable or a ciphertext cannot be opened, Distr refuses to start rather than run without the value. ### Wrapping a value What you wrap is the exact string you would otherwise put into the variable. A keyring of several keys is therefore one ciphertext, and [rotating it](#rotating-the-key) works exactly as it does for an unwrapped key. Rotating the KMS key itself is safe as well, including automatically on the provider side, since every ciphertext records the key version it was made with. Every ciphertext is bound to the variable it is read for through the encryption context `distr=`. You have to pass it when you wrap the value, otherwise Distr cannot open it. It keeps a ciphertext made for one variable from being used as another, and on AWS the key policy can require it. Write the value into `plaintext.txt` with `printf '%s' '' > plaintext.txt` and delete it once you have the ciphertext, along with `context.txt` on GCP. Both commands below read the plaintext from a file rather than from an argument, so that it does not end up in your shell history. Unwrapped, the plaintext is what the variable expects: a [keyring entry](#rotating-the-key) for `DATABASE_ENCRYPTION_KEY`, the base64 secret on its own for `JWT_SECRET` and the PEM block for `LICENSE_KEY_PRIVATE_KEY`. Distr only ever decrypts; wrapping a value is a one-time action you perform yourself, so its credentials do not need permission to encrypt. ### AWS KMS Create a key first, with key type “Symmetric” and key usage “Encrypt and decrypt”, which is what `aws kms create-key` gives you by default (`--key-spec SYMMETRIC_DEFAULT --key-usage ENCRYPT_DECRYPT`). An asymmetric or HMAC key does not work, since only a symmetric key takes an encryption context. Name it in `KMS_AWS_KEY_ID`, as a key ARN, a key id or `alias/`. The command prints base64 already, so its output goes behind `kms:` as it is:
```sh
aws kms encrypt \
--key-id alias/distr \
--plaintext fileb://plaintext.txt \
--encryption-context distr=DATABASE_ENCRYPTION_KEY \
--output text --query CiphertextBlob
```
Distr needs `kms:Decrypt` on the key. You can restrict it to Distr by requiring the encryption context in the key policy, e.g. `"kms:EncryptionContext:distr": "DATABASE_ENCRYPTION_KEY"`. Credentials come from the default chain, so IRSA or an instance profile need no further configuration. ### GCP Cloud KMS Create a key first, with purpose “Symmetric encrypt/decrypt”, which is `--purpose encryption` in `gcloud kms keys create`, see [Create encryption keys with Cloud KMS](https://docs.cloud.google.com/kms/docs/create-encryption-keys). No other purpose takes the additional authenticated data that carries the encryption context. Name it in `KMS_GCP_KEY_NAME`, as the full resource name `projects/…/locations/…/keyRings/…/cryptoKeys/…`. `gcloud` writes raw bytes, hence the pipe:
```sh
printf 'distr=DATABASE_ENCRYPTION_KEY' > context.txt
gcloud kms encrypt \
--location=europe-west3 --keyring=distr --key=distr-master \
--plaintext-file=plaintext.txt \
--additional-authenticated-data-file=context.txt \
--ciphertext-file=- | base64 -w0
```
Distr needs `roles/cloudkms.cryptoKeyDecrypter` on the key. Credentials come from [Application Default Credentials](https://docs.cloud.google.com/docs/authentication/provide-credentials-adc), so Workload Identity needs no further configuration and a service account key file goes into `GOOGLE_APPLICATION_CREDENTIALS`.
# System Requirements
> Distr is written in Go and highly resource efficient. Learn about the recommended resources for self-hosting Distr, the registry and the log processing backend, and what to plan for in production.
Distr is written in [Go](https://go.dev/) and highly resource efficient. Our hosted offering serves thousands of requests every second with just two app servers at 30 MB / 50m CPU each and a PostgreSQL database at 1 GB / 200m CPU (excluding read replicas). This means you can run a self-hosted Distr instance comfortably on modest hardware. This page covers how much hardware to plan for. The software each deployment method needs is listed with the method itself, on the [Docker Compose](/docs/self-hosting/docker/) and [Kubernetes](/docs/self-hosting/kubernetes/) pages. ## Average resource consumption The following table lists the average CPU and memory per component. These values match the footprint of our staging environments and are a good starting point for a small self-hosted instance. Scale them up based on your request volume and artifact sizes. | Component | CPU | RAM | | ----------------------- | ------------- | ------------ | | Distr | 100m | 128 MB | | PostgreSQL (database) | 250m | 512 MB | | RustFS (object storage) | 100m | 256 MB | | Loki (log processing) | 100m | 512 MB | | Caddy (reverse proxy) | 50m | 64 MB | | **Total** | **\~0.6 CPU** | **\~1.5 GB** | ## Persistence Distr itself does not require any persistent volumes. All state lives in the PostgreSQL database, in the S3-compatible object storage (registry blobs and log chunks) and in the environment configuration. The registry scratch volume below holds no state and can be thrown away with the container. ## Log processing (Loki) Deployment and deployment target logs are processed and stored via [Grafana Loki](https://grafana.com/oss/loki/), which is included in all shipped deployment methods (Docker Compose and Helm) in monolithic (single-binary) mode. Loki persists log chunks and its index in the same S3-compatible object storage as the registry, using a dedicated `loki` bucket, and only needs a small local volume for its write-ahead log and caches. On Google Cloud it talks to the bucket through the native GCS API instead, as the [GCP examples](/docs/self-hosting/docker/#distr-enterprise-on-gcp) do. The shipped configuration retains logs for 30 days. ## Registry The registry buffers uploads while it receives them. Give it a scratch volume (`REGISTRY_SCRATCH_DIR`) so it buffers them to disk, sized for the layers you expect to be pushed at the same time. Without one, large layer uploads go to RAM and can increase the memory footprint of Distr considerably. We also recommend backing the registry with an external S3-compatible object storage like AWS S3. It is more scalable and durable than a single local RustFS container, and it lets the registry serve layer downloads via pre-signed URLs: instead of streaming the layer through Distr, the registry answers with an HTTP `307 Temporary Redirect` to a short-lived URL, so clients download layers directly from the object storage. Pull bandwidth then stays off Distr, which keeps its CPU and memory footprint low even under heavy pull load. The redirect is enabled by default and can be turned off with `REGISTRY_S3_ALLOW_REDIRECT`. ## Networking and ports Distr exposes two HTTP endpoints: the app (web UI and API) and the registry (OCI artifacts). Both are typically served under separate hostnames and put behind a TLS-terminating [reverse proxy](/glossary/reverse-proxy/) (Caddy in our Docker Compose setup, an Ingress controller in Kubernetes). Regardless of how you deploy, make sure the following is in place: * A public domain name each for the app, the registry and [metrics](/docs/self-hosting/prometheus/), pointed at the public IP of your VM or load balancer. * Port `443` publicly reachable for HTTPS traffic. * Port `80` publicly reachable as well if you let the reverse proxy obtain and renew TLS certificates automatically via ACME. ## Production recommendations For production use, we recommend the following: * Run PostgreSQL and the object storage as managed services, so you can scale, upgrade and operate them independently of Distr. * Run several Distr replicas behind a load balancer so Distr stays available during upgrades and node failures. Our [Helm chart](/docs/self-hosting/kubernetes/) does this via `replicaCount` and `autoscaling`. * Trigger the [maintenance jobs](/docs/self-hosting/maintenance/) from outside Distr instead of using its built-in scheduler, since every replica would otherwise run every job. The Helm chart ships them as Kubernetes `CronJob`s under `cronJobs`. * Back up the database and the object storage regularly and test your restore procedure. They hold all state there is. Back up `DATABASE_ENCRYPTION_KEY` alongside them but stored separately, since a database backup cannot be restored into a working instance without it. * Keep the database credentials, `JWT_SECRET`, `DATABASE_ENCRYPTION_KEY` and the object storage keys in a secret manager, such as a Kubernetes `Secret`, Vault or your cloud provider’s secret store, rather than in plain-text environment files.
# Choosing a Plan
> Learn which Distr subscription plan is right for you: distributing and operating customer installs, scaling your distribution operation, or building a complete commercial self-hosted delivery suite.
Distr offers subscription plans for different stages of software distribution. This guide explains which plan fits your current needs. Every plan works on [Distr Cloud or self-hosted](#distr-cloud-or-self-hosted), so you can pick a plan first and decide later whether it runs on Distr Cloud or in your own environment. ## Pro Plan **Choose Pro to distribute and operate customer installs in production.** Pro covers everything you need to ship to self-managed customers: deployments through Docker, Kubernetes/Helm, or artifact-based distribution, with version visibility, license enforcement, deployment alerts, and role-based access control across both your team and your customers’ teams. **Ideal for:** * Shipping your first customer installations and scaling from there * Teams that need license management and version control * Organizations requiring role-based access control * Teams that want a branded customer portal **Key characteristics:** * License management with application and artifact entitlements and signed license keys * Role-based access control (Admin, Default, Read-Only) * Deployment alerts * Support bundles for remote troubleshooting * Deployment history and rollbacks * Custom branding for your Customer Portal * Up to 1 TB registry storage and 7-day log retention * Email and Slack support, including a free onboarding call ## Business Plan **Choose Business when you distribute at scale.** Business adds the features you need to run your entire distribution operation on Distr: partner management, license templates, and a fully white-labeled customer experience on your own domain. **Ideal for:** * Vendors with a large or fast-growing customer base * Companies selling through resellers or partners * Teams standardizing license issuance with templates * Organizations that want the customer-facing experience fully on their own domain * Teams where vendors or customers require their own OIDC provider **Key characteristics:** * Everything in Pro * Reseller / partner organizations * License templates * Custom domains (full white label) and white-label emails from your own sender domain * Enterprise SSO — bring-your-own OIDC (vendors and customers) * Up to 5 TB registry storage and 30-day log retention * Priority email and Slack support with white glove onboarding ## Enterprise Plan **Choose Enterprise when Distr becomes your entire commercial self-hosted delivery suite.** At this stage you distribute more than software. Documentation, support portals, public images, automated workflows, and usage-based billing all live inside one platform — with the isolation and contractual guarantees your procurement team asks for. **Ideal for:** * Organizations using Distr as their complete commercial platform * Companies needing unlimited scale * Teams requiring dedicated infrastructure * Organizations needing advanced features like customer billing and custom roles * Companies requiring SLA guarantees, custom contracts, and dedicated support **Key characteristics:** * Everything in Business, plus unlimited usage at a flat yearly rate * Advanced features: customer billing, custom roles, SAML SSO, workflows and automation * Documentation pages, wiki, and ticket system * Public registry and CVE scanning * Custom registry storage and log retention * Dedicated infrastructure * Custom contracts and procurement support * Dedicated support engineer, phone support, and SLA ## Distr Cloud or Self-Hosted Every plan is available on Distr Cloud and self-hosted, with the same feature set either way. Where Distr runs is a separate decision from which plan you pick: * **Distr Cloud** - We operate Distr, the registry, and log storage for you at [app.distr.sh](https://app.distr.sh), so there is nothing to install. * **Self-hosted** - You run Distr in your own environment with Docker Compose or Kubernetes, and bring your own PostgreSQL database and S3-compatible object storage. A license key unlocks your plan, so [contact us](/contact/) to get one. For deployment methods, system requirements, and configuration options, see our [self-hosting guide](/docs/self-hosting/). ## Making Your Decision ### Start with Pro: * ✅ Comes with all the essentials you need to ship to self-hosted customers * ✅ Logs, metrics, and alerts from every deployment * ✅ License management + RBAC * ✅ Branded Customer Portal ### Upgrade to Business when: * ✅ You’re integrating Distr deeper into your operation and scaling it up * ✅ You want the entire experience fully white-labeled: custom domains, white-label emails, and your own OIDC provider * ✅ You onboard resellers and distribution partners * ✅ You want license templates for standardized license issuance * ✅ You need 30-day log retention and priority support ### Consider Enterprise if: * ✅ You’re a security-conscious vendor serving security-conscious and regulated customers * ✅ You want unlimited usage at a flat yearly rate * ✅ You require dedicated infrastructure, SAML SSO, and custom roles * ✅ You need custom contracts, SLAs, and a dedicated support engineer ## Next Steps 1. **Try Distr for free** - Start a 30-day Pro Trial on Distr Cloud by [creating your account](/onboarding/), or run the free Community Edition on your own machine. 2. **Review pricing** - See current pricing and calculate costs on our [pricing page](/pricing/). 3. **Learn about trials** - Understand how the 30-day trial works in our [trial guide](/docs/free-trial/). 4. **Manage your subscription** - Once you’ve chosen a plan, learn how to manage it in our [subscription management guide](/docs/subscription-management/).
# Subscription Management
> Manage your Distr subscription, add or remove users and customers, view invoices, and handle billing through the Vendor Portal and Stripe.
Distr offers subscription plans that scale with your software distribution needs. All new organizations start with a **Pro Trial** period, giving you full access to Pro features for up to 30 days to evaluate the platform. ## Available Plans Distr provides three subscription tiers: * **Pro** - For distributing and operating customer installs with license management and RBAC * **Business** - For distributing at scale with partner management and full white label * **Enterprise** - For organizations using Distr as their complete commercial platform Every plan is available on Distr Cloud or self-hosted in your own environment. This page covers subscriptions on Distr Cloud. If you want to self-host a plan, [contact us](/contact/). For detailed feature comparisons, limits, and pricing, visit our [pricing page](/pricing/). To understand which plan is right for your needs, see our guide on [choosing a plan](/docs/subscription/). ## Managing Your Subscription ### Accessing Subscription Management Subscription management is available in the **Subscription** section of the Vendor Portal: 1. Log in to the [Vendor Portal](https://app.distr.sh/subscription) 2. Click **Subscription** in the sidebar 3. View your current subscription status, limits, and usage ### Viewing Subscription Details The Subscription page displays: * **Current Usage** - How many customers and users you’re currently using, along with your registry storage consumption and log retention period * **Usage Limits** - Current limits for customer organizations and user accounts * **Current Subscription Type** - Your active plan (Pro Trial, Pro, Business, or Enterprise) * **Subscription Renewal Date** - When your current subscription renews ### Managing Customers and Users Within Your Plan You can add customer organizations and internal users within your current subscription plan limits: * **Adding Customers** - Add new customer organizations up to your plan’s limit through the Vendor Portal * **Adding Users** - Add internal team members and customer users within your plan’s user account limits * **Self-Service** - These operations are available directly in the Vendor Portal without requiring plan changes ### Updating Your Subscription #### Upgrading from Pro to Business Organization admins can upgrade from the Pro plan to the Business plan directly in the Vendor Portal: 1. Navigate to the **Subscription** section in the Vendor Portal 2. In the **Upgrade to Business** section, review the Business plan features and the estimated cost for your current quantities 3. Click **Upgrade to Business** and confirm the change 4. The upgrade takes effect immediately. On a yearly subscription the prorated amount is invoiced and charged immediately, on a monthly subscription it is reflected on your next invoice #### Downgrading or Other Plan Changes Downgrades and all other plan changes cannot be made through the Vendor Portal: 1. Contact our support team via email at **** 2. Specify which plan you’d like to switch to 3. Our team will process your request and guide you through the transition ### Pro Rata Adjustment Whenever your subscription changes in the middle of a billing cycle — adding internal users or customers, or upgrading from Pro to Business — Stripe automatically applies a pro rata adjustment: * **Unused Time Credit** - You receive a credit for the unused time on your previous quantities or plan * **Remaining Time Charge** - You’re charged for the new quantities or plan for the remainder of the current billing cycle * **Invoicing** - On a yearly subscription, the adjustment is invoiced and charged immediately. On a monthly subscription, it appears on your next invoice * **Renewal Date** - Your renewal date stays the same For a concrete example, see [Adding Users or Customers During a Billing Cycle](#adding-users-or-customers-during-a-billing-cycle). ### Quantity Updates During Billing Cycle You can add internal Users and Customers within your plan limits in the middle of a billing cycle. #### Adding Users or Customers During a Billing Cycle When you add more customers or users to your Pro plan mid-cycle: * **Immediate Access** - The additional customers and users become available immediately * **Prorated Charges** - You’ll be charged a prorated amount for the additional customers and users for the remainder of the current billing cycle * **Yearly Billing** - The prorated amount is invoiced and charged to your payment method immediately * **Monthly Billing** - The prorated amount is added to your next month’s invoice **Example:** If you’re on a Pro plan and add more customers on day 15 of a monthly billing cycle: * You currently have 10 customers on your Pro plan * You add 5 more customers (now 15 total) * You’ve used 15 days of your current billing cycle * You’ll be charged a prorated amount for the 5 additional customers for the remaining 15 days * This prorated amount appears on your next month’s invoice * You immediately gain access to the additional customers On a yearly subscription, adding the same 5 customers 6 months into the billing cycle creates an invoice for the remaining 6 months right away, which is charged to your payment method on file. Your renewal date does not change. #### Reducing Internal Users or Customers During a Billing Cycle When you downgrade your plan mid-cycle, the new plan and its limits take effect right away. To ensure a smooth transition, make sure your account is already within the limits of the plan you’re switching to. If you currently have more customers or users than the new plan allows, you’ll need to remove the excess before completing the downgrade. Once you’re within the new plan’s limits: * **Immediate Plan Change**: Your subscription updates right away * **Continued Access**: You keep access to your remaining customers and users for the rest of the current billing cycle * **Next Billing Cycle**: Your next month’s invoice reflects the price of your new plan **Example:** If you’re on the Business plan with 120 customers and want to move to the Pro plan that allows 100 customers: * Reduce your customer count from 120 to 100 * Once you’re at 100 customers, you can downgrade immediately * You continue using the new plan for the rest of your current billing cycle * Starting next month, your invoice reflects the new plan’s pricing ### Cancelling Your Subscription Subscriptions can be cancelled through the Stripe Customer Portal: 1. Navigate to the **Subscription** section in the Vendor Portal 2. Click **Manage Subscription** - This opens the Stripe Customer Portal 3. In Stripe, navigate to your subscription 4. Click **Cancel Subscription** 5. Your subscription will remain active until the end of your current billing period 6. Once that period ends, Distr sends you to the subscription page and you cannot use the Vendor Portal until you select a plan again. Your data, customers, and deployments stay intact ## Understanding Usage Limits ### Subscription Limits Each subscription tier has specific limits on: * **Customer Organizations** - The number of end-customer organizations you can onboard * **User Accounts** - The number of internal team members in your organization * **Deployments** - The number of internal deployments or deployments per customer organization. * **Registry Storage** - The amount of artifact storage available For specific limits per plan, visit our [pricing page](/pricing/). ### Limit Enforcement When you approach or reach your subscription limits: 1. **Warning Indicators** - The Subscription page shows your current usage vs. limits 2. **Prevention** - You cannot create new customers or users beyond your limits ## Billing & Invoices ### Stripe Customer Portal All billing operations are managed through the Stripe Customer Portal: 1. Navigate to **Subscription** in the Vendor Portal 2. Click **Manage Subscription** - This opens the Stripe Customer Portal in a new window 3. In Stripe, you can: * View and download invoices * Update payment methods * View payment history * Cancel your subscription ### Subscription Periods Distr subscriptions support: * **Monthly Billing** - Charged monthly, cancel anytime * **Yearly Billing** - Charged yearly upfront (discounted pricing) ### Invoices * **Automatic Generation** - Invoices are automatically generated for each billing cycle * **Email Delivery** - Invoices are sent to your organization’s billing email * **Download** - Access and download invoices anytime through the Stripe Customer Portal * **Payment Methods** - Update credit cards and payment methods in Stripe ### Payment Methods * **Credit Cards** - All major credit cards accepted * **Currency** - USD only for Pro and Business (Enterprise plans support billing in EUR) * **Auto-renewal** - Subscriptions automatically renew unless cancelled
# Air-Gapped Deployments
> Ship into air-gapped and restricted networks with Distr. Kubernetes applications travel as Zarf packages built in CI, Docker Compose applications as one archive with the Compose file and every image, both deployed offline inside the gap.
[Air-gapped](/glossary/air-gapped-meaning/) deployments sit at the far end of the [self-hosted spectrum](/blog/self-hosted-spectrum/): the product runs in the customer’s environment with **no vendor access** and no live path to your SaaS control plane. Two problems to solve: 1. **Create a complete offline package** (application + every image and dependency). 2. **Move that package across the gap** (USB, exchange/staging server or another customer-approved transfer), then deploy inside the isolated network. A Compose file or Helm chart alone is not enough. Images have to travel with the recipe, or be pullable from a place the customer is allowed to reach. ## Solution Architecture  ## True air-gapped deployments: Kubernetes with Zarf (recommended) For Kubernetes, [Zarf](/docs/integrations/zarf/) is the path we recommend. A Zarf package is the offline bundle: Helm chart, container images, dependencies and SBOMs in one archive. 1. **Create the Zarf package with Distr.** Build it in CI (for example the GitHub Actions job in the [Zarf integration guide](/docs/integrations/zarf/#step-4-automate-with-github-actions)) so every release produces a versioned archive, then publish it to your Distr registry. Control who can pull which versions with [artifact entitlements](/docs/platform/artifact-entitlements/). 2. **Customer moves it across the gap** on a connected staging machine they control: pull the entitled package from Distr, then transfer via USB/removable media, an exchange/DMZ server or whatever one-way process they already trust. 3. **Deploy offline** inside the air-gapped cluster with `zarf package deploy` from the local archive. No vendor access, no pull from Distr at install time. Commands, `zarf.yaml` and the full GitHub Actions example live in the [Zarf integration guide](/docs/integrations/zarf/). This use-case page is the model; that page is the how-to. ## True air-gapped deployments: Docker Compose The offline bundle for Docker Compose is one archive with the Compose file and every image it references, built on a connected staging host with the script below. **Vendor side.** Upload to Distr everything the app needs: the Compose file **and** every image it references (frontend, backend, Redis, Postgres, sidecars, …). Compose alone is not enough. If only Compose is on Distr, the customer would still have to pull images from somewhere else (often Docker Hub). Put all images on Distr, point Compose at those Distr image references and entitle the customer for those artifacts. **Customer side.** On a connected staging host with Docker, Docker Compose and [ORAS](https://oras.land/docs/installation), log in with a [personal access token](/docs/integrations/personal-access-token/) and build the bundle. Take the registry host and the artifact name of the Compose file from the [Customer Portal](/docs/platform/customer-portal/registry/).
```sh
#!/bin/sh
set -e
REGISTRY="registry.distr.sh"
COMPOSE_ARTIFACT="$REGISTRY/your-org/your-app-compose:1.0.0"
COMPOSE_FILE="docker-compose.yaml"
BUNDLE="your-app-1.0.0"
echo "$DISTR_ACCESS_TOKEN" | docker login "$REGISTRY" --password-stdin -u -
mkdir -p "$BUNDLE"
oras pull "$COMPOSE_ARTIFACT" --output "$BUNDLE"
docker compose -f "$BUNDLE/$COMPOSE_FILE" config --images > "$BUNDLE/images.txt"
while read -r image; do
docker pull "$image"
done < "$BUNDLE/images.txt"
docker save -o "$BUNDLE/images.tar" $(cat "$BUNDLE/images.txt")
tar -czf "$BUNDLE.tar.gz" "$BUNDLE"
echo "Created $BUNDLE.tar.gz"
```
If the Compose file requires environment variables, set them or pass `--env-file` to `docker compose config`. Add a [license key](/docs/platform/license-keys/) file or other configuration your application reads to the bundle directory before the `tar` step. Transfer `your-app-1.0.0.tar.gz` across the gap, then deploy it inside the isolated network:
```sh
tar -xzf your-app-1.0.0.tar.gz
cd your-app-1.0.0
docker load -i images.tar
docker compose -f docker-compose.yaml up -d --pull never
```
Compose uses the `image:` names in the file, which match the images just loaded, so it never reaches a registry. To serve the images from an internal registry instead, push them there after `docker load` and point the Compose file at it. If the application needs Kubernetes and the air-gapped server has no cluster, see [Cluster Setup with k3s](/docs/integrations/k3s/#air-gapped-servers). ## Crossing the gap How the package enters the isolated network is the customer’s process. Common patterns: * **USB / removable media:** download on a connected host, carry media in, deploy from local files. * **Exchange / staging server:** download to a customer-controlled DMZ or jump host, then move through their approved transfer into the isolated network. * **Data diode / one-way:** same idea: content only moves inbound under their controls. ## Restricted outbound to Distr (not a true air-gapped deployment) If the customer allows outbound access **only** to Distr, the environment is restricted, not air-gapped. They authenticate and pull entitled Compose + images directly from your [Distr registry](/docs/registry/) (see the [customer portal registry](/docs/platform/customer-portal/registry/) flow), then run Compose there. That only works when every `image:` in Compose points at Distr. If Compose still references Docker Hub (or another registry), whitelist Distr is not enough. Prefer the true air-gapped paths above when there is no outbound path at all. Use restricted pulls when the buyer allows Distr but nothing else. ## Customer-hosted Distr Some end customers run a [self-hosted Distr](/docs/self-hosting/) instance inside their own network so distribution stays inside their boundary. That is a special enablement path. Contact if you need it. ## Related * [Zarf integration (build, publish, deploy)](/docs/integrations/zarf/) * [Artifact entitlements](/docs/platform/artifact-entitlements/) * [Offline license keys](/docs/platform/license-keys/) * [Air-gapped glossary](/glossary/air-gapped-meaning/) * [The self-hosted spectrum](/blog/self-hosted-spectrum/)
# Assisted Self-Managed Deployments
> Distr controllers assist by running in end-customer environments, they pull application updates, apply configuration changes, report deployment statuses and authenticate automatically to the Distr registry, without granting vendor access to the target environment.
The Assisted Self-Managed deployment model sits in the middle of the [self-hosted spectrum](/blog/self-hosted-spectrum/): customer infrastructure control with vendor assistance on the application lifecycle. Applications run in customer-owned environments such as virtual machines or Kubernetes clusters, with no direct vendor access to the infrastructure. The lightweight and open source [Distr controllers](/docs/controllers/), installed by the customer in the target environment, handle deployments and updates. They pull application definitions and artifacts from Distr, apply customer-defined configurations, and report deployment status, logs, and health to both the [vendor](/docs/vendor-portal/) and [customer](/docs/platform/customer-portal/) portals, without exposing internal infrastructure. The Customer Portal also allows end users, who may not be involved in initial deployment, to configure applications, monitor status, access logs, and trigger updates. This is especially useful in setups where a platform team deploys the application, but another team operates it day-to-day. ### Solution Architecture  ### Implementation steps 1. Create Your [Application](/docs/controllers/application/) 2. (Optional) Set Up Your [Registry](/docs/registry/configuration/) 3. White-label the [Customer portal](/docs/platform/branding/) 4. Onboard your first [customer](/docs/platform/rbac/#inviting-customer-organization-users) 5. Customer creates a [Personal Access token](/docs/integrations/personal-access-token/) 6. Customer deploys your application via the Distr [controllers](/docs/platform/customer-portal/deployments/#deployment-controller-quickstart-from-the-customer-portal)
# Bring Your Own Cloud (BYOC)
> Distr provisions and reconciles the infrastructure in your customer's cloud account with OpenTofu, deploys your application onto it and rolls out infrastructure and application versions from one place.
[Bring Your Own Cloud (BYOC)](/glossary/byoc-definition/) is the vendor-operated pole of [self-hosted](/glossary/self-hosted-software/) (see [the self-hosted spectrum](/blog/self-hosted-spectrum/)): fully managed operations inside customer-owned cloud resources. It suits organizations with strict data residency or compliance requirements that need to keep ownership of their cloud infrastructure. BYOC runs on two independent Distr applications. The first is an infrastructure application built on the [OpenTofu controller](/docs/controllers/infrastructure-controllers/), one of the Distr infrastructure controllers. It contains your OpenTofu or Terraform configuration, and the [Docker controller](/docs/controllers/docker-controller/) runs it on a small management VM in the end customer’s cloud account. It reconciles their infrastructure on a loop and creates the cluster and the resources your product needs. Its cloud credentials and its state stay in the customer’s account. The second is your application. The [Kubernetes controller](/docs/controllers/kubernetes-controller/) manages it in the cluster the infrastructure application created. Both are versioned Distr applications, so an infrastructure change ships like any application update: publish a new version and roll it out. This keeps every managed BYOC customer on the same infrastructure and application versions. ## Solution Architecture  ## Implementation steps 1. Set Up Your [Registry](/docs/registry/configuration/) 2. Build your infrastructure image on the [OpenTofu controller](/docs/controllers/infrastructure-controllers/#ship-your-infrastructure-with-the-opentofu-controller), starting from the [`aws-eks` example](https://github.com/distr-sh/distr-infrastructure-controllers/tree/main/examples/opentofu/aws-eks) 3. Create two [Applications](/docs/controllers/application/): a Docker application for the infrastructure and your own application 4. White-label the [Customer portal](/docs/platform/branding/) 5. Onboard your first [customer](/docs/platform/rbac/#inviting-customer-organization-users) 6. Connect a management VM in the customer’s cloud account with the [Docker controller](/docs/controllers/docker-controller/) and deploy the infrastructure application to it, passing the customer’s cloud credentials as [secrets](/docs/controllers/secrets/) 7. Connect the [Kubernetes controller](/docs/controllers/kubernetes-controller/) to the cluster the infrastructure application created and deploy your application to it 8. Manage deployments and updates of both applications directly for the customer using the [Distr controllers](/docs/controllers/)
# Edge Deployments
> Deploy Distr controllers to IoT devices and specialized hardware, once installed, each edge device can be centrally managed and monitored via the vendor portal.
Edge Deployments enable vendors to manage software on decentralized, often resource-constrained environments that operate outside traditional data centers. In this model, vendors maintain control of both the software and the deployment target, whether IoT devices, custom hardware, or edge infrastructure. The lightweight nature of the Distr controllers introduces little to no overhead to IoT devices on edge that often have limited resources. 
# Fully Self-Managed Deployments
> In fully self-managed deployments, customers use access tokens to pull artifacts directly from Distr’s private OCI-compliant registry, with a built-in UI in the Customer Portal that displays all available artifacts, no controllers or external dependencies required.
The Fully [Self-Managed](/glossary/self-hosted-software/) deployment model is the customer-operated end of the [self-hosted spectrum](/blog/self-hosted-spectrum/) (short of true air-gapped): third-party access is not an option. It is best suited for customers wanting to have full control over their infrastructure and don’t want to use external controllers. For this deployment model, Distr provides a private [artifact registry](/glossary/oci-container-artifact-registry/). It comes with an [optimized UI](/docs/registry/#artifact-registry-ui) that enables customers to create access tokens, fetch the latest images and build custom automations on top of the registry. ## Solution Architecture  ## Implementation steps 1. Set Up Your [Registry](/docs/registry/configuration/) 2. Create Your [Application](/docs/controllers/application/) 3. White-label the [Customer portal](/docs/platform/branding/) 4. Onboard your first [customer](/docs/platform/rbac/#inviting-customer-organization-users) 5. Customer creates a [Personal Access token](/docs/integrations/personal-access-token/) 6. Customer can [access and pull](/docs/platform/customer-portal/registry/#registry-quickstart-from-the-customer-portal) your private artifacts Customers running Amazon ECS pull your images into their tasks the same way, as described in the [Amazon ECS guide](/docs/integrations/aws-ecs/).
# Vendor Portal
> Manage your self-managed software distribution from a single control plane with full visibility into deployments, artifacts, licenses, customers, users, and customer portal customization.
The Vendor Portal is the Distr UI for vendors. It gives you access to all Distr features, including [application creation](/docs/controllers/application/), [artifact registry](/docs/registry/configuration/) management, and monitoring of end-customer deployment states. The [Customer Portal](/docs/platform/customer-portal/) gives end customers a simpler interface where they configure and manage their deployments. It also centralizes release information and instructions for operating the vendor’s software.  ## Key Features 1. **Dashboard**: View health status for controllers and artifacts across all deployments at a glance. 2. **Controllers**: Add applications, create and manage deployments, set up [alerts](/docs/controllers/alerts/), monitor deployment health, and view deployment logs. See the [Controllers](/docs/controllers/) section for details. 3. **Registry**: Browse and view consumption metrics of your [artifacts](/docs/registry/) in the *Registry* section. 4. **Licenses**: Manage entitlements and license keys per customer. Application Entitlements control which application versions customers can deploy, Artifact Entitlements control registry access, and License Keys let you issue signed tokens your application can use to enforce usage limits and feature access. 5. **Customers**: Create and manage customer organizations, invite users, manage secrets, and control features per customer. See the [Customer Management](/docs/platform/customer-management/) guide for a detailed walkthrough; to invite users and assign roles, see [RBAC: Inviting Customer Organization Users](/docs/platform/rbac/#inviting-customer-organization-users). 6. **Support Bundles**: Receive and review diagnostic data from customers. Customers run a one-time collection script on their host; the collected environment variables and container logs appear here for review and discussion. See [Support Bundles](/docs/platform/support-bundles/) for details. 7. **Users**: Add and manage internal team members for your Distr vendor account. 8. **Secrets**: Manage sensitive configuration values and credentials that can be securely shared with customer deployments. 9. **Branding**: [White-label](/docs/platform/branding/) the customer portal with your branding, and provide customers with self-service instructions and documentation. 10. **Subscription**: View your current plan, usage limits, and billing information. 11. **Settings**: Configure your organization name, registry [slug](/docs/registry/configuration/#1-set-your-registry-slug) and [custom domains](/docs/platform/branding/#custom-domains), and manage organization deletion. 12. **Account Menu**: Access your personal account settings from the dropdown in the top-right corner. Update your profile information or create [Personal Access Tokens](/docs/integrations/personal-access-token/) for API, SDK, and registry authentication to integrate Distr into your CI/CD pipelines.