Vole docs Source

Cloud-init#

Requirements#

Account names are permanent

Choose the admin name before rendering the file. There is no rename command.

1. Render the first-boot file#

From the source checkout:

cd deploy/cloud-init

HOSTNAME=forge.example.com \
ADMIN_ACCOUNT=admin \
ADMIN_EMAIL=you@example.com \
ADMIN_SSH_KEY="$(cat ~/.ssh/id_ed25519.pub)" \
SSH_PORT=2222 \
VOLE_PACKAGE_URL=https://rodent.software/vole/releases/v0.2.0/artifacts/vole_0.2.0-1_amd64.deb \
  ./render.sh > user-data.yaml

This example uses Vole's own listener on 2222, matching the verification commands below. Set SSH_PORT=22 instead to put the system sshd in front of Vole and make clone URLs portless; Put sshd in front of Vole explains that choice.

Inspect user-data.yaml before giving it to a provider. It contains the public SSH key, package URL, and complete first-boot configuration.

Variable Default Purpose
HOSTNAME required DNS name used for public_url and passkeys
ADMIN_ACCOUNT required Permanent name of the first instance admin
ADMIN_SSH_KEY required That account's public key
VOLE_PACKAGE_URL required Debian package URL from the current stable release
ADMIN_EMAIL empty Contact address for the certificate authority
INSTANCE_NAME Vole Display name for this forge
TLS_MODE acme acme manages certificates; proxy serves loopback HTTP for your TLS proxy
SSH_PORT 2222 22 lets the system sshd authenticate and drops the port from clone URLs; anything else is Vole's own listener

For TLS_MODE=proxy, configure the proxy and client-IP header as described in Running behind a proxy.

2. Create the machine#

A small team can start with 2 vCPU, 4 GB of memory, and 40 GB of disk. Increase disk for large repositories, LFS objects, and CI artifacts. Give the server a public IPv4 address and enable provider backups.

Paste user-data.yaml into the provider's user-data field:

Provider Suggested image and size User-data location
Hetzner Cloud Ubuntu 24.04, CX22 Add Server → Cloud config
DigitalOcean Ubuntu 24.04 LTS x64, Basic 2 vCPU / 4 GB Create Droplet → Advanced options → User data
AWS Canonical Ubuntu 24.04 LTS, t3.medium, 40 GiB encrypted gp3 Launch instance → Advanced details → User data

On AWS, use a public subnet with auto-assigned public IPv4. Debian 13 is also supported on Hetzner and DigitalOcean. Provider names and console layouts can change; the requirement is an Ubuntu or Debian machine that accepts cloud-init user data.

3. Open the required ports#

Direction TCP port Allowed source Purpose
Inbound 22 Your administrators Shell access, and Git over SSH when sshd is the front door
Inbound 2222 People who push Vole Git over SSH when Vole's own listener serves it
Inbound 80 Anywhere ACME challenge and HTTPS redirect
Inbound 443 Anywhere Forge over HTTPS
Outbound any Package and certificate providers Installation and renewal

With SSH_PORT=22 there is no inbound 2222 to open: sshd already answers on 22, and Vole is reached only through it and over the local socket. Keep 2222 closed unless you also run the built-in listener.

Use the provider firewall or AWS security group. Hetzner and DigitalOcean servers can be open until a firewall is attached; AWS instances normally require inbound rules. For TLS_MODE=proxy, expose only the ports your arrangement needs and keep Vole's HTTP listener on loopback.

4. Point DNS at the server#

Create an A record for forge.example.com with the machine's public IPv4 address. Vole cannot obtain a certificate until this name resolves to the server.

Cloud-init runs only on first boot. Setup output is written to /var/log/vole-first-boot.log; service output is available with journalctl -u vole.

Editing user data after creation does not rerun cloud-init. Change /etc/vole/vole.toml and restart Vole for configuration updates:

sudo -e /etc/vole/vole.toml
sudo systemctl restart vole

5. Verify and enroll the admin#

Open https://forge.example.com. The first request can take a few seconds while Vole obtains its certificate.

From your computer, issue the admin's one-time passkey enrollment link:

vole admin --remote ssh://git@forge.example.com:2222 account invite admin

With SSH_PORT=22 the remote is ssh://git@forge.example.com — no port. The commands below use :2222 for the built-in listener shown in step 1; drop it for the front door.

Open the link in a private browser window and register a passkey. Then create and clone a repository:

vole admin --remote ssh://git@forge.example.com:2222 \
  repo create demo
vole admin --remote ssh://git@forge.example.com:2222 \
  acl set-default-role demo reader
git clone ssh://git@forge.example.com:2222/demo.git

Omit set-default-role if demo should remain private.

Put sshd in front of Vole (optional)#

Choosing SSH_PORT=22 in step 1 puts the system sshd on port 22 and configures Vole to answer over a local socket. Clone URLs lose :2222, sshd owns the host key that clients verify, and runners must pin that key instead of Vole's.

A fresh cloud-init instance#

Set SSH_PORT=22 in the complete render command from step 1. The rendered file adds ssh_listen = "socket", appends the sshd include on first boot, and removes the port from generated clone URLs. Runners must use ssh://git@forge.example.com and pin sshd's host key rather than Vole's.

Set up a runner with cloud-init#

From a Vole source checkout on your computer:

1. Render the runner's first-boot configuration#

cd deploy/cloud-init
FORGE_HOST=forge.example.com \
SSH_PORT=2222 \
VOLE_PACKAGE_URL=https://rodent.software/vole/releases/v0.2.0/artifacts/vole_0.2.0-1_amd64.deb \
  ./render.sh runner > runner-user-data.yaml

Use the same SSH_PORT as the forge: 22 for its sshd front door, 2222 for Vole's own listener. The rendered runner takes its remote and its ssh-keyscan from it, so a mismatch fails the first lease.

render.sh requires envsubst, provided by gettext-base on Debian and Ubuntu or gettext on other distributions. Inspect the rendered file before using it.

2. Create the runner machine#

Create a machine with your provider and paste runner-user-data.yaml into its user-data or cloud-config field. Use the same Ubuntu or Debian image and package architecture. Allow inbound shell SSH on port 22 only from your addresses; the runner makes outbound connections to the forge and container registries.

Size memory for RUNNER_JOBS × RUNNER_MEMORY. Leave additional room for the runner and host, and size disk for saved checkouts, caches, and OCI images. Image storage is bounded by the runtime's own prune: --image-max-age (default 168h) sets the age, 0 keeps every image, and --container-pull never keeps every tagged image because that runner cannot fetch one again.

3. Wait for first boot#

Setup output is in /var/log/vole-runner-first-boot.log on the runner. The configuration creates an unprivileged ci-runner user, installs rootless Podman, generates the runner's SSH key, pins the forge's host key, and enables the service.

First boot pins the first host key returned by ssh-keyscan. Before allowing production jobs, compare /etc/vole/runner_known_hosts with the forge's host key fingerprint through a trusted channel. Replace the file if it does not match.

Runner cloud-init settings#

Variable Default Purpose
FORGE_HOST required Forge DNS name; SSH_PORT decides what SSH means
SSH_PORT 2222 22 reaches the instance through its sshd, with no port in the remote
VOLE_PACKAGE_URL required Debian package URL from the current stable release
RUNNER_HOSTNAME vole-runner Machine host name
RUNNER_RUNTIME podman OCI runtime
RUNNER_NETWORK bridge Maximum network offered to jobs
RUNNER_DIR /var/lib/vole-runner Checkouts, caches, and runner home
RUNNER_LABEL_NAMES linux Space-separated labels matched by runs-on
RUNNER_JOBS 1 Concurrent job slots
RUNNER_MEMORY 4G Memory limit per job container
RUNNER_PIDS 2048 Process limit per job container
RUNNER_TMPFS 1G Memory-backed /tmp size per job
RUNNER_DISK_RESERVE 2G Free space preserved below RUNNER_DIR

The unit's MemoryMax=90% is a host-level backstop, not a replacement for per-job limits. Running several jobs at once explains how to size concurrent slots.

Register and authorize the runner under Runners.

Next#

↑↓ to move Enter to open Esc to close