debian-quickstart
Use a Debian registry to host, proxy, and distribute .deb packages compatible with Debian and Ubuntu systems. Harness Artifact Registry supports APT-based package installation, source uploads, and upstream proxying from external Debian repositories.
Before you begin
- APT package manager: Available on any Debian or Ubuntu system by default.
- Harness permissions: Registry-create access in the target project. Go to RBAC in Harness to configure roles.
Create a Debian Artifact Registry
- Interactive Guide
- Step-by-Step
- Go to the Artifact Registry module in your Harness project.
- Select New Artifact Registry.
- In the Registry Type list, select Debian Registry.
- Provide a Registry Name.
Registry name requirements
This registry name must start with a letter and can only contain lowercase alphanumerics,
_,.and-, and must be unique to your Harness Account. - Optionally, add a Description and Labels for better organization.
- Choose visibility between Public and Private.
- Select Create Registry to finalize.
This registry will serve as your private Debian registry within Harness.
Configure an upstream proxy (optional)
An upstream proxy allows your registry to fetch Debian packages from external repositories (such as official Debian or Ubuntu mirrors) if they are not available locally.
- Interactive Guide
- Step-by-Step
Create the upstream proxy
Configure the upstream proxy in your registry
Create an upstream proxy
- In the Artifact Registry module, select the dropdown next to New Artifact Registry and select Upstream Proxy.
- Choose Debian Registry as the proxy type.
- Enter an upstream proxy name.
- Enter your remote repository URL. The URL must point to the parent directory of the
/distsfolder for that repository (for example,http://deb.debian.org/debian, wherehttp://deb.debian.org/debian/dists/contains the release metadata). If you use another Debian mirror or private repository, verify the path ends at that parent level, not at a distribution or component subdirectory. - Choose your Authentication method (
Anonymousby default). - Select Create Proxy to establish the connection.
Configure the upstream proxy in your registry
- In the Artifact Registry module, select an existing Artifact Registry.
- Select the Configuration tab.
- Under Advanced (Optional), select Configure Upstream.
- Select from the list of compatible proxies to add them to your registry.
- Select Save to save the configuration.
When you install a package through the upstream proxy, it fetches the package from the configured external repository and caches it locally. Subsequent installs for the same package version are served from the local cache.
Harness regenerates Debian registry metadata when you upload or delete an artifact, or when you add or remove an upstream proxy from a registry. This operation can take a couple of minutes, so your changes might not appear in APT metadata immediately.
Set up the client
With your Debian registry created, you can now configure APT to install packages from your Harness registry.
1. Configure authentication
In your Harness Debian Artifact Registry, select Setup Client and then Generate Token to generate an identity token for authentication.
2. Add the repository to APT sources
echo "deb [trusted=yes] https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/debian <DISTRIBUTION> <COMPONENT>" | sudo tee /etc/apt/sources.list.d/harness.list
3. Configure authentication for APT
Create or edit the auth config file:
sudo vi /etc/apt/auth.conf.d/harness-<REGISTRY_NAME>.conf
Add the following content:
machine pkg.harness.io
login <USERNAME>
password <TOKEN>
4. Update APT cache
sudo apt-get update
5. Install a package
sudo apt-get install <ARTIFACT_NAME>=<VERSION>
6. Upload a .deb package
curl --location --request PUT 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/debian/deb?distribution=<DISTRIBUTION>&component=<COMPONENT>' \
--form 'file=@"<FILE_PATH>"' \
--header 'x-api-key: <API_KEY>'
7. Upload Debian sources (optional)
Upload a .dsc file:
curl --location --request PUT 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/debian/dsc?distribution=<DISTRIBUTION>&component=<COMPONENT>' \
--form 'file=@"<FILE_PATH>"' \
--header 'x-api-key: <API_KEY>'
Upload a source tarball (for upstream source tarballs, specify the upstream version):
curl --location --request PUT 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/debian/src?distribution=<DISTRIBUTION>&component=<COMPONENT>&package=<ARTIFACT_NAME>&version=<VERSION>' \
--form 'file=@"<FILE_PATH>"' \
--header 'x-api-key: <API_KEY>'