# Pull Linux packages with apt

> Create an apt proxy in CloudRepo, then point apt at it with a root-only credentials file. Signature checks stay on.

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.

> **Early access:** apt proxy repositories are in early access. An apt repository is a proxy for now.

## Create an apt proxy

In the [admin portal](https://admin.cloudrepo.io), create a repository with **apt** as the **Format** and **Proxy** as the **Kind**. Then pick the archive it reads from:

- `deb.debian.org/debian`: Debian
- `security.debian.org/debian-security`: Debian security updates
- `archive.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 architectures
- `download.docker.com/linux/ubuntu`: Docker for Ubuntu
- `download.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](/docs/authenticate/repository-tokens.html) 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

Start with CA certificates:

**Terminal**

```bash
sudo apt-get update && sudo apt-get install -y ca-certificates
```

apt 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:

`cloudrepo-your-repo.conf`

```ini
machine your-org.mycloudrepo.io/repositories/your-repo/
login you@example.com
password YOUR_REPOSITORY_TOKEN
```

Now 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

For `archive.ubuntu.com/ubuntu` and `ports.ubuntu.com/ubuntu-ports`:

`cloudrepo-your-repo.list`

```ini
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://your-org.mycloudrepo.io/repositories/your-repo noble main
```

For `security.ubuntu.com/ubuntu`:

`cloudrepo-your-repo.list`

```ini
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://your-org.mycloudrepo.io/repositories/your-repo noble-security main
```

### Debian

For `deb.debian.org/debian`:

`cloudrepo-your-repo.list`

```ini
deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] https://your-org.mycloudrepo.io/repositories/your-repo trixie main
```

For `security.debian.org/debian-security`:

`cloudrepo-your-repo.list`

```ini
deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] https://your-org.mycloudrepo.io/repositories/your-repo trixie-security main
```

### Docker

For `download.docker.com/linux/ubuntu`:

`cloudrepo-your-repo.list`

```ini
deb [signed-by=/etc/apt/keyrings/docker.asc] https://your-org.mycloudrepo.io/repositories/your-repo noble stable
```

For `download.docker.com/linux/debian`:

`cloudrepo-your-repo.list`

```ini
deb [signed-by=/etc/apt/keyrings/docker.asc] https://your-org.mycloudrepo.io/repositories/your-repo trixie stable
```

apt 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

Make the credentials file readable by root alone, then refresh apt:

**Terminal**

```bash
sudo chmod 600 /etc/apt/auth.conf.d/cloudrepo-your-repo.conf
sudo apt-get update
```

## Install a package

Now install a package. This line installs `jq`:

**Terminal**

```bash
sudo apt-get install -y jq
```

Put 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

Leave signature checks at apt’s defaults. Do not set `trusted=yes` or pass `--allow-unauthenticated`.

---

The page: https://www.cloudrepo.io/docs/consume/apt.html
