Deploy to production
Production deployments should build the app, apply committed migrations, then run the web server and at least one worker.
pnpm run buildThe build creates:
Directorydist/
Directoryui/
- …
Directoryopenshop/
Directoryserver/
- …
Configure environment
Section titled “Configure environment”Single-app deployments usually need:
DATABASE_URL=postgresql://...SHOPIFY_API_KEY=...SHOPIFY_API_SECRET=...HOST=https://your-app.example.comENCRYPTION_KEY=<64 hex characters>Generate an encryption key:
openssl rand -hex 32ENCRYPTION_KEY protects provider credentials and Shopify access tokens. Treat it as required in production.
Apply migrations
Section titled “Apply migrations”Generate and review migrations in development or CI:
pnpm exec openshop migrate generatepnpm exec openshop migrate checkCommit the generated SQL in ./drizzle, then apply committed migrations before starting production processes:
pnpm exec openshop migrateopenshop migrate only applies SQL from ./drizzle. It does not run generation tooling.
Start processes
Section titled “Start processes”Run the web server and worker separately:
pnpm exec openshop startpnpm exec openshop worker --concurrency=5openshop start serves HTTP traffic and dispatches cron runs. It does not execute queued flow runs. At least one worker must be running for queued runs to complete.
Verify it worked
Section titled “Verify it worked”- The web process starts without migration errors.
- The worker process starts and reports no database connectivity errors.
- The embedded admin UI loads inside Shopify.
- A test flow run moves from queued to completed or failed with logs.
Rollback notes
Section titled “Rollback notes”OpenShop does not apply migrations on boot. If a deploy fails before migrations are applied, roll back the app process only. If committed SQL was already applied, use your normal database rollback or forward-fix process.