Pull Linux packages with apt
An apt proxy puts a Debian or Ubuntu archive behind your organization’s CloudRepo host. apt reads it as a source. The token stays in a file only root can read, never in a URL.
Create an apt proxy
Section titled “Create an apt proxy”In the admin portal, create a repository with apt as the Format and Proxy as the Kind. Then pick the archive it reads from:
deb.debian.org/debian: Debiansecurity.debian.org/debian-security: Debian security updatesarchive.ubuntu.com/ubuntu: Ubuntu (amd64 and i386)security.ubuntu.com/ubuntu: Ubuntu security updates (amd64 and i386)ports.ubuntu.com/ubuntu-ports: Ubuntu for arm64 and other architecturesdownload.docker.com/linux/ubuntu: Docker for Ubuntudownload.docker.com/linux/debian: Docker for Debian
One apt proxy reads one archive.
You also need a repository token that covers the proxy. Repository Tokens shows how to make one. apt’s login is the email address of the account that made the token, and its password is the token.
Set up apt
Section titled “Set up apt”Start with CA certificates:
sudo apt-get update && sudo apt-get install -y ca-certificatesapt needs CA certificates to open an https source. Many container images, ubuntu:24.04 among them, ship without
them.
Save the credentials as root, in /etc/apt/auth.conf.d/cloudrepo-your-repo.conf. Each repository gets its own
file, so a host with several CloudRepo repositories keeps every token:
machine your-org.mycloudrepo.io/repositories/your-repo/login you@example.compassword YOUR_REPOSITORY_TOKENNow add the source. Save one line as root in /etc/apt/sources.list.d/cloudrepo-your-repo.list. Pick the line for the archive your proxy reads.
Ubuntu
Section titled “Ubuntu”For archive.ubuntu.com/ubuntu and ports.ubuntu.com/ubuntu-ports:
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://your-org.mycloudrepo.io/repositories/your-repo noble mainFor security.ubuntu.com/ubuntu:
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://your-org.mycloudrepo.io/repositories/your-repo noble-security mainDebian
Section titled “Debian”For deb.debian.org/debian:
deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] https://your-org.mycloudrepo.io/repositories/your-repo trixie mainFor security.debian.org/debian-security:
deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] https://your-org.mycloudrepo.io/repositories/your-repo trixie-security mainDocker
Section titled “Docker”For download.docker.com/linux/ubuntu:
deb [signed-by=/etc/apt/keyrings/docker.asc] https://your-org.mycloudrepo.io/repositories/your-repo noble stableFor download.docker.com/linux/debian:
deb [signed-by=/etc/apt/keyrings/docker.asc] https://your-org.mycloudrepo.io/repositories/your-repo trixie stableapt checks the archive’s signature with Docker’s own key, at /etc/apt/keyrings/docker.asc on a host that installed Docker from Docker’s archive. On a new host, Docker’s install guide saves the key there. CloudRepo serves Docker’s signed files unchanged.
noble is Ubuntu 24.04 and trixie is Debian 13. If you use another release, replace noble or trixie with its name. apt checks the archive’s signature with the key your host already has.
Refresh apt
Section titled “Refresh apt”Make the credentials file readable by root alone, then refresh apt:
sudo chmod 600 /etc/apt/auth.conf.d/cloudrepo-your-repo.confsudo apt-get updateInstall a package
Section titled “Install a package”Now install a package. This line installs jq:
sudo apt-get install -y jqPut the package you need in its place. The -y flag answers apt’s prompt for you, so the line also runs in a
script.
From a proxy of Docker’s archive, put docker-ce-cli in its place to install Docker’s command-line client.
Keep signature checks on
Section titled “Keep signature checks on”Leave signature checks at apt’s defaults. Do not set trusted=yes or pass --allow-unauthenticated.