Skip to content
Documentation

Self-hosting

Run the curl-runner Cloud server from its Docker image with Postgres. Set the secret key, email, sign-in and sign-up policy, then add a proxy and backups.

Private preview

curl-runner Cloud is in private preview, and the hosted service opens to sign-ups at launch. The server is the same one we run, so you can host your own today. See Cloud for what it does.

The curl-runner server ships as a Docker image: ghcr.io/alexvcasillas/curl-runner-server. The repo's docker-compose.yaml runs it together with Postgres 17.

Four values are required. Set them in your shell or in a .env file next to docker-compose.yaml before the first start:

.env
POSTGRES_PASSWORD=<a long random password>
SECRET_KEY=<at least 32 random bytes>
PUBLIC_API_URL=https://api.example.com
PUBLIC_APP_URL=https://cloud.example.com

Generate a key with openssl rand -hex 32.

Never change SECRET_KEY

The server hashes sessions, publish tokens and share links with SECRET_KEY, and encrypts stored share links with it. If you change it, every session and token stops working and every share link breaks. Back it up with your database and keep the same value for the life of the install.

Run it

From a checkout of the repo:

docker compose up -d

This pulls the images and starts two services: server, the API, and app, the dashboard. The API listens on port 8080 inside the container and the dashboard on port 3000. The compose file doesn't publish either to your machine. Point your reverse proxy at them. See The dashboard.

To reach it from your host, add a docker-compose.override.yml next to docker-compose.yaml. Compose picks it up automatically:

services:
  server:
    ports:
      - "8080:8080"

If you change PORT, map that port instead, for example "9000:9000".

The compose file attaches the service to an external network named coolify, because that's how it's deployed. If you don't use Coolify, create the network first:

docker network create coolify

Or remove the coolify entries from docker-compose.yaml: the top-level coolify network, the coolify: entry under server's networks, and the - coolify line under app's. Keep internal.

The dashboard

The app service is the web dashboard, from the image ghcr.io/alexvcasillas/curl-runner-cloud. It talks to the API over the private network. Your CLI and the studio still need the API's public URL.

Give each service a public address on your reverse proxy, with TLS:

  • https://cloud.example.com goes to the app service on port 3000. This is PUBLIC_APP_URL.
  • https://api.example.com goes to the server service on port 8080. This is PUBLIC_API_URL.
VariableDefaultWhat it does
PUBLIC_APP_URLnoneRequired. The dashboard's public URL. It decides where links and emails point, and the session cookie is marked Secure. Use https unless it's http://localhost.
PUBLIC_API_URLnoneRequired. The API's public URL. The dashboard advertises it to the CLI.
API_INTERNAL_URLhttp://localhost:8080How the dashboard reaches the API. The compose file sets it to http://curl-runner-server:8080, on the private network. Set it yourself if you run the dashboard some other way.
CLOUD_IMAGE_TAGlatestThe dashboard image tag.

The compose file refuses to start the dashboard without both public URLs. Without them it would send people to localhost.

The dashboard calls the API from its own container, so the API sees it as one proxy hop. With the proxy in front of the dashboard as well, TRUSTED_PROXY_HOPS is still 1 for the API. See Behind a proxy.

Check it with curl https://cloud.example.com/healthz. It answers 200.

Discovery

The dashboard serves /.well-known/curl-runner.json:

{"api":"https://api.example.com"}

curl-runner pull <link> reads it on the dashboard host of the link to find the API, so a person only needs the link. It reports PUBLIC_API_URL.

curl-runner login --browser --server <api url> goes the other way. It reads the dashboard's URL from the API's /v1/info, which reports PUBLIC_APP_URL.

Check it's up

With the port published as above:

curl localhost:8080/health

Without it, run the image's own check inside the container:

docker compose exec server /curl-runner-server healthcheck
{"status":"ok","version":"<version>"}

GET / answers the same way, so opening the server's root URL in a browser also shows this.

The container also runs its own healthcheck every 10 seconds. docker compose ps shows healthy once it passes.

Settings

Set these in your shell or in the .env file. An empty value counts as unset.

Server

VariableDefaultWhat it does
PORT8080Port the server listens on.
RUST_LOGinfoLog level, for example debug or warn.
SERVER_IMAGE_TAGlatestImage tag to run.
SECRET_KEYnoneRequired. At least 32 bytes. Never change it.
PUBLIC_API_URLnoneRequired with the compose file. The public URL of this API, such as https://api.example.com.
PUBLIC_APP_URLnoneRequired with the compose file. The public URL of the dashboard. Share links and emails point here.
TRUSTED_PROXY_HOPS1How many reverse proxies sit in front of the server. See Behind a proxy.

Database

The compose file runs Postgres for you and sets the DB_* values. It reads the password from POSTGRES_PASSWORD. Postgres is only on a private network, and the connection doesn't use TLS.

To use a Postgres you already run, set DATABASE_URL instead. It must start with postgres:// or postgresql://. Without it, the server reads DB_HOST (default db), DB_PORT (default 5432), DB_USER, DB_PASSWORD and DB_NAME.

The server creates its tables on first start.

Email

Sign-in codes, invites and share notices are sent by email. Without SMTP settings, the server only logs them, which is fine for a trial run and nothing else.

VariableWhat it does
SMTP_HOSTThe SMTP relay. Without it, the server only logs emails.
SMTP_PORT587 (STARTTLS, the default) or 465 (TLS from the first byte). Many hosts, Hetzner among them, block outbound 465.
SMTP_USER, SMTP_PASSWORDCredentials. Set both or neither.
MAIL_FROMThe sender, such as curl-runner <no-reply@example.com>.

Sign-in with GitHub or Google

Email codes always work. To add a provider, create an OAuth app with it and set both values. The dashboard handles the sign-in, so the callback URL is on PUBLIC_APP_URL:

VariableWhat it does
GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRETEnables sign-in with GitHub.
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETEnables sign-in with Google.
ProviderCallback URL
GitHub{PUBLIC_APP_URL}/sign-in/github/callback
Google{PUBLIC_APP_URL}/sign-in/google/callback

For https://cloud.example.com, the GitHub callback is https://cloud.example.com/sign-in/github/callback. A provider's button shows on the sign-in page once its two values are set.

Who can create a team

Anyone can sign in with an email code. A signed-in person who isn't in a team can still open a collection that was shared with them. SIGNUP decides who can create a team:

SIGNUPWhat it does
domainsThe default. Only emails on a domain in SIGNUP_DOMAINS can create a team.
openAnyone who signs in can create a team.
closedNobody can create a team, except owners.

SIGNUP_DOMAINS is a comma-separated list, such as example.com,acme.dev.

With SIGNUP=domains and an empty list, the first account becomes an owner and can create teams. Sign in yourself right after the first start, before you share the address.

OPERATOR_EMAILS is a comma-separated list of owners. Owners can always create teams and open the admin panel.

To create the first team, sign in with curl-runner login --server https://api.example.com, then call the API with that session:

SESSION=$(jq -r '.servers["https://api.example.com"].session' ~/.config/curl-runner/credentials.json)
curl -X POST https://api.example.com/v1/teams \
  -H "Authorization: Bearer $SESSION" \
  -H "Content-Type: application/json" \
  -d '{"slug": "acme", "name": "Acme"}'

You can also do this in the dashboard. Sign in at your PUBLIC_APP_URL and create the team from the new team page.

Set on the first start only

SIGNUP, SIGNUP_DOMAINS and DEFAULT_PLAN seed the server settings the first time the server starts. After that, the settings live in the database. The server ignores changes to these variables and logs a warning. Change them in the admin panel, under Settings. See Settings.

Plans

DEFAULT_PLAN sets the plan of a new team: team or free. The default is team, which has no member limits and allows restricted sharing. Leave it unset when you self-host. The managed service sets DEFAULT_PLAN=free.

An owner can give a team a plan later from the admin panel. See Teams and plan overrides.

Example .env
POSTGRES_PASSWORD=<password>
SECRET_KEY=<key>
PUBLIC_API_URL=https://api.example.com
PUBLIC_APP_URL=https://cloud.example.com
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=mailer
SMTP_PASSWORD=<password>
MAIL_FROM="curl-runner <no-reply@example.com>"
SIGNUP=domains
SIGNUP_DOMAINS=example.com
OPERATOR_EMAILS=admin@example.com

Stripe billing

Billing is off by default, and self-hosted servers don't need it. To charge for teams, set all four variables. Setting only some stops the server at startup.

VariableMeaning
STRIPE_SECRET_KEYA Stripe secret or restricted key.
STRIPE_WEBHOOK_SECRETThe signing secret of the webhook endpoint.
STRIPE_PRICE_MONTHLY, STRIPE_PRICE_ANNUALThe per-seat price IDs for each billing interval.

Set billing up in Stripe like this:

  1. Create a webhook endpoint that points at {PUBLIC_API_URL}/v1/billing/webhook.
  2. Subscribe it to six events: checkout.session.completed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted, invoice.payment_failed and invoice.paid.
  3. Set the endpoint's API version to 2026-10-28.endive.
  4. Create two prices, one monthly and one annual. Each must be a flat per-seat recurring price. Tiered and metered prices aren't supported.
  5. Turn on Stripe Tax. Checkout calculates tax, and Stripe refuses the checkout without it.
  6. Set up the customer portal in the Stripe dashboard. The server opens the portal with its default settings. Allow switching plans between your two prices, and leave quantity changes off: the server sets the quantity from the member count.

With billing on, GET /v1/info reports "billing": true. The dashboard then shows a Billing page, where team owners start a checkout or open the Stripe customer portal. Without it, the page doesn't exist.

The dashboard needs no Stripe settings of its own. It asks the API, which holds the keys.

The admin panel

The dashboard has an admin panel at /admin. See Cloud admin panel for what it does.

There are two roles:

  • Owners are the emails in OPERATOR_EMAILS, plus the first account on a server with SIGNUP=domains and an empty list. They have every permission. You can't remove them in the panel.
  • Admins are people an owner adds under Admins, each with the permissions they need: users, teams, plans (billing in the API), emails, settings and admins. Every admin can read every page.

A person who isn't an owner or admin gets a 404 on /admin, not a "forbidden" page. The panel doesn't show that it exists.

To make someone an owner, add their email to OPERATOR_EMAILS and restart the server.

Settings

Owners and admins with the settings permission change these in the panel, and they apply at once:

  • who can create a team, and the allowed domains;
  • the plan for new teams, the Free member limit, restricted sharing on Free, and the grace period after a failed payment;
  • the banner and pause publishing.

Every change goes in the activity log, which the server keeps for 2 years.

Pause publishing

Turn on Pause publishing before a migration. Publishes and studio syncs get 503 with "Publishing is paused for maintenance. Try again in a few minutes." The CLI exits non-zero. Share links and pulls keep working. Turn it off to resume.

A banner shows a message at the top of every dashboard page. Pick the tone, info or warning, who sees it, everyone or signed-in people, and an optional link. People can dismiss it. It comes back when you change the message.

Behind a proxy

Run the server behind a reverse proxy that terminates TLS. The server uses the client's address for rate limits, and it reads it from X-Forwarded-For. Set TRUSTED_PROXY_HOPS to the number of proxies in front of it. The default is 1.

  • One proxy, such as Caddy or Traefik: leave it at 1.
  • A CDN and a proxy: set 2.
  • No proxy, with the server reachable directly: set 0, so a client can't pick its own address.

A wrong count lets clients dodge rate limits or makes everyone share one.

Point your CLI at the server with --server https://api.example.com or CURL_RUNNER_SERVER. The CLI refuses plain http unless the host is localhost.

Invite links and share links are credentials. Whoever holds the link can use it. Send them over a channel you trust, and reset a share link if it leaks.

Back up Postgres

Everything lives in Postgres. Back it up every day. With the bundled database:

docker compose exec -T db pg_dump -U curl_runner curl_runner | gzip > curl-runner-$(date +%F).sql.gz

Run that from cron, copy the file off the machine, and try a restore now and then. Keep SECRET_KEY with the backup: a restored database is useless without the key it was written with.

Pin a version

Every build is tagged latest and sha-<short>, where <short> is the short commit hash. latest moves with each build. To stay on one build, pin the tag:

SERVER_IMAGE_TAG=sha-abc1234 docker compose up -d