> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fibre.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Private registries

> Store a registry login once, then start sandboxes from your private images on GitHub, Docker Hub or your own registry, without putting credentials in every request.

A **registry** is a place where images are stored, such as Docker Hub or GitHub Container Registry. Public images
can be used by anyone, but your own images, such as your app or your agent's toolchain, often live in a **private
registry** that needs a login.

Fibre lets you store that login **once for each registry**. After that, every sandbox in your account can start
from your private images, and you never need to send the credentials when you create a sandbox.

## Store a login

Fibre only ever downloads images, so give it a token that can **read packages and nothing more**. That way, the
token cannot be used to change your images even if it leaked. Store the login like this:

```typescript title="TypeScript" run theme={null}
import { Fibre } from "@fibre-dev/sdk";

const fibre = new Fibre();
await fibre.json("PUT", "/v1/registries/ghcr.io", {
  body: { username: "acme-bot", password: process.env.GHCR_TOKEN ?? "ghp_example_token" },
});
```

```python title="Python" run theme={null}
import os

from fibre import Fibre

fibre = Fibre()
fibre.json("PUT", "/v1/registries/ghcr.io", json={"username": "acme-bot", "password": os.environ.get("GHCR_TOKEN", "ghp_example_token")})
```

```bash title="curl" run theme={null}
curl -sS -X PUT "$FIBRE_API_URL/v1/registries/ghcr.io" \
  -H "Authorization: Bearer $FIBRE_API_KEY" -H "Content-Type: application/json" \
  -d "{\"username\": \"acme-bot\", \"password\": \"${GHCR_TOKEN:-ghp_example_token}\"}"
```

> [accordion] Response
>
> ```json title="response" expected theme={null}
> {
>   "registry": "ghcr.io",
>   "username": "acme-bot",
>   "created_at": "…"
> }
> ```

What to use for each registry:

| Registry | Name in the path | Username | Password |
| - | - | - | - |
| GitHub Container Registry | `ghcr.io` | Your GitHub user or bot | A token with `read:packages` |
| Docker Hub | `docker.io` | Your Docker Hub user | An access token |
| Your own | `registry.acme.dev`, `registry.acme.dev:5000` | As your registry expects | As your registry expects |

If you store a login again for the same registry, it replaces the old one. The answer is then `200` instead of
`201`.

## Use your images

Now name your private image as you would with `docker pull`. Fibre sees which registry it comes from and uses the
login you stored:

```bash title="CLI" norun reason="needs an image in your own private registry" theme={null}
fibre create --image ghcr.io/acme/agent-toolchain:1.4 --process-ready
```

```typescript title="TypeScript" norun reason="needs an image in your own private registry" theme={null}
import { Sandbox } from "@fibre-dev/sdk";

const sbx = await Sandbox.create({ image: "ghcr.io/acme/agent-toolchain:1.4", ready: "process" });
```

```python title="Python" norun reason="needs an image in your own private registry" theme={null}
from fibre import Sandbox

sbx = Sandbox.create(image="ghcr.io/acme/agent-toolchain:1.4", ready="process")
```

```bash title="curl" norun reason="needs an image in your own private registry" theme={null}
curl -sS -X POST "$FIBRE_API_URL/v1/sandboxes" \
  -H "Authorization: Bearer $FIBRE_API_KEY" -H "Content-Type: application/json" \
  -d '{"image": "ghcr.io/acme/agent-toolchain:1.4", "ready": "process"}'
```

## See and remove logins

You can see which registries have a stored login, the username, and when each login was last used. **The password
is never shown again** by any call. To remove a login, delete it:

```typescript title="TypeScript" run theme={null}
const { registries } = await fibre.json<{ registries: { registry: string; username: string }[] }>("GET", "/v1/registries");
console.log(registries); // [ { registry: 'ghcr.io', username: 'acme-bot', … } ]

await fibre.json("DELETE", "/v1/registries/ghcr.io");
```

```python title="Python" run theme={null}
registries = fibre.json("GET", "/v1/registries")["registries"]
print(registries)  # [{'registry': 'ghcr.io', 'username': 'acme-bot', …}]

fibre.json("DELETE", "/v1/registries/ghcr.io")
```

```bash title="curl" run theme={null}
curl -sS "$FIBRE_API_URL/v1/registries" -H "Authorization: Bearer $FIBRE_API_KEY"
echo
curl -sS -X DELETE "$FIBRE_API_URL/v1/registries/ghcr.io" -H "Authorization: Bearer $FIBRE_API_KEY"
```

> [accordion] Response
>
> ```json title="response" expected theme={null}
> {
>   "registry": "ghcr.io",
>   "deleted": true
> }
> ```
>
> The list, before the login was deleted, looked like this:
>
> ```json title="list" theme={null}
> {
>   "registries": [
>     {
>       "registry": "ghcr.io",
>       "username": "acme-bot",
>       "created_at": "2026-11-21T02:10:44.118Z",
>       "last_used_at": null
>     }
>   ]
> }
> ```

## How the login is kept

Fibre treats stored logins as secrets:

* **They are encrypted when stored**, and never shown again after you save them.
* **They are only used to download an image** from that registry, when a sandbox starts from one.
* **Each account has one login per registry.** If different teams need different logins, give them separate
  accounts, or use a shared bot account at the registry.

> [!TIP]
>
> To change the token, create a new one at the registry and store it here. The next download uses it. If you ever
> need to cut off access at once, revoke the token at the registry.

## Errors

These errors relate to registries:

| Status | Code | When |
| - | - | - |
| 400 | `image_registry_refused` | The registry's address is not one Fibre may reach |
| 400 | `validation_failed` | `username` or `password` missing |
| 403 | `image_access_denied` | The registry refused the stored login for that image |
| 404 | `image_not_found` | No such image or tag in the registry |

## Related

> [card] [Images and builds](https://docs.fibre.dev/setup/images.md)
>
> Or build the image on Fibre, with no registry at all.

> [card] [Snapshots](https://docs.fibre.dev/setup/snapshots.md)
>
> Start new sandboxes from a prepared one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.