Docs

Local development

Run the whole Sovaria stack on your machine with sov start: auth, SQL, storage, logs and mail, plus functions, realtime and a local console — with well-known keys, your migrations and seed data, and a .env.local for your app.

Updated Oct 26, 2026

sov start runs the same services your cloud project uses, as Docker containers on your machine. It creates a developer account, an organization and a project, applies sovaria/migrations, loads sovaria/seed.sql, and writes the project URL and keys into .env.local. Nothing leaves your machine except the image download; every email lands in a local inbox.

emailYour appSOVARIA_URL=http://localhost:54321sov CLI--profile localGateway127.0.0.1:54321Auth · SQL · storage · logs · rulesaxis, atlas-rel,vault, echo,guard, nexusOptionalfunctions,realtime,documents,Postgres127.0.0.1:54322Mailpit inboxlocalhost:54324
Every port is published on 127.0.0.1. The gateway refuses to start if it is published anywhere else.

#Start the stack

  1. Install Docker

    Docker Desktop, or Docker Engine with the Compose v2 plugin. You don't need a Sovaria account for the local stack.

  2. Start it in your project folder

    The first start downloads the images (pinned to your CLI version) and takes a few minutes; later starts take seconds.

    cd my-app
    sov start                          # core services
    sov start --with forge,pulse,console   # plus functions, realtime and the local console
  3. Use the URL and keys

    sov status prints them; .env.local already has them for your framework (SOVARIA_URL, VITE_SOVARIA_URL, NEXT_PUBLIC_SOVARIA_URL and the anon key).

    sov status
ServiceAddress
API (gateway)http://localhost:54321 — or http://<ref>.localhost:54321
Postgrespostgresql://postgres:postgres@127.0.0.1:54322/sovaria_free (your project is one schema in it; SOVARIA_DB_URL in .env.local selects it)
Local consolehttp://localhost:54323 (with --with console)
Mail inbox (Mailpit)http://localhost:54324 — sign-up confirmations, password resets, magic links

#Well-known local keys

The local stack always uses the same two keys, so tests and example code can hard-code them. They are public and they only work against a local stack: the cloud refuses them, and the local gateway answers only requests addressed to localhost.

KeyValueUse it
Anon (publishable)svr_local_anon_5a0f1c8e2b7d4e6f9a3c1b5d7e9f0a2cIn your app, like the anon key of a cloud project
Service rolesvr_local_service_8d3b6f1a9c2e4d7b0f5a3c8e1d6b9f2aServer code and tests only (bypasses row-level security)
Developer accountdev@sovaria.local / sovaria-local-devSign in to the local console

#Point your app at the local stack

import { createClient } from '@sovaria/sdk'

const sov = createClient(import.meta.env.VITE_SOVARIA_URL, import.meta.env.VITE_SOVARIA_ANON_KEY)
// local: http://localhost:54321 + svr_local_anon_…   cloud: https://<ref>.sovarias.in + your anon key

#Use the CLI against it

sov start saves a CLI profile called local with a signed-in developer session. Add --profile local to any command; sov simulate local uses it by default and sov fn serve reads .env.local, so functions you run locally call the local stack.

sov db sql --profile local "select count(*) from todos"
sov db migrations new add_notes && sov db migrations push --profile local
sov db reset --local               # drop every table, re-apply migrations and seed
sov fn serve functions/            # SOVARIA_URL and keys come from .env.local
sov simulate local                 # full access simulation against the local stack

#Data: keep, reset or start from production's shape

  • sov stop stops the containers and keeps the database, files and logs; sov stop --reset deletes them.
  • sov db reset --local empties only the database, then applies your migrations and seed again.
  • sov start --from-snapshot snapshot.json recreates the tables, row-level security, policies, SQL functions and sample rows of a cloud project from a simulation snapshot (sov simulate snapshot --rows). No credentials or app users are copied.

#How the local stack differs from the cloud

Local stackCloud project
Plan limitsNone: every local organization is on EnterpriseYour plan
DatabaseOne Postgres, one schema per projectA dedicated Postgres per project
EmailCaptured by MailpitSent
FilesOn a Docker volumeObject storage
KeysWell-known, local onlyGenerated per project
Backups, point-in-time recovery, replicasNot availableBy plan

#Settings

VariableDefaultWhat it does
SOVARIA_LOCAL_IMAGE_NAMESPACE (or --image-namespace)sovariaRegistry namespace of the sovaria-local-* images, e.g. a mirror in your company registry
SOVARIA_LOCAL_IMAGE_TAGthe CLI versionImage version; latest is refused
SOVARIA_LOCAL_API_PORT, …_DB_PORT, …_CONSOLE_PORT, …_MAIL_PORT54321, 54322, 54323, 54324Host ports
SOVARIA_LOCAL_BIND127.0.0.1Loopback address the ports are published on (loopback only)

#In CI

- run: pipx install sovaria-cli
- run: sov start --no-env-file
- run: npm test
  env:
    SOVARIA_URL: http://localhost:54321
    SOVARIA_ANON_KEY: svr_local_anon_5a0f1c8e2b7d4e6f9a3c1b5d7e9f0a2c
- run: sov stop --reset --yes
  if: always()