Skip to content

Standalone

Standalone mode runs the whole Gradient stack on one machine. This setup suits personal projects and evaluation. Server, web UI, PostgreSQL and worker all live in a single container or VM.

Requirements:

  • Docker on Linux, macOS or Windows, or Nix on Linux with KVM
  • 8 GiB RAM and 20 GiB free disk

1. Start Gradient

docker run -dt --name gradient \
  --privileged --cgroupns=host \
  -p 127.0.0.1:8080:80 \
  -v gradient:/var/lib \
  ghcr.io/wavelens/gradient-standalone

Run the container with --privileged. Systemd and the Nix build sandbox both run inside it and need that flag. The boot output does not appear in docker logs. Step 2 shows the password in its tabs. The port binds to 127.0.0.1 only. The gradient volume stores projects, the cache and every build across a restart.

nix run github:wavelens/gradient/latest#standalone

This runs a QEMU VM in the terminal with a root login. Projects, the cache and every build persist in the disk image gradient.qcow2 in the current directory across a restart. Press Ctrl-a x to stop the VM. The run script can rebuild the image of the VM's Nix store before every boot. A startup can take longer than a plain VM.

Image Provenance

Release images come with a signed build provenance and an SBOM. The GitHub CLI can verify the provenance against the repository.

gh attestation verify oci://ghcr.io/wavelens/gradient-standalone:latest -R wavelens/gradient

The first boot can take a minute. PostgreSQL has to initialize, and Gradient generates its secrets.

2. Log In

The boot steps in Gradient create a random password for the admin account at first boot. They write that password once on the next line.

Gradient is running at http://localhost:8080 - log in with admin / <password>

Later starts show a file name instead of the password. Run one of the commands below to read the current password directly from disk.

docker exec gradient cat /var/lib/gradient-standalone/admin-password
cat /var/lib/gradient-standalone/admin-password

Then open http://localhost:8080 and sign in as admin. New users cannot register themselves.

3. Build a Repository

Set up a cache, a project and a task by following First Project from step 2 onward. The standalone instance's worker joins each new project automatically.

Private Repositories

On the Git host, register the project's public SSH key from Settings -> SSH Key as a deploy key.

Git Hosts on Private Addresses

Gradient can connect only to Git hosts on public addresses. Environment variables in the /var/lib/gradient-standalone/server-environment file on the volume define server settings, one NAME=value per line. Gradient can read that file at each server start. Add the line below to allow Git hosts on the Docker bridge network 172.17.0.0/16.

docker exec gradient sh -c 'echo GRADIENT_OUTBOUND_ALLOWED_NON_PUBLIC_NETWORK_TARGETS=172.17.0.0/16 \
  >> /var/lib/gradient-standalone/server-environment && systemctl restart gradient-server.service'

Verify Deployment

  • The login page loads at http://localhost:8080.
  • The evaluation page lists the builds as completed once the first evaluation has run.

Upgrade

docker pull ghcr.io/wavelens/gradient-standalone
docker rm -f gradient

Start the container again with the command from step 1. All data stays in the gradient volume.

nix run github:wavelens/gradient/latest#standalone --refresh

Warning

The standalone instance uses plain HTTP, a single worker and no backups. To run it for a team, deploy with the NixOS module from the Quick Start.

Next Steps