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

# Images

> Build, upload, and manage custom images

An image is the bootable disk template your instance runs from. Boot from an SF Compute base image
with common configurations, or upload your own custom image.

Every image has an `id` like `image_2KvMb9NpQs5` and a human-readable `name` like
`ubuntu-22.04-cuda-12.4` or `training-base`. Each image also has `is_public`, which is `true` for SF
Compute base images and `false` for images you upload.

A name identifies a sequence of immutable versions, starting at 1. The `id` always refers to one
exact build, and the bits behind an id never change. Uploading an existing name creates the next
version.

> [!WARNING]
>
> Image versions, version pinning, and the deprecated lifecycle state are in
> [public preview](https://docs.sfcompute.com/preview/roadmap.md#feature-states) and live on the `/preview/v2` API only. The `/v2`
> image endpoints return no `version` or `deprecated_at` field, do not accept `all_versions`, and
> reject the `name@<version>` pin form. `sf` calls the preview endpoints, so every CLI example on
> this page works as written.

## Listing images

List all images available to you, including SF Compute's public images.

```bash theme={null}
sf images list
```

```text theme={null}
----------------------------------------------------------------------------------------
NAME                                               VISIBILITY  STATUS     CREATED
ubuntu-jammy-custom                                private     completed  Mar 27, 2:00pm
sfc:image:sfcompute:public:ubuntu-24.04-cuda-13.2  public      completed  Feb 23, 6:50pm
```

The CLI lists images outside the active workspace, including SF Compute's public images, by their
full resource path.

By default the list shows one entry per name: the latest active version. Pass `--all-versions` to
see every version with its lifecycle state, including a `VERSION` column.

## Using an image

Pass an image name, ID, or resource path when creating an instance.

```bash theme={null}
sf instances create --pool dev --image ubuntu-jammy-custom
```

If you omit `--image`, the CLI presents an interactive picker showing all completed images available
to you.

Referencing an image by name resolves to the latest active version at creation time, so new
instances automatically pick up updated builds. To pin one exact build, reference it by id, or
append `@<version>` to the name.

```bash theme={null}
sf instances create --pool dev --image ubuntu-jammy-custom@2
sf instances create --pool dev --image image_abc123
```

Both pin forms mean the same thing: exactly this build, even after newer versions appear. Both may
launch a version that has since been deprecated, while revoked versions never launch. Ids don't
take the suffix, since an id already names one exact build. `sf images get ubuntu-jammy-custom@2`
inspects a pinned version.

The instance stores the concrete image id it booted from either way, so `sf instances get` always
tells you exactly which build an instance is running.

[Instance templates](https://docs.sfcompute.com/preview/instance-templates.md) resolve the name once, when the template is
created, so every instance launched from a template boots the same build.

## Uploading an image

Upload a raw disk image with `sf images upload`. The CLI uploads the image in parts, reports
progress as it goes, and verifies integrity with a SHA256 checksum. The maximum image size is 75
GiB. Custom images stay in your workspace.

```bash theme={null}
sf images upload \
  --name ubuntu-jammy-custom \
  --file output/ubuntu_jammy.raw
```

If you omit `--file` or `--name`, the CLI prompts you interactively.

Uploading a file under an existing name never overwrites anything. It creates the next version, and
the name starts resolving to it once the upload completes.

For large images, tune the number of parallel part uploads with `--concurrency`. The default is your
machine's CPU count.

```bash theme={null}
sf images upload \
  --name ubuntu-jammy-custom \
  --file output/ubuntu_jammy.raw \
  --concurrency 4
```

## Image requirements

SF Compute supports UEFI amd64 (x86\_64) raw images. We do not support qcow2.

Custom images should resize themselves at boot to fill the disk available to the instance.

Our [example Packer repository](https://github.com/sfcompute/packer_example/) builds a compatible
image. It offers two starting points, an SF Compute base image or a stock Ubuntu cloud image, and
its README carries the instructions.

Start from an SF Compute base image where you can. Each one already pairs a CUDA version with an
NVIDIA server driver that supports it, so you add your own software on top rather than working out
which driver a given toolkit needs.

Custom images must have drivers for both
virtio-net (PCIe vendor 0x1af4, product 0x1041) and
mlx5Gen Virtual Function (PCIe vendor 0x15b3, product 0x101e) for networking.
They must also have cloud-init installed with its network configuration step enabled so networking
comes up at boot.

## Image lifecycle

An upload moves through `started` → `uploading` → `completed` (or `failed`). Only completed images
can back instances.

Completed images additionally carry a catalog state.

An active image is the default state: listed, resolvable by name, and launchable. A deprecated
image is no longer the active version and will eventually be removed. It stops resolving by bare
name and leaves the default listing, but an explicit pin (image id or `name@<version>`) can still
launch it, and instances already running on it are unaffected. `sf images list --all-versions`
shows deprecated versions with status `deprecated`. A revoked image can no longer back new
instances, by name or by id, though instances already running on it are unaffected.

## Revoking an image

Revoke an image to stop new instances from using it. Existing instances keep running.

```bash theme={null}
sf images revoke ubuntu-jammy-custom
```

The command prompts for confirmation. Pass `--yes` to skip it.

Reinstate a revoked image to make it usable again.

```bash theme={null}
sf images reinstate ubuntu-jammy-custom
```

## Deleting an image

Delete an image to remove it permanently. Unlike a revoked image, a deleted image cannot be
reinstated. You cannot delete an image while an active instance uses it.

```bash theme={null}
sf images delete ubuntu-jammy-custom
```

The command prompts for confirmation. Pass `--yes` to skip it.

## SFC base images

SF Compute publishes base images named `ubuntu-<lts>-cuda-<major.minor>`, for example
`ubuntu-24.04-cuda-13.4`. The matrix covers the two newest Ubuntu LTS releases crossed with the two
newest CUDA versions. When a newer CUDA or LTS ships, it replaces the oldest; a name that leaves the
matrix stops receiving updates but stays launchable, and leaves the catalog a year after its last
update. A few older names carry the Ubuntu point release, like `ubuntu-22.04.5-cuda-12.7`.
`sf images list` shows every current name.

Each base image ships an NVIDIA server driver that supports its CUDA version, the CUDA development
libraries, and cloud-init.

Each name tracks its latest build. When NVIDIA ships a new CUDA patch release, or a driver or OS
point release lands, SF Compute republishes the same names, and each republish appears as a new
version. Instances created by name pick up the latest version automatically, while running
instances keep the exact image they booted from. If your workload needs one exact build, pin it by
image id or by version, like `ubuntu-24.04-cuda-13.4@3`.

Older versions of a base image are deprecated once superseded. A deprecated version leaves name
resolution and the default listing but still launches by pinned id or `name@<version>`. Versions
deprecated for a long time are eventually revoked, which blocks new launches without touching
running instances. Base image versions are never deleted.

### Downloading a base image

Building on top of a base image means fetching that image first. Our
[example Packer repository](https://github.com/sfcompute/packer_example/) does that for you, and
its README covers choosing a release, pinning one, and verifying the download. Those details live
there so they stay correct as the build changes.

## API reference

See the [Images API](https://docs.sfcompute.com/api-reference/images/list-images.md) for programmatic access.
