Operate

Self-host

Install and configure the licensed axonpush runtime on your own server, PostgreSQL database and object storage.

The hosted service at app.axonpush.xyz needs no installation. This page is for teams with a self-host licence who run axonpush in their own environment.

A self-hosted installation is one executable, axonpush. It contains the API, the background workers, the evidence archive workers, the dashboard and the authentication service. You provide PostgreSQL, S3 storage, Amazon SES for email and a TLS reverse proxy. Go, Bun and Node are only needed to build the executable, not to run it. See Architecture for how the pieces fit together.

Requirements

ComponentWhat you need
HostLinux on amd64 or arm64. macOS builds exist for amd64 and arm64 but are not notarized, so use Linux for production.
PostgreSQLA dedicated database. CI tests against PostgreSQL 18. No extensions are required.
Object storageAn S3 bucket for large payloads. Two more buckets if you enable the evidence archive.
EmailAn Amazon SES sender identity. Sign-up, invitation, password reset and alert emails go through SES.
NetworkOutbound HTTPS to https://control.axonpush.xyz for licence activation and hourly heartbeats.
TLSA reverse proxy that terminates HTTPS (Caddy, nginx), or a certificate passed to axonpush serve.
LicenceA licence key (AXON-XXXXX-XXXXX-XXXXX-XXXXX) with the portable runtime entitlement.

Not supported today:

  • Windows hosts.
  • More than one running axonpush serve per database. The second process exits with another portable dispatcher owns this database. Run one instance and let your service manager restart it.
  • SMTP email. Only SES is implemented.
  • A published container image, package repository or automatic updater.
  • Redis or an external message queue. None is needed; durable work lives in PostgreSQL.

Install

Unpack and verify the release

axonpush sends you a release archive per platform, for example portable-linux-amd64.tar.gz. It contains the executable, SHA256SUMS and provenance.json (the server and dashboard commits it was built from). Check the checksum before installing:

mkdir -p /tmp/axonpush-release
tar -xzf portable-linux-amd64.tar.gz -C /tmp/axonpush-release
cd /tmp/axonpush-release
sha256sum -c SHA256SUMS
sudo install -D -m 0755 axonpush-linux-amd64 /opt/axonpush/axonpush
/opt/axonpush/axonpush version

Create the service account and directories

sudo useradd --system --home /var/lib/axonpush --shell /usr/sbin/nologin axonpush
sudo install -d -m 0700 -o axonpush -g axonpush /var/lib/axonpush
sudo install -d -m 0750 /etc/axonpush

/var/lib/axonpush becomes the state directory. It must stay private to the service user.

Create the database and roles

Use one role that owns the schema, one login that runs migrations and one login the service uses at runtime. The runtime role gets data privileges only, never schema ownership.

CREATE ROLE axonpush_owner NOLOGIN;
CREATE ROLE axonpush_migrate LOGIN PASSWORD '<migrate-password>';
GRANT axonpush_owner TO axonpush_migrate;
CREATE ROLE axonpush_app LOGIN PASSWORD '<app-password>';
CREATE DATABASE axonpush OWNER axonpush_owner;

If the database is on Amazon RDS, the URL must use sslmode=verify-full and an sslrootcert path, or the runtime refuses to start.

Create storage, SES and IAM

  1. Create a private S3 bucket for payloads (INGEST_ARCHIVE_BUCKET). Add a lifecycle rule that expires objects tagged axonpush-temporary=true after 30 days and aborts incomplete multipart uploads after one day.
  2. Verify an SES sender identity for EMAIL_FROM.
  3. Give the service an IAM identity with this access:
ResourceActions
Payload buckets3:ListBucket, s3:GetBucketLocation
Payload bucket objectss3:GetObject, s3:PutObject, s3:PutObjectTagging, s3:DeleteObject
SES identityses:SendEmail, ses:SendRawEmail (optionally limited by ses:FromAddress)

The AWS SDK credential chain supplies the credentials: an instance role, AWS_PROFILE or AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in the environment file. If you also want the evidence archive, follow Evidence archive now. It needs two more buckets and more permissions.

Write the environment file

Put configuration in a file only root and the service manager can read, such as /etc/axonpush/service.env with mode 0600. Never pass database passwords or the licence key on the command line.

DATABASE_BACKEND=postgres
DATABASE_URL='postgres://axonpush_app:<app-password>@db.internal:5432/axonpush?sslmode=require'
AWS_REGION=us-west-2
INGEST_ARCHIVE_BUCKET=<payload-bucket>
EMAIL_FROM=axonpush@example.com
LICENSE_KEY=<licence-key>
APP_URL=https://axonpush.example.com
PORTABLE_TRUSTED_PROXIES=127.0.0.1/32,::1/128
SIGNUP_MODE=invite-only
SUPERADMIN_EMAILS=you@example.com

Every variable is described in the configuration reference.

Run migrations

Migrations need the migration login, not the runtime role. Keep its URL in a second private file, /etc/axonpush/migrate.env (mode 0600):

DATABASE_URL='postgres://axonpush_migrate:<migrate-password>@db.internal:5432/axonpush?sslmode=require'

Load both files, the migration file last, and run migrate:

sudo sh -c 'set -a; . /etc/axonpush/service.env; . /etc/axonpush/migrate.env; set +a;
  exec /opt/axonpush/axonpush migrate --owner-role axonpush_owner --app-user axonpush_app'

migrate applies the embedded application and auth schemas in one transaction and grants axonpush_app the data privileges it needs. See Upgrades for its flags.

Check the configuration

sudo sh -c 'set -a; . /etc/axonpush/service.env; set +a; exec /opt/axonpush/axonpush doctor'

doctor prints named checks as JSON and never prints credentials. A ready installation shows "postgres":"connected" and "schema":"current". It does not validate the licence, send email or touch the buckets; it only reports whether they are configured.

Install the service

A systemd unit:

/etc/systemd/system/axonpush.service
[Unit]
Description=axonpush
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=axonpush
Group=axonpush
EnvironmentFile=/etc/axonpush/service.env
StateDirectory=axonpush
WorkingDirectory=/var/lib/axonpush
ExecStart=/opt/axonpush/axonpush serve --listen 127.0.0.1:8080 --public-url https://axonpush.example.com --state /var/lib/axonpush
Restart=on-failure
RestartSec=10
TimeoutStopSec=30
KillMode=mixed
UMask=0077

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now axonpush
curl -fsS http://127.0.0.1:8080/healthz

The first start extracts the embedded auth service into the state directory, activates the licence and schedules the first heartbeat.

Put HTTPS in front

Bind the service to loopback and terminate TLS in a reverse proxy. With Caddy on the same host:

Caddyfile
axonpush.example.com {
  reverse_proxy 127.0.0.1:8080
}

Set PORTABLE_TRUSTED_PROXIES=127.0.0.1/32,::1/128 so rate limits see the real client address from X-Forwarded-For. Forwarded addresses are ignored unless the direct peer matches an entry you configured.

To serve HTTPS directly instead, pass --tls-cert and --tls-key together with an https:// public URL.

Create the first administrator

The self-hosted sign-in page hides the “Create an account” link. Open https://axonpush.example.com/sign-up and register with an address listed in SUPERADMIN_EMAILS, then create your organisation and invite the rest of the team.

With SIGNUP_MODE=invite-only, anyone can still register an account, but only super-admins can create organisations; everyone else joins through an invitation. Add ALLOWED_SIGNUP_DOMAINS to restrict which email domains or addresses can register, or set SIGNUP_MODE=allowlist to admit only those.

Point SDKs, OTLP exporters and Sentry DSNs at your public URL instead of api.axonpush.xyz. The MCP endpoint is https://axonpush.example.com/mcp.

Serving the dashboard from another origin

By default the dashboard is served from the same origin as the API. To serve it from a different origin, set APP_URL to the dashboard origin and keep --public-url on the API origin. The auth issuer, API and MCP resource use the public URL; email links and OAuth sign-in and consent pages use APP_URL. Session cookies are host-only, so both origins must be HTTPS sibling hosts of the same site.

The dashboard reads its API and auth URLs from /runtime-config.js at startup, so there is nothing to rebuild per domain. That response contains no secrets.

State directory

--state (default: the service user’s config directory plus /axonpush) holds private installation state. The service creates it with mode 0700 and refuses to read files in it that are readable by others.

FilePurpose
installation-idStable identity used to derive the licence instance ID (inst_ plus 24 characters).
better-auth-secretSigns sessions and encrypts auth keys stored in PostgreSQL.
internal-secretAuthenticates the API to the embedded auth service.
evidence-pack-master-keySeed for evidence pack signing. Always created.
evidence-key-vault-master-keyWraps evidence subject keys. Created when an evidence bucket is configured.
runtime/<sha256>/authsvcThe extracted auth service, checked against the embedded hash on every start.
archive-cache/Encrypted read-through cache for archived traces (see ARCHIVE_CACHE_DIR).

Back up the state directory with the database and keep it across upgrades. Losing better-auth-secret signs everyone out and makes stored auth keys unreadable. Losing the evidence seeds breaks pack signing continuity and access to archived records. Losing installation-id makes the installation activate as a new instance.

Configuration reference

Configuration comes from the process environment. Unless a row says otherwise, a variable is optional. Values that axonpush serve sets itself are listed at the end; setting them has no effect.

axonpush serve flags

FlagDefaultNotes
--listen127.0.0.1:8080Public HTTP listener. Bind a public interface only deliberately.
--public-urlhttp://127.0.0.1:8080Browser-facing origin of the API. Must be https:// unless the host is localhost or a loopback address. No path.
--state<user config dir>/axonpushPrivate installation state.
--tls-cert, --tls-keynonePEM certificate and key for direct HTTPS. Set both or neither.

Database

VariableRequiredDefaultNotes
DATABASE_BACKENDYesnoneMust be postgres. serve, doctor and jobs refuse anything else.
DATABASE_URLYes, unless the next row is setnonepostgres:// or postgresql:// URL for the runtime role. Query options cannot override host, port, user, password or database. RDS hosts require sslmode=verify-full and sslrootcert. A local peer-auth socket is allowed as postgres://axonpush@localhost/axonpush?host=/run/postgresql&sslmode=disable.
DATABASE_URL_SSM_PARAMETERNononeName of an SSM SecureString holding the URL, read once at startup in AWS_REGION. Replaces DATABASE_URL.
DSQL_LOCAL_URLNononeLegacy alias. If set, it takes precedence over DATABASE_URL, so leave it unset.
AUTHSVC_DB_MAX_CONNSNo2Connections for the embedded auth service, from 1 to 5.

The Go side uses a pool of at most five connections, plus one dedicated connection for the work dispatcher. With the default auth pool, plan for eight connections.

Licence

VariableRequiredDefaultNotes
LICENSE_KEYYesnoneYour licence key. serve will not start without it.
CONTROL_URLNohttps://control.axonpush.xyzLicence control plane. Change only if axonpush tells you to.
LICENSE_PUBLIC_KEYNobuilt inOverride for the entitlement verification key during a key rotation axonpush coordinates with you.
GIT_SHANononeReported in heartbeats if set.

See Licensing for activation, heartbeats and what happens when a licence lapses.

AWS, storage and email

VariableRequiredDefaultNotes
AWS_REGIONRecommendedus-east-1Region for S3, SES and SSM. Both the API and the auth service send email from this region. Earlier releases of the auth service fell back to us-west-2 when it was unset; if your SES identity lives there, set AWS_REGION or AWS_SES_REGION to us-west-2.
AWS_PROFILE, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEYNoSDK chainStandard AWS SDK credentials. An instance role works too.
INGEST_ARCHIVE_BUCKETYesnoneMutable bucket for payloads too large to store inline. S3_INGEST_STAGING_BUCKET is accepted as an older name. Not the evidence archive.
S3_ENDPOINTNoAWSEndpoint for an S3-compatible payload store (path-style). Also used for S3 evidence pack destinations.
EMAIL_FROMYesnoneVerified SES sender for all email.
AWS_SES_REGIONNoAWS_REGION, then us-east-1SES region for auth emails (sign-up, reset, invitations), if different.
SES_ENDPOINTNoAWSSES endpoint override for server emails such as alerts.

Origins and network

VariableDefaultNotes
APP_URLthe --public-url valueDashboard origin, when it differs from the API origin. Must be an HTTP(S) origin.
PORTABLE_TRUSTED_PROXIESnoneComma-separated IPs or CIDRs of your reverse proxies. Up to 64 entries; 0.0.0.0/0 and other catch-all ranges are rejected.
PORTABLE_MAX_ACTIVE_REQUESTS8Concurrent application requests, 1 to 256. Excess requests get 503 with Retry-After: 1 instead of queuing in memory. /healthz is exempt.
CORS_ORIGINS*Comma-separated origins allowed to call the API from a browser. API calls authenticate with bearer tokens, not cookies.
SSO_TRUSTED_ORIGINSAPP_URLExtra exact identity-provider origins, comma-separated. Wildcards are rejected.
AXONPUSH_OUTBOUND_PORTSnoneExtra destination ports for webhooks and exports, added to 80, 443 and 4318.
AXONPUSH_OUTBOUND_PRIVATE_ORIGINSnoneJSON map of exact origins to CIDR lists, for example {"https://siem.internal":["10.0.4.0/24"]}. Outbound delivery to private addresses is refused unless listed here. Invalid JSON disables outbound delivery.

Authentication and sign-up

VariableDefaultNotes
SIGNUP_MODEopenopen, invite-only (only super-admins create organisations), allowlist (only the domains and addresses in ALLOWED_SIGNUP_DOMAINS may sign up), disabled (no sign-ups and no new organisations, including for super-admins). In allowlist mode the auth service refuses to start when ALLOWED_SIGNUP_DOMAINS is empty.
ALLOWED_SIGNUP_DOMAINSnoneComma-separated email domains (example.com) and full addresses (person@example.com) allowed to register. Required for allowlist; in the other modes a non-empty list also limits who can sign up.
SUPERADMIN_EMAILSnoneComma-separated addresses with platform admin access. They can create organisations in invite-only mode.
SIGNUP_ALERT_EMAILSSUPERADMIN_EMAILSWho is told about blocked or stuck sign-ups. off disables these alerts.
SIGNUP_STUCK_AFTER_MINUTES30When a sign-up counts as stuck, 5 to 1440.
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETnoneEnables Google sign-in. The client ID is public and sent to the dashboard.
BETTER_AUTH_SECRETgeneratedOnly needed when you adopt an existing database: supply its original secret on first start and it is copied into the state directory. Afterwards the service refuses a value that differs from the saved one.
AUTH_LOG_LEVELwarnAuth service log level: debug, info, warn or error. debug logs request data.

Evidence archive

All optional. Leave them unset to run without the archive. Setup, permissions and failure behaviour are on Evidence archive.

VariableDefaultNotes
EVIDENCE_ARCHIVE_BUCKETnoneVersioned bucket with Object Lock for sealed segments. Set together with EVIDENCE_KEYS_BUCKET.
EVIDENCE_KEYS_BUCKETnoneNever-versioned bucket for wrapped subject keys. Must differ from the archive bucket.
EVIDENCE_ARCHIVE_REGIONAWS_REGION, then us-east-1Region both evidence buckets must be in. Records are pinned to it.
EVIDENCE_S3_ENDPOINTAWSS3-compatible endpoint for both evidence buckets (path-style).
EVIDENCE_KMS_KEYnoneKMS key ID for SSE-KMS on evidence objects. Records are encrypted by axonpush either way.
EVIDENCE_KEY_VAULT_MASTER_KEYgenerated in state32 bytes as base64 or 64 hex characters. Must match the saved value once one exists.
EVIDENCE_PACK_MASTER_KEYgenerated in stateSeed for evidence pack signing. Same format and rule.
EVIDENCE_TSA_URLnoneHTTPS RFC 3161 timestamp authority. Set together with the next row.
EVIDENCE_TSA_ROOTS_PEMnonePEM text (not a path) of the roots that sign the TSA certificate.
EVIDENCE_GOVERNANCE_ROLE_ARNnoneSeparate IAM role used only for owner-approved shortening of GOVERNANCE retention.
EVIDENCE_DESTINATION_SECRETSnoneJSON credentials for evidence pack destinations, at most 64 KiB.
EVIDENCE_DESTINATION_SECRETS_ARNnoneSecrets Manager ARN holding the same JSON, read once at startup. Use this or the previous row, not both.
EVIDENCE_STORAGE_PRICES_JSONnoneYour storage prices, used for cost estimates on the storage card.
ARCHIVE_CACHE_DIR<state>/archive-cacheEncrypted disk cache for archived traces opened in the dashboard.
ARCHIVE_CACHE_MAX_BYTES1073741824 (1 GiB)Cache size limit in bytes. A missing, invalid or non-positive value uses the default.

Runtime and features

VariableDefaultNotes
LOG_LEVELinfoLog level for serve: debug, info, warn or error. Any other value is info. Logs are JSON.
GOMEMLIMIT32MiB soft limitGo runtime memory target. When unset, serve applies 32 MiB. It is not a process limit and excludes the auth child. Raise it (for example 256MiB) on busy installations.
SENTRY_INGEST_ENABLEDonSet to false, 0, off or no to refuse Sentry DSN traffic.
ALERT_WINDOW_MINUTES15Evaluation window for alert rules.
AXONPUSH_PILOT_MODEtrueLeave unset. Self-host never bills; setting false only turns on usage metering.
MAINTENANCE_MODEfalseNo effect on serve. The embedded auth service always starts with it off, so sign-in keeps working.

Set by serve

serve overrides these, so values in the environment are ignored: DEPLOYMENT_MODE (taken from the build), INSTANCE_ID and AWS_ACCOUNT_ID (the instance ID comes from the state directory), EVENT_TRANSPORT, AXONPUSH_EVENT_DRIVEN, AXONPUSH_BATCH_TRANSPORT, AXONPUSH_PAYLOAD_COMPRESSION, DOMAIN_TOPIC_ARN, BETTER_AUTH_URL, BETTER_AUTH_JWKS_URL, AUTHSVC_INTERNAL_URL, AUTHSVC_INTERNAL_SECRET, MCP_RESOURCE_URL, PUBLIC_API_URL, ALLOWED_ORIGINS, DOMAIN, APP_DOMAIN, CORS_DOMAIN, HOST, PORT, NODE_ENV, DEPLOYMENT_TARGET and AUTHSVC_LOW_MEMORY.

Not used by self-host

The source also contains a retired AWS Lambda deployment. Its variables have no effect on axonpush serve: DSQL_CLUSTER_ENDPOINT, DSQL_DATABASE_USER, the SQS and SNS settings (*_QUEUE_URL, *_TOPIC_ARN, SQS_ENDPOINT, SNS_ENDPOINT), the EventBridge Scheduler settings (EVENT_SCHEDULER_*, ACTIVITY_SCHEDULER_*, SCHEDULER_ENDPOINT, EVENT_WORKER_SELF), API_ADDR, WORKER_ADDR, ACTIVITY_WORKER_ADDR, ACTIVITY_WORKER_MODE, CRON_JOB, DEPLOYMENT_ENV, INGEST_STAGING_BUCKET, BILLING_ENABLED, LEMONSQUEEZY_* and SIGNUP_TELEMETRY_*.

Day-to-day operation

  • Health: GET /healthz answers even when all request slots are busy. GET /license reports licence status without authentication.
  • Logs: the API, workers and auth service all log to the service’s stdout and stderr. With systemd, use journalctl -u axonpush.
  • Failed work: axonpush jobs list shows up to 100 failed deliveries without their payloads. axonpush jobs retry <delivery-id> queues one again. Failed deliveries are deleted after seven days. See CLI.
  • Restarts: the service exits if the auth service or the work dispatcher fails, so the service manager restarts the whole installation. SIGTERM stops new requests and gives running ones up to 10 seconds. Durable work that was due while the service was down runs when it comes back.
  • Upgrades and backups: see Upgrades.