Magnemite
Deployment

Environment reference

Every variable the hub, the dashboard and the agent read, and which deployment sets it.

With the docker compose deployment these come from .env at the repo root (copy .env.example). On Coolify, the SERVICE_* ones are generated and shown in the resource's Environment tab; the rest have defaults.

URLs

VariableDefaultWhat it is
EDGE_PORT8080Host port the edge publishes, in plain HTTP. Your own reverse proxy terminates TLS and forwards here. Compose deployment only.
MAGNEMITE_PUBLIC_URLThe base URL handed to agents. Artifact URLs are built from it, so it must be what the boxes can actually reach. On Coolify this is the edge domain.
MAGNEMITE_DASHBOARD_URLMAGNEMITE_PUBLIC_URLThe dashboard's own origin, checked by Better Auth. Only needs setting when the two audiences are on separate domains.
BETTER_AUTH_URLMAGNEMITE_DASHBOARD_URLBase URL for auth callbacks. Falls back to Coolify's SERVICE_FQDN_WEB; a bare host with no scheme is accepted.
HUB_URLhttp://hub:3001Where the dashboard reaches the hub's internal API, over the compose network.

Database

VariableDefaultWhat it is
POSTGRES_USERmagnemiteThe database user.
POSTGRES_PASSWORDGenerated by Coolify as SERVICE_PASSWORD_POSTGRES.
POSTGRES_DBmagnemiteThe database name.
DATABASE_URLOnly used when running Prisma or the apps outside Docker. Inside compose it is built from the POSTGRES_* values and points at the postgres service.

Auth and the first admin

VariableDefaultWhat it is
AUTH_SECRETSigns Better Auth cookies. openssl rand -base64 32. Coolify generates SERVICE_BASE64_64_AUTHSECRET.
ADMIN_EMAIL[email protected] (compose) / [email protected] (Coolify)Login identifier for the seeded admin. Nothing is ever sent to it, but it must be a well-formed address — admin@localhost is rejected.
ADMIN_PASSWORDSeeded admin password. Coolify generates SERVICE_PASSWORD_ADMIN.

ADMIN_EMAIL and ADMIN_PASSWORD are set on the hub service, because the seed runs in that container and there is no .env file inside it. Re-running the seed resets that address's password — which is the way back in if you lose the login.

Hub

VariableDefaultWhat it is
HUB_PORT3001
HUB_INTERNAL_SECRETShared secret for web → hub internal calls (SSE, dispatch nudges, rollout control). Coolify generates SERVICE_PASSWORD_HUBSECRET.
ARTIFACT_DIR/data/artifacts in composeWhere cached .apkm bundles live. Must match the volume mounted into Caddy as /srv/artifacts.
SERVE_ARTIFACTSfalseServe /files/* from Node. Leave false in both deployments; true only for local development without Caddy.
MAX_CONCURRENT_JOBS10Fleet-wide cap on devices downloading or installing at the same time.
JOB_STALL_TIMEOUT900Seconds without a job_progress message before a job is treated as stalled and re-queued.
AGENT_AUTO_UPDATEtrueTell boxes on an older build to update themselves to the binary this hub image ships. See updating the agent.
AGENT_UPDATE_CONCURRENCY5How many boxes may be swapping their agent binary at once.
AGENT_BIN_DIR/app/agent-binWhere the hub image keeps those binaries, next to the VERSION they were built from.

Version sources

VariableDefaultWhat it is
SOURCE_POLL_MINUTES10080 in .env.example, 15 in composeHow often every enabled source is polled.
MIRROR_INDEX_URLthe two defaultsComma-separated index URLs the seed starts with. Read once; after that, sources are edited in the dashboard.

The sources themselves are rows in the database, managed in Settings → Version sources — see APKs sources.

Rotom

VariableDefaultWhat it is
ROTOM_ENABLEDfalseSee Rotom.
ROTOM_URLRotomNG's HTTP listener, usually :7072. /api is appended, so either form works.
ROTOM_SECRETMatches secret under http_listener in the Rotom config.

Coolify-generated names

Coolify replaces every SERVICE_* placeholder on first deploy and shows the result in the Environment tab.

PlaceholderBecomes
SERVICE_FQDN_WEBthe dashboard's domain
SERVICE_FQDN_EDGEthe agents' domain
SERVICE_FQDN_DOCSthe documentation site's domain (docs compose file only)
SERVICE_URL_WEB / SERVICE_URL_EDGEthe same, with the scheme
SERVICE_USER_POSTGRES / SERVICE_PASSWORD_POSTGRESdatabase credentials
SERVICE_PASSWORD_HUBSECRETHUB_INTERNAL_SECRET
SERVICE_BASE64_64_AUTHSECRETAUTH_SECRET
SERVICE_PASSWORD_ADMINthe first admin's password

The agent's own configuration

Per-box, in /data/adb/magnemite/config.json, or as flags:

FlagConfig keyWhat it is
-serverserverUrlThe hub URL — MAGNEMITE_PUBLIC_URL, never the dashboard's.
-enroll-tokenenrollmentTokenUsed once on first run, then deleted from the config.
-namenameFriendly name for the box.
-configPath to config.json.
-work-dirScratch directory for downloads and extraction.
-fake-rootSimulate an Android box. See Testing without hardware.
-fake-serialSerial to report in -fake-root mode.
-versionPrint the agent version and exit.

On this page