Skip to main content
Version: 0.1

Self-Hosting

This guide runs storeasy on one Linux server with Docker: the API, the web app, PostgreSQL 17, Redis 7 and SeaweedFS (S3 compatible object storage). Everything is in deploy/docker-compose.yml and deploy/.env.example.

The default mode is STOREASY_MODE=SingleTeam: one team, its own server, no developer steps. A hosted instance for many customers is the advanced MultiTenant mode (see below).

What runs where​

browser / CI / MCP client
|
TLS reverse proxy (yours: Caddy, Traefik, nginx)
| |
storeasy-web (nginx, port 80) seaweedfs (S3 API, port 8333)
/ SPA ^
/api/ -> storeasy-api:8080 | presigned PUT / GET (browsers, CI runners, the API)
/hubs/ -> storeasy-api:8080 (WebSocket)
/mcp -> storeasy-api:8080 (streamable HTTP)
/webhooks/ -> storeasy-api:8080
/health/ -> storeasy-api:8080
|
postgres:5432 redis:6379
  • One origin. The web container serves the app and proxies /api, /hubs, /mcp, /webhooks and /health to the API, so there is no CORS setup and one certificate for the app.
  • Files never pass through the API. Uploads and downloads use presigned URLs on the S3 endpoint, so the S3 API needs its own public host name (for example files.storeasy.example.com).
  • Background work runs inside the API: the store job runner, the e-mail outbox sender, the web push sender, the outgoing webhook sender and the scheduled syncs and cleanups. No separate worker container.
  • Redis holds the cache, token revocation stamps, feature flags, rate limit counters, the Google sign in state and the SignalR backplane. Losing it loses nothing permanent.

Requirements​

  • Linux server with Docker Engine 24+ and the Compose plugin. 2 vCPU and 4 GB RAM are enough for a team.
  • Two DNS names pointing at the server: the app (storeasy.example.com) and the S3 endpoint (files.storeasy.example.com).
  • An SMTP account for verification, password reset, invitation and notification e-mails.
  • Outbound HTTPS to the store APIs (api.appstoreconnect.apple.com, androidpublisher.googleapis.com, www.googleapis.com, oauth2.googleapis.com, login.microsoftonline.com, manage.devcenter.microsoft.com, api.store.microsoft.com) and, if you use them, to Google sign in and the browser push services.
  • openssl (or PowerShell) to generate secrets.
  • A clone of the repository (the compose file builds the images from it).

Install​

git clone https://github.com/Milvasoft/storeasy storeasy
cd storeasy/deploy
cp .env.example .env
chmod 600 .env

Fill in .env:

KeyHow to create
STOREASY_BASE_URLPublic address of the app, for example https://storeasy.example.com
STOREASY_MASTER_KEYopenssl rand -base64 32
STOREASY_TOKEN_KEYopenssl rand -hex 32
POSTGRES_PASSWORDopenssl rand -hex 32
S3_ACCESS_KEYopenssl rand -hex 16
S3_SECRET_KEYopenssl rand -hex 32
S3_PUBLIC_URLPublic address of the S3 endpoint, for example https://files.storeasy.example.com
SMTP_HOST, SMTP_FROM (+ SMTP_USERNAME, SMTP_PASSWORD)Your mail provider

Optional: STOREASY_GOOGLE_CLIENT_ID and STOREASY_GOOGLE_CLIENT_SECRET (Sign in with Google), STOREASY_WEBPUSH_* (browser notifications), STOREASY_APPLE_UPLOAD_MODE (package intake) and STOREASY_COMMIT (shown on the system status page).

PowerShell equivalents for the secrets: [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(32)) and [Convert]::ToHexString([Security.Cryptography.RandomNumberGenerator]::GetBytes(32)).

Store STOREASY_MASTER_KEY in a password manager now, outside the server. It seals every store credential (see Master key).

Then start the stack:

STOREASY_COMMIT=$(git rev-parse --short HEAD) docker compose up -d --build
docker compose ps

Startup order: PostgreSQL and Redis become healthy, SeaweedFS is configured and started, the bucket is created, then the API starts, applies the database migrations and creates the data it needs (roles, permissions, languages), then the web container starts. This is idempotent and safe when several API instances start at once.

Images and the rules catalog​

Both images are built from the checkout. The API image embeds the store rules catalog (rules/) and validates it at startup. To use another catalog without rebuilding, mount a folder and point Storeasy__Stores__RulesPath at it:

    environment:
Storeasy__Stores__RulesPath: /rules
volumes:
- ../rules:/rules:ro

To use prebuilt images instead, set STOREASY_API_IMAGE and STOREASY_WEB_IMAGE in .env and run docker compose up -d --no-build.

Reverse proxy and TLS​

The stack binds the web container to 127.0.0.1:${WEB_PORT} (default 8080) and SeaweedFS to 127.0.0.1:${S3_PORT} (default 8333). Put a TLS terminating reverse proxy in front of both. Caddy example:

storeasy.example.com {
reverse_proxy 127.0.0.1:8080
}

files.storeasy.example.com {
request_body {
max_size 128MB
}
reverse_proxy 127.0.0.1:8333
}

Rules for any proxy:

  • App host: pass WebSocket upgrades (/hubs/activity) and do not buffer /mcp responses. Set X-Forwarded-For to the client address. The API trusts the last Storeasy__Network__ForwardedHops hops (default 2: your proxy and the inner nginx); set it to your real chain. Never expose the web or API container directly. The app host must be reachable from the internet if you use App Store Connect webhooks, EAS or signed webhooks.
  • S3 host: keep the original Host header (presigned URLs are signed for it), allow request bodies of at least 64 MiB and long timeouts. The API container must also reach S3_PUBLIC_URL.
  • S3 CORS: the browser uploads directly, so the S3 host must allow PUT and GET from STOREASY_BASE_URL and expose the ETag header. The bundled SeaweedFS does this itself; do not add CORS headers at the proxy as well. For AWS S3 or another S3 service, set a bucket CORS rule instead.

First admin and first account​

Warning. Run only MILVA_ENV=prod (the image default) on any reachable server. dev opens the API documentation and the developer endpoints (which can reset or seed the database), and test is not hardened for production.

Single team (default)​

While the server has no user, the API writes a random one time setup code to its log:

docker compose logs storeasy-api | grep "setup code"
# ... WRN] Storeasy setup code: ABCD-EFGH-JKMN

Open STOREASY_BASE_URL; the site shows the Setup screen. Enter the code, your name, e-mail, a password and the team name. The API creates your account (as administrator of the server) and the team (with you as Owner), and signs you in. Once a user exists, setup is closed for good.

Then invite your team from Members. There is no sign-up in this mode: people join through the invitation e-mail (SMTP must work). Automated installs can set STOREASY_SETUP_CODE (at least 12 characters) for the first start instead of reading the log, and remove it afterwards.

Multi tenant mode (advanced)​

For a hosted instance with many customers set STOREASY_MODE=MultiTenant: registration by STOREASY_REGISTRATION_MODE (Open by default), any number of organizations and a separate platform administrator, rootuser. The database is initialized once with a temporary development container bound to 127.0.0.1 and a one-off bootstrap key:

docker compose stop storeasy-api
export Storeasy__Bootstrap__InitKey="$(openssl rand -hex 32)"
docker compose run -d --name storeasy-init -e MILVA_ENV=dev -e Storeasy__Bootstrap__InitKey -p 127.0.0.1:5080:8080 storeasy-api
curl -fsS http://127.0.0.1:5080/api/v1.0/healthcheck/ready # repeat until it answers
curl -fsS -X POST -H "X-Storeasy-Init-Key: $Storeasy__Bootstrap__InitKey" http://127.0.0.1:5080/api/v1.0/developer/database/init
docker rm -f storeasy-init
unset Storeasy__Bootstrap__InitKey
docker compose up -d storeasy-api

init returns the generated root password once; store it in a password manager. Never keep the key in .env or any file. Then register your own account, create your organization, and close registration from the admin System page (InviteOnly or Closed).

Configuration​

The API reads appsettings.json and then environment variables; a variable name is the key with : replaced by __ (Storeasy:Encryption:MasterKey becomes Storeasy__Encryption__MasterKey). Secrets must only come from the environment. The full configuration reference (accounts and e-mail, store engines, jobs, webhooks, object storage, observability) is in docs/self-host.md. Some highlights:

KeyDefaultDescription
Storeasy:Mode (STOREASY_MODE)SingleTeamSingleTeam or MultiTenant.
Storeasy:Jobs:Workers (STOREASY_JOBS_WORKERS)4Jobs one instance runs at the same time.
Storeasy:Stores:PlanLifetimeMinutes2880How long a pending change plan can be approved (48 hours).
Storeasy:Intake:AppleUploadMode (STOREASY_APPLE_UPLOAD_MODE)ApiHow IPAs reach App Store Connect; see CI Intake.
Storeasy:Events:SchedulesEnabled (STOREASY_SCHEDULES_ENABLED)trueWhether this instance runs scheduled syncs and reminders. With several instances, keep it on in one.
Storage:S3:Bucket (S3_BUCKET)emptyPrivate bucket. Empty disables uploads.

Sign in with Google needs an OAuth client of type Web application with the redirect URI <STOREASY_BASE_URL>/auth/google/callback, then STOREASY_GOOGLE_CLIENT_ID and STOREASY_GOOGLE_CLIENT_SECRET. Browser notifications need one VAPID (P-256) key pair per instance in STOREASY_WEBPUSH_PUBLIC_KEY and STOREASY_WEBPUSH_PRIVATE_KEY.

Feature flags (instance admin, Feature flags) switch off Export, Studio.AiCaptions, EasBuilds and Registries at runtime.

Master key: backup and rotation​

The master key seals every store credential, saved demo passwords, webhook and pull source secrets and queued e-mails (envelope encryption: one data key per record, wrapped by the master key). A database dump alone reveals none of them. Keep STOREASY_MASTER_KEY and its version in a password manager, separate from database backups. If the key is lost, every store connection must be added again.

To rotate: generate a new key, keep the current key as a retired entry (Storeasy__Encryption__RetiredKeys__1), set the new key with a higher STOREASY_MASTER_KEY_VERSION, and restart the API. Old records still open; re-seal them by re-adding connections and rotating secrets (there is no bulk re-seal command yet), then remove the retired key.

Upgrades​

  1. Read the release notes.
  2. Back up the database. Migrations have no down scripts: going back means restoring.
  3. Update and restart:
    git pull
    export STOREASY_COMMIT=$(git rev-parse --short HEAD)
    docker compose build
    docker compose up -d
  4. The API applies pending migrations at startup. Check:
    docker compose logs storeasy-api | grep -i "applying migrations"
    curl -fsS http://127.0.0.1:8080/api/v1.0/healthcheck/ready

Run one API instance while a release with schema changes starts; scale out afterwards.

Backups​

WhatHow
PostgreSQLDaily pg_dump, plus one before every upgrade
SeaweedFS volumeDaily copy of the seaweedfs-data volume, or a sync of the bucket to other S3 storage
.env and the master keyPassword manager or vault, separate from the dumps
RedisNot needed
# Database dump (custom format)
docker compose exec -T postgres pg_dump -U storeasy -Fc storeasy > storeasy-$(date -u +%Y%m%dT%H%M%SZ).dump

# Restore into the running stack (stop the API first)
docker compose stop storeasy-api
docker compose exec -T postgres pg_restore --clean --if-exists -U storeasy -d storeasy < storeasy-<stamp>.dump
docker compose start storeasy-api

Health and status​

EndpointMeaning
GET /api/v1.0/healthcheckLiveness: the process answers. Use this for restarts.
GET /api/v1.0/healthcheck/readyReadiness: 200 when PostgreSQL and Redis answer, 503 otherwise. Do not restart on 503.
GET /health/live, GET /health/readyThe same probes at the API's root.
GET /api/v1.0/system/statusFor the instance admin: version, commit, dependencies, job queues and the e-mail outbox.

Known limits​

  • Not every store call has run against the real store yet; see What works today.
  • The App Store Connect build upload path (STOREASY_APPLE_UPLOAD_MODE=Api) still needs one real build to confirm it; External is the fallback.
  • With several API instances, turn STOREASY_SCHEDULES_ENABLED off on all but one.
  • Re-sealing records after a master key rotation is manual.