Skip to Content
Aperture
Self-hosting

Operations

Day-to-day commands, admin tasks, and how the server runs jobs in the background.

The ./run script

./run in the repository root wraps Docker Compose. Run ./run help for the full list. The ones operators use most:

CommandDoes
./run up / ./run up:detachStart the services (with file watching / in the background).
./run up:buildRebuild and start.
./run downStop everything.
./run setupInstall deps, create and migrate the database, run seeds.
./run migrateRun database migrations (dev image).
./run prod:migrateRun migrations in a production release container.
./run prod:remoteOpen a remote console on a production release.
./run iexElixir console in the dev server container.
./run mix <task>Run a mix task in the server container.
./run psqlOpen psql against the database.
./run secretGenerate a value for SECRET_KEY_BASE.
./run webhook:test <url> <secret>Send a signed test webhook.
./run cli:installBuild and install aperture-cli.

Elixir tooling runs inside the server container; always call it through ./run rather than mix on the host.

Admin tasks

These mix tasks run in the dev image (./run mix …). In a production release, use ./run prod:remote and call the equivalent function shown.

Create a user

./run mix aperture.admin admin@example.com 'a-strong-password'

Works even when REGISTRATIONS_ENABLED is off, and prints validation errors (for example a duplicate email) instead of creating nothing. The user has no special privileges and belongs to no team; they create or join one from the dashboard. In a release: Aperture.UserManager.insert_user(%{username: ..., password: ...}).

Billing-exempt teams

With BILLING_ENABLED=false, every team is exempt and this isn't needed. With billing on, give a single team unlimited, free usage:

./run mix aperture.billing.exempt <team-id> --reason "internal"
./run mix aperture.billing.exempt <team-id> --revoke

In a release: Aperture.Billing.Subscriptions.set_billing_exempt(team_id, "internal") and Aperture.Billing.Subscriptions.revoke_billing_exempt(team_id).

Run a scheduled execution now

./run mix aperture.exec <execution-id>

Moves a scheduled execution's start time to now.

Background processing

The server uses Oban on Postgres for background work:

QueueConcurrency (per node)Work
default20Running jobs, unpacking deploys.
webhooks50Webhook deliveries.
scheduler1Scheduling.

Periodic tasks:

  • Every minute: keep each cron job's next run scheduled, mark late cron runs missed, and fail runs whose heartbeat stopped (orphaned).
  • Every hour: delete leftover deploy staging directories older than an hour.
  • Finished background job records are pruned after 7 days. Execution records are kept.

Health and monitoring

  • GET /api/v1/health returns 200 {"status": "ok"}; Compose uses it as the server's health check.
  • The runner has its own health check binary.
  • Execution logs live in S3 under logs/<project_id>/<job_id>/<execution_id>. Aperture doesn't delete them; set a bucket lifecycle rule if you want retention.

On this page