Self-host Rollout

This page takes you from an empty host to a production installation on HTTPS, with a first owner and, for business use, an active license. The hosted service runs all of this for you, so nothing here applies to it.

Free personal use and licensed Business use run the same image and the same install. There's no edition flag: runtime permissions and providers are separate settings.

Choose how to run

Option Use it when You supply
Docker Compose One host and one trust domain. This is the supported single-host install Docker, 2 HTTPS hostnames, a mail provider
Kubernetes Workspaces must not share a process, so they need separate runtime pools Your own application, database and migration manifests. The repository ships none

The rest of this page covers Compose. Run without Compose lists what changes elsewhere.

Before you start

  • Docker Engine with the Compose v2 plugin, Git and Python 3.
  • A hostname for the app and one for file storage, each with a TLS certificate at a reverse proxy. Apps need a third, on a separate registrable domain: see Turn on Apps.
  • An outbound mail provider with a permitted sender. Registration, invitations and magic-link sign-in depend on delivered mail, and a production release refuses to boot without a mail transport.
  • A release image from your Rollout distribution, or the source to build one.

Install

Clone your copy of the repository:

git clone <your Rollout repository URL>
cd rollout.dev

Generate the environment files, then start the stack:

export PHX_HOST=rollout.example.com
export STORAGE_PUBLIC_HOST=files.example.com
export ROLLOUT_IMAGE=<registry>/<image>:<release-sha>
export MAIL_FROM_ADDRESS=rollout@example.com
export MAIL_FROM_NAME=Rollout
export SMTP_RELAY=smtp.example.com
# If the relay needs authentication, supply SMTP_USERNAME and SMTP_PASSWORD together.
# Apps stay off without this. See Turn on Apps.
export SANDBOX_HOST=apps.example-content.com
# Addresses allowed into the Operator console, which denies everyone without this.
export OPERATOR_EMAILS=you@example.com
./scripts/self-host-init.sh
docker compose --env-file .env.selfhost up -d --no-build

ROLLOUT_IMAGE must name a release, a commit or a digest. The initializer rejects main and latest.

To build the image from your checkout, skip ROLLOUT_IMAGE and run:

./scripts/self-host-init.sh --source
docker compose --env-file .env.selfhost -f compose.yaml -f docker/compose.source.yaml build rollout app-build
docker compose --env-file .env.selfhost up -d --no-build

Compose waits for PostgreSQL, creates the storage bucket, verifies the integration catalog, runs migrations, then starts Rollout. The compute service runs the same image and doesn't wait for migrations. Migrations also seed the feature flags and the managed model catalog, and they're safe to repeat.

Keep the environment files

The initializer writes .env.selfhost and .env.compute with mode 0600, and Git ignores both. It refuses to overwrite either one.

Warning

Back both files up in a secret manager. ROLLOUT_SECRETS_KEY in .env.selfhost decrypts stored credentials, so it's durable data. If you lose these files, restore them from backup. Running the initializer again generates new keys that can't read the retained database.

Put TLS in front

Rollout and the object store bind to loopback, so only your proxy needs an external listener. PostgreSQL, compute and the Docker API have no published ports.

Hostname Forward to Notes
PHX_HOST 127.0.0.1:4000 HTTP and WebSockets. Preserve the Host header and set X-Forwarded-Proto: https
STORAGE_PUBLIC_HOST 127.0.0.1:9000 Preserve the Host header and don't rewrite paths. Presigned URLs must reach this exact host
SANDBOX_HOST 127.0.0.1:4010 Only with Apps turned on. Preserve the Host header. Without this route, an App frame is blank with no message

The object store console on 127.0.0.1:9001 is for operators only. A proxy running in a container needs a private network route to these services, because the loopback bindings aren't reachable from another container.

For nginx, the app host needs:

proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Client addresses behind a proxy

Sign-in, registration, OAuth and public-page rate limits, audit records and the webhook request.ip value all use the client address. ROLLOUT_TRUSTED_PROXY_HOPS says where that address sits in X-Forwarded-For, counted from the right. The initializer writes 1 for the single proxy this install puts in front of the app.

Proxy Configuration
nginx proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Caddy reverse_proxy sets it by default
Traefik Sets it by default

Use 0 only when clients reach the app directly. Add 1 for each further proxy that appends an entry, so a CDN in front of your proxy makes it 2. A proxy that passes the client's header through unchanged lets every client pick its own address, which defeats the rate limits.

Set up mail

SMTP is the default: port 587 with mandatory STARTTLS, the OS trust roots and hostname verification. SMTP_SSL=true uses implicit TLS on port 465 with the same checks. Only a trusted private relay should set SMTP_TLS=never.

For SES, set MAIL_ADAPTER=ses, MAIL_FROM_ADDRESS, AWS_REGION, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY before you run the initializer. Configure DNS and production sending access with your provider, then check real delivery to a recipient outside any provider sandbox.

A missing relay or sender, partial credentials or invalid TLS settings stop boot. See Configuration for every mail variable.

Google sign-in is optional. Supply GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to the initializer, or add them to .env.selfhost later, and register https://<PHX_HOST>/auth/google/callback with Google. Without them, the sign-in page offers email and password. Google sign-in works only while registration is open, so it stops when the first owner confirms. After that, people who registered through Google sign in with an emailed link, unless you open registration. Rollout refuses a Google account whose address Google hasn't verified, so that account can't sign in or close registration.

Create the first owner

  1. Open https://<PHX_HOST>/users/register.
  2. Enter your address under Work email and choose Continue.
  3. Follow the sign-in link in your inbox.
  4. Finish onboarding: Workspace, First rollout and Team. Whoever creates a workspace is its Owner.

The generated environment sets ROLLOUT_BOOTSTRAP_REGISTRATION=true, which opens registration at migration time if the database has no human users. Registration closes by itself when the first person confirms their address, and that person becomes the first owner, so restrict access to the host until you've done this. A mistyped address doesn't close it, so you can start again.

After that, add people from Settings › Members. An invitation doesn't need open registration.

Reopen registration from the host

If someone else confirmed first and you have no account, Open registration is out of reach, because it needs a sign-in. Setting ROLLOUT_BOOTSTRAP_REGISTRATION again does nothing either, because it only opens a database with no human users. A shell on the host needs neither:

docker compose --env-file .env.selfhost exec rollout bin/rollout rpc 'FunWithFlags.enable(:alpha)'

Then register at /users/register. You get your own workspace. The person who confirmed first keeps theirs, and nothing here removes their account.

Registration stays open after you confirm, because only the first address to confirm closes it. Close it yourself:

docker compose --env-file .env.selfhost exec rollout bin/rollout rpc 'FunWithFlags.disable(:alpha)'

Warning

These commands come from the code and haven't been run on a release, so check that /users/register shows the form after the first one and refuses after the second.

Open registration

To let anyone who reaches the host create an account and their own workspace, turn registration back on. This needs a sign-in. With no account yet, reopen it from the host.

  1. If you didn't give the initializer OPERATOR_EMAILS, add your address to .env.selfhost, then restart:

    OPERATOR_EMAILS="you@example.com"
    
    docker compose --env-file .env.selfhost up -d --no-build
    
  2. Open the workspace menu, choose Operator console, open Flags and enable alpha.

Disable alpha to close it again. Existing users can still sign in, and later migrations keep your choice.

Activate a license

Without a signed ROLLOUT_LICENSE, the installation uses the Free plan. To activate one, supply it to the initializer, or add it to .env.selfhost later and restart with up -d --no-build. Keep the existing keys.

License says which uses need one and how to check the result.

Turn on Apps

Apps need a second origin. Without SANDBOX_HOST, you can build an App, and it shows "Widgets are not available on this deployment." when it opens. The initializer says so when you leave it out.

  1. Pick a hostname on a separate registrable domain. A subdomain of the app's domain shares its cookies and defeats the isolation, so the initializer refuses one, and it can only catch the cases it can prove. apps.example.com beside rollout.example.com passes that check and is still unsafe.

  2. Supply SANDBOX_HOST to the initializer, or add it to .env.selfhost.

  3. Add a TLS proxy for that hostname that forwards to 127.0.0.1:4010, then restart with up -d --no-build. Compose publishes that port on loopback.

  4. Put the compiler image on the Docker host. With Native off, Apps compile in a container from an image paired with your release. Rollout sends no registry credentials, so it can't fetch that image from a registry that needs a sign-in. Run docker login for the registry that serves ROLLOUT_IMAGE, then:

    image=$(docker compose --env-file .env.selfhost run --rm --no-deps -T migrate \
      bin/rollout eval "RolloutRelease.app_build_image()" | tail -n 1)
    docker pull "$image"
    

    The first command asks the release which image it builds with: the app-build image beside ROLLOUT_IMAGE, tagged with the release's commit. That tag changes with every release, so each upgrade pulls a new one.

An image you built from source carries no release commit to match a compiler image against, so skip step 4. --source sets ROLLOUT_APP_BUILD_IMAGE to the app-build image you built with it. See App builds.

Set up AI

The embedded model catalogue includes featured models for chat, workflows and retrieval. Configure a provider key before using them. The provider bills the account behind that key, and Rollout records measured usage and a cost estimate when a reference rate is available.

A workspace admin can choose the default under Settings › AI models. The selection shows the current target for each featured alias. For an exact provider release, choose a version pin. Additional account-visible models become selectable after a consented text probe on that connection.

Everyday commands

docker compose --env-file .env.selfhost ps
docker compose --env-file .env.selfhost logs -f rollout migrate compute
docker compose --env-file .env.selfhost down   # keeps the Postgres and object store volumes

/health/ready is the app's health check and /health/live its liveness check. Compose allows 90 seconds for shutdown so running work can drain.

Deleting the volumes deletes durable data. Containers can be replaced without touching them. For upgrades and backups, see Upgrade and back up.

What the install sets up

Area Default
Public endpoints HTTPS on 443 for app and storage, with TLS at your proxy. URL generation and origin checks use the configured app host
Secrets A private cookie key, a 256-bit secrets key, a metrics bearer token and a separate compute signing key
Database PostgreSQL 17 with pgvector 0.8.5 in a named volume, reachable only on the private Compose network
Objects Silo, the maintained fork of MinIO, in a named volume. The app uses an internal endpoint, and presigned URLs use the public one. External S3-compatible storage also works
Workspace files /tmp/rollout-workspaces is scratch space. Persist separately any local files a workflow must keep across container replacement
Execution Workflow containers run through a private socket proxy whose allowlist covers the container, image, network and volume operations Rollout uses, plus the disk usage read that measures Local volumes. The Docker socket is never exposed on a host TCP port. Native is off (ROLLOUT_ALLOW_NATIVE_RUNTIME=false), so Run JavaScript and App builds use containers too, and no step gets the Rollout server's environment. The first Run JavaScript step on a new host waits for its public image to download. App builds need a compiler image you pull yourself: see Turn on Apps
Telemetry Rollout sends no product telemetry. Error export needs your own settings. Logs stay local. The metrics listener isn't published
Operator console Denied until you set OPERATOR_EMAILS. See Get access

Compose is one trusted installation. The Docker backend enforces no memory or CPU limits on workflow containers, so use it only for code you trust.

A step uses plain Alpine unless the workflow or node sets a Runtime image, so a step that needs git or other tools needs an image that has them.

Untrusted file parsing (image previews, PDF and docx text, OCR, custom models) runs in the separate compute service, never in rollout. It has a read-only filesystem, no capabilities and only its signing key, on an internal network that reaches nothing. To sandbox it further, install gVisor's runsc and add runtime: runsc to the compute service.

That service loads every workspace's custom models (ROLLOUT_COMPUTE_MODELS=any), because a self-hosted install is one trust domain. Workspaces that must not share a process need Kubernetes, where each one gets its own pool.

The sign-in footer always links to Documentation and License. Set ROLLOUT_TERMS_URL and ROLLOUT_PRIVACY_URL to add your own legal links without rebuilding the image.

Run without Compose

You need these wherever you run the image.

Image

Use a release image or build the repository's Dockerfile (Elixir 1.20, OTP 29, Debian trixie). The image supports amd64 and arm64. Build amd64 images on an amd64 builder: Docker Desktop's amd64 emulation can fail during startup on Apple Silicon.

Database

Create a database and a role, then set DATABASE_URL. TLS is on by default. Set DATABASE_SSL=false only for a local PostgreSQL without TLS.

The first migration creates 6 extensions: btree_gist, citext, pg_stat_statements, pg_trgm, pgcrypto and vector. Migrations run as the DATABASE_URL role, so that role must be able to create them: a superuser, or a managed-database role allowed to. The migration also comments on each extension, which only the owner or a superuser can do, so a non-superuser role fails on extensions another role created in advance.

Every table belongs to the role that runs the first migration, and Rollout grants nothing to other roles, so keep using that role in DATABASE_URL.

pgvector must be 0.8.0 or later. Below 0.7 the first migration fails. On 0.7 a later migration tries ALTER EXTENSION vector UPDATE and stops if that can't reach 0.8.0.

Container runtime

Workflow code needs Kubernetes, ideally with a gVisor RuntimeClass, or a Docker API endpoint. ROLLOUT_RUNTIME picks Kubernetes inside a cluster and Docker otherwise.

Set ROLLOUT_ALLOW_NATIVE_RUNTIME=false as well. Only the Compose initializer writes it for you, and unset, any workspace member can run a step with the Rollout server's environment and secrets.

Object storage

Production needs an S3-compatible bucket such as AWS S3, GCS interop or MinIO.

Minimum environment

PHX_SERVER=true                     # serve HTTP from the release
PHX_HOST=rollout.example.com        # public HTTPS hostname
DATABASE_URL=ecto://user:pass@db/rollout
DATABASE_SSL=false                  # only for a local PostgreSQL without TLS
SECRET_KEY_BASE=...                 # openssl rand -hex 64
MAIL_FROM_ADDRESS=rollout@example.com
SMTP_RELAY=smtp.example.com
STORAGE_BUCKET=...
STORAGE_HOST=...                    # defaults to the GCS interop host
STORAGE_ACCESS_KEY_ID=...
STORAGE_SECRET_ACCESS_KEY=...
ROLLOUT_SECRETS_KEY=...             # openssl rand -base64 32, and back it up
ROLLOUT_WORKSPACE_ROOT=/tmp/rollout-workspaces

See Configuration for the rest.

Migrations

There's no Mix in the image. Run this from the release, with the same image and environment as the app, before you roll the app:

bin/rollout eval "RolloutRelease.verify_integrations!(); RolloutRelease.migrate()"

On Kubernetes, run it as a Job, and give ROLLOUT_BOOTSTRAP_REGISTRATION to that Job and to the app. The Job opens registration and the app closes it, so on the Job alone registration opens and never closes. Readiness is GET /health/ready and liveness is GET /health/live. Keep terminationGracePeriodSeconds in step with ROLLOUT_TERMINATION_GRACE_MS.

What can go wrong

Symptom Cause Fix
A container exits at start A required variable is missing or invalid. The error names it Read logs rollout migrate compute, fix .env.selfhost and start again
"Registration is closed" on a new install ROLLOUT_BOOTSTRAP_REGISTRATION wasn't set when migrations ran, or someone has already confirmed an address With no users yet, set the variable and run up -d --no-build, which migrates again. Otherwise reopen registration from the host
"Google sign-in is available during alpha access only." Registration closed when the first owner confirmed Sign in with an emailed link, or open registration
Redirect loop The proxy doesn't send X-Forwarded-Proto: https Set the header on the app host
Uploads fail The storage proxy rewrites the Host or path, or limits the body size Preserve both. On nginx, also raise client_max_body_size on the storage host
All clients share one rate limit ROLLOUT_TRUSTED_PROXY_HOPS is 0 behind a proxy Set it to the number of proxies
"This feature isn't available yet." at /operator The console's flag is off, because the install had its first human before this release turned it on, or ROLLOUT_BOOTSTRAP_REGISTRATION wasn't set Run the command under Turn on the Operator console
"Operator access is restricted." Your address isn't in OPERATOR_EMAILS Add it and restart
"Widgets are not available on this deployment." SANDBOX_HOST isn't set Follow Turn on Apps
A blank App frame SANDBOX_HOST is set but the proxy doesn't reach 127.0.0.1:4010, or an older compose.yaml doesn't publish that port Add the route, and update compose.yaml
An App build says "the app build system is unavailable; your source was not the problem" Usually the compiler image isn't on the Docker host. logs rollout has the daemon's reason Pull it, as step 4 of Turn on Apps shows