Skip to content

Deliver private files and release artifacts

Upload release files to versioned paths with curl or the dashboard. Recipients download them with a download key or a short-lived link.

Overview

A Files registry stores files that are not npm or Python packages: installers, binaries, archives, firmware, documents and other release artifacts. You upload files with curl or from the dashboard. Recipients download them over HTTPS with curl, wget or a browser link.

This guide shows how to create a Files registry, upload a version, point a channel such as latest at it, and give recipients access. It also explains how the registry stores files and checks requests, so that you can find the cause of a failure. The guide is for release engineers and for teams that deliver software to customers.

The examples use the registry slug acme, the package acme-cli, the version 1.4.0 and the custom domain files.acme.com. Replace them with your values.

Before you start

  • To create a registry and to show the Files format, you must have the Admin role.
  • Your plan must have a free private registry slot. Starter has 1 private registry and Growth has 3. Scale and Platform have no registry limit.
  • You must have a hostname that you own for the registry, for example files.acme.com. The create form requires it.
  • You must have curl or wget. On Windows, use curl.exe, not the PowerShell alias.

How it works

Package, version and path

The registry stores each file as an object. Three values identify an object:

PartExampleRules
Packageacme-cliOne URL segment of 1 to 214 characters: letters, digits, dots, underscores, plus signs and hyphens.
Version1.4.01 to 128 characters with the same character set. Any scheme works, for example 2026.10 or build-381.
Pathlinux-amd64/acme-cli.tar.gzA relative path of up to 1024 bytes. Folders are allowed. Empty segments, .., backslashes and control characters are not allowed.

The first upload to a new package name creates the package. The first upload to a new version creates the version. A Files registry is private only, and package names are unique in each registry.

URL layout

Each Files registry has a slug. The slug is the first path segment on the shared Files host, files.privatenpm.com. After you verify a custom domain, the same registry also answers on that domain without the slug.

RequestPath after the host and slugResult
PUT/acme-cli/1.4.0/linux-amd64/acme-cli.tar.gzUploads one object.
GET/acme-cli/1.4.0/linux-amd64/acme-cli.tar.gzDownloads the object.
GETThe object path with .sha256 addedReturns the SHA-256 digest of the object as hex text.
GET/, /acme-cli/ or /acme-cli/1.4.0/Lists packages, versions or objects. Send Accept: application/json to get JSON.
PUT/acme-cli/-/latestPoints the channel latest at the version in the request body.
GET/acme-cli/-/latest/linux-amd64/acme-cli.tar.gzRedirects to the object in the version of the channel.
GET/-/dl/…Downloads one object with a short-lived link.

On the shared host, the full URL of the first row is https://files.privatenpm.com/acme/acme-cli/1.4.0/linux-amd64/acme-cli.tar.gz. On the custom domain, it is https://files.acme.com/acme-cli/1.4.0/linux-amd64/acme-cli.tar.gz.

Credentials

Every request needs a credential, except a request with a short-lived link. The registry reads HTTP Basic authentication. Any username works, and the password is the key. The registry also accepts the key as a Bearer token.

  • A publisher key (prt_…) can upload objects and set channels. It acts with the permissions of the member who created it.
  • A download key (pdk_…) can only list and download. It can never upload.
  • Each key works with one registry only.

The registry answers 401 when the credential is absent, unknown, revoked or expired. It answers 403 when a valid key cannot do the action. Examples are a download key on PUT, or a key without access to the package. It answers 404 when the object does not exist.

Digests and immutability

The registry calculates the SHA-256 digest of each object when it stores the bytes. The digest appears in the dashboard, in the JSON list, in the .sha256 response, and in the ETag and X-Checksum-Sha256 headers of each download.

An object never changes after the upload. These rules apply:

  • If you upload the same bytes to the same path again, the registry answers 200 and changes nothing. A new object gets 201.
  • If you upload different bytes to a path that exists, the registry answers 409 "object already exists".
  • You can add new paths to a version that exists. Paths that exist keep their bytes.
  • If you send the header X-Checksum-Sha256, the registry compares it with the bytes. A difference gives 400 and stores nothing.
  • The upload must have a Content-Length header. curl -T sends it for a file.

To replace a file, publish a new version. When an admin deletes a version, the version becomes a tombstone. Nobody can upload to that version string again.

Channels

A channel is a name that points at one version of a package, for example latest or stable. You can move a channel to another version at any time. A channel download answers 302 with a Location header that names the versioned object. The redirect has Cache-Control: no-cache, so clients always ask for the current target.

The registry does not create channels for you. If an admin deletes the version of a channel, the registry removes the channel. Channel downloads then answer 404 until you set the channel again.

Download cache and resume

A versioned download has Cache-Control: private, max-age=31536000, immutable, because the bytes at that URL never change. The registry supports single byte ranges, so curl -C - can continue a download that stopped. A client that sends If-None-Match with the current digest gets 304 Not Modified.

Create the registry

New organizations do not show Files in the navigation. The format switch changes only the menus. Registries, keys and downloads work when the switch is off.

  1. Open Organization → General. In Registry formats, find Files.
  2. Click Turn on. Files appears in the Registry menu.
  3. Open Registry → Registries and click New private registry.
  4. In Display name, type a name such as "Acme releases".
  5. In Format, select Files.
  6. If the form shows Package storage region, select a region. You cannot change the region later.
  7. In Registry hostname, type files.acme.com.
  8. Click Create and verify domain. The domain page opens with the DNS records.
  9. On the registry card, click Manage registry. In Slug, type acme and click Save.

The registry works on the shared Files host immediately. The domain verification guide explains the TXT record and the CNAME for the custom domain.

CAUTION: Change the slug before you give the URL to anyone. A new slug changes every URL on the shared Files host, and old URLs do not work.

Create the keys

The publisher key form of a Files registry shows only Files permissions. The form shows a permission only when your role allows it.

PermissionAPI valueResult
Read filesfiles:object:readThe key can list and download objects.
Upload filesfiles:object:writeThe key can upload objects and set channels.
Delete filesfiles:object:deleteThe key can delete versions. A release job does not need it.
  1. On the registry card, click Manage keys.
  2. Click New publisher key. In Name, type the name of the release job.
  3. In Publisher permissions, select Read files and Upload files.
  4. In Package access, select All packages. A restricted key cannot create a new package.
  5. Click Create publisher key. Copy the secret into the secret store of your CI system.
  6. For each recipient, click New download key. Select the recipient and type a Key name.
  7. In Access rule, select All packages in this registry or Selected packages.
  8. If you selected Selected packages, select each package that the recipient can download.
  9. Click Create download key. Copy the secret. The page also shows a curl command for the key.

A publisher key can also serve one package only. Clear All packages and select the package in Restrict to a package. That key can upload new versions of that package only.

NOTE: A package appears in Selected packages and Restrict to a package after its first upload. The management API accepts the same package IDs in packageIds.

Upload a version

Upload with curl

The examples read the publisher key from ACME_FILES_PUBLISH_TOKEN.

  1. Calculate the digest of the file: sha256sum dist/acme-cli.tar.gz.
  2. Upload the file with the digest in the X-Checksum-Sha256 header, as the example below shows.
  3. Make sure that the status is 201. The response body contains the sha256, the size and the url of the object.
  4. Open Registry → Files. The list shows the package, and the page of the package shows the version.
SHA=$(sha256sum dist/acme-cli.tar.gz | cut -d' ' -f1)
curl -fsS -T dist/acme-cli.tar.gz \
  -u "x:$ACME_FILES_PUBLISH_TOKEN" \
  -H "X-Checksum-Sha256: $SHA" \
  https://files.privatenpm.com/acme/acme-cli/1.4.0/linux-amd64/acme-cli.tar.gz

Upload from the dashboard

The dashboard uploads files to a package that exists. Use curl to do the first upload of a new package.

  1. Open Registry → Files and click the package.
  2. Click New version. In Version, type the version string.
  3. Drop files or a folder on the upload area. A folder keeps its relative paths.
  4. Click Create version. The version appears in Versions. Its page shows each path with its size and SHA-256 digest.
  5. To add files later, open the version page and click Add files.
  6. Drop the new files on the upload area and click Add to this version. Paths that exist must have the same bytes.

The browser sends the bytes directly to storage. Dashboard uploads follow the same immutability rules as curl.

Set a channel

  1. Open the version page of the version that the channel must name.
  2. In Channel, keep the name latest or type another name.
  3. Click Set channel. The channel appears with an arrow to the version, for example "latest → 1.4.0".

From a script, send the version string as the request body:

curl -fsS -X PUT --data-binary '1.4.0' -u "x:$ACME_FILES_PUBLISH_TOKEN" \
  https://files.privatenpm.com/acme/acme-cli/-/latest

The registry answers 204 No Content. The version must be live.

Download as a recipient

Send the recipient the download key and the URL. The recipient stores the key in ACME_FILES_TOKEN.

curl -fL -u "x:$ACME_FILES_TOKEN" -O \
  https://files.privatenpm.com/acme/acme-cli/1.4.0/linux-amd64/acme-cli.tar.gz

The -O option saves the file with its name. The -L option follows the redirect of a channel URL. Curl sends the credentials again because the redirect stays on the same host.

wget --user=x --password="$ACME_FILES_TOKEN" \
  https://files.privatenpm.com/acme/acme-cli/-/latest/linux-amd64/acme-cli.tar.gz

To verify the bytes, download the digest and compare it:

URL=https://files.privatenpm.com/acme/acme-cli/1.4.0/linux-amd64/acme-cli.tar.gz
echo "$(curl -fsS -u "x:$ACME_FILES_TOKEN" "$URL.sha256")  acme-cli.tar.gz" | sha256sum -c -

The command prints acme-cli.tar.gz: OK. On PowerShell, the Setup page shows the same commands with curl.exe and $env:KEY.

A short-lived link downloads one object with no key. Use it when the recipient needs one file one time, for example in a support case.

  1. Open the version page of the package.
  2. In the row of the object, click Copy link.
  3. In Expires, select 15 minutes, 1 hour, 1 day or 7 days.
  4. Click Create link. The page shows the link and the time when it stops.
  5. Copy the link. The page shows it only one time.

The link has the form https://files.privatenpm.com/acme/-/dl/…. The registry signs it with HMAC, so the link needs no database row. The recipient downloads it with curl -fOJ "LINK" or a browser.

WARNING: Send a short-lived link only to the intended person. Anyone who has the link can download the object until it expires, and you cannot revoke one link.

A link stops at its expiry time, or when an admin deletes the version. The audit log records each new link with its path and expiry, but not the link itself. The transfer log records link downloads under the member who created the link.

Publish from CI

This GitHub Actions workflow uploads every file in dist/ when you push a tag such as v1.4.0. Then it points latest at the new version. Store the publisher key as the secret ACME_FILES_PUBLISH_TOKEN.

name: Release files
on:
  push:
    tags: ["v*"]
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: make dist
      - name: Upload and move latest
        env:
          KEY: ${{ secrets.ACME_FILES_PUBLISH_TOKEN }}
          BASE: https://files.privatenpm.com/acme/acme-cli
        run: |
          VERSION="${GITHUB_REF_NAME#v}"
          for f in dist/*; do
            SHA=$(sha256sum "$f" | cut -d' ' -f1)
            curl -fsS -T "$f" -u "x:$KEY" -H "X-Checksum-Sha256: $SHA" \
              "$BASE/$VERSION/$(basename "$f")"
          done
          curl -fsS -X PUT --data-binary "$VERSION" -u "x:$KEY" "$BASE/-/latest"

The -f option makes curl exit with an error on a 4xx or 5xx status, so the job stops at the first failed upload. A job that runs again after a failure is safe. The registry answers 200 for files that it already has, and 409 only for changed bytes.

Verify the result

Do these steps on a machine that did not upload the files.

  1. List the version: curl -fsS -H "Accept: application/json" -u "x:$ACME_FILES_TOKEN" https://files.privatenpm.com/acme/acme-cli/1.4.0/. The JSON contains each path with its size and digest.
  2. Download one object through the channel with curl -fL -O. curl saves the file with its name.
  3. Compare the digest with sha256sum -c. The command prints "OK".
  4. Upload with the download key. The registry answers 403.
  5. Download with no credential. The registry answers 401.

Troubleshoot

SymptomCauseCorrection
401 UnauthorizedThe request has no password, or the key is unknown, revoked or expired.Examine the variable and the -u option. The key is the password.
403 Forbidden on uploadA download key, a key without Upload files, a key for another registry, or a restricted key that tried to create a package.Use a publisher key for this registry with Upload files and access to all packages.
The key form or the API refuses a permission that "belongs to another registry format".The request contains an npm or PyPI permission. A Files key accepts only Files permissions.Send only the files:object:… values from the permission table.
403 Forbidden on downloadThe key is for another registry, or its access rule does not include the package.Change the access of the download key, or create a key for this registry.
403 "invalid download link"The short-lived link expired, it is incomplete, or it is for another registry.Create a new link.
404 Not FoundThe slug, package, version or path is wrong, or an admin deleted the version.List the version with the JSON request and copy the path.
409 "object already exists"The path has different bytes, or the version is a tombstone.Publish a new version.
400 "invalid upload"The digest or the length does not match, or a name, version or path breaks the rules.Calculate the digest again and examine the characters in the URL.
411 "content-length required"The client sent the body without a length, for example from a pipe.Upload from a file with curl -T.
413The object is larger than the maximum size, or the plan has no free storage.Split the file, or change the plan.
A channel URL saves an empty file.curl did not follow the 302 redirect.Add the -L option.

Security and maintenance

  • Give each recipient and each system its own download key. Then you can revoke one of them alone.
  • Keep keys out of scripts that you send to recipients. Read keys from environment variables.
  • Use short-lived links for one file and one time. Use a download key for repeated or automated downloads.
  • Give keys an expiry date, and rotate the publisher key on a schedule.
  • Publish digests with your release notes, so that recipients can verify files from any source.
  • Examine Registry → Activity to see downloads by credential and recipient.
  • Use the audit log or webhooks to follow releases and changes. The events are files_package.published, files_package.updated and files_package.unpublished.

READY WHEN YOU ARE

Put private packages to work.