Deployment
Production Readiness
Before serving users, check the public endpoints, secrets, storage and workers against the environment you will actually run.
Use this checklist before exposing an Open Mercato deployment to real users or production data. It is the shared readiness and security baseline for every hosting provider; complete it together with the provider-specific VPS or Railway guide.
Record the owner and evidence for each item. Do not paste secret values into tickets, deployment logs, screenshots, or this checklist.
Ordered production checklist
-
Make HTTPS, TLS, DNS, certificates, and the reverse proxy ready first.
- ☐ Choose the final public hostname before configuring callbacks, webhooks, or application URLs.
- ☐ Point every required DNS record at the intended ingress and remove stale records. Check both IPv4 and IPv6 when both are published.
- ☐ Install a valid certificate with its complete chain, automate renewal, and alert before expiry.
- ☐ Redirect HTTP to HTTPS and confirm the application is not directly reachable on an unintended public port.
- ☐ With bundled Traefik, use Compose 2.24.4+, recreate affected containers after upgrading, and verify the merged configuration and running containers publish neither the app nor collaboration ports. Migrate direct-port health probes to HTTPS and expose optional collaboration through WSS. Follow the bundled Traefik migration and deployment checks, including any local overrides.
- ☐ Forward the original host, client address, and protocol through the proxy, and trust forwarded headers only from the known proxy hops. For a self-managed host, start from the VPS nginx example.
- ☐ Keep PostgreSQL, Redis, search, and internal worker endpoints off the public internet.
- ☐ Set edge request-size, timeout, rate-limit, and administrative-route policies deliberately; do not rely on unreviewed provider defaults.
- ☐ Set the public application URLs to the same canonical
https:// origin and test the certificate and redirect from outside the hosting network.
-
Prepare the production environment and secrets.
Required settings
- ☐ Compare the deployment's variable names with
packages/create-app/template/.env.example from the exact release. Do not read live values into a ticket or copy development values into production.
- ☐ Set
NODE_ENV=production; set APP_URL and, when the topology uses them, INTERNAL_APP_ORIGIN and PLATFORM_PRIMARY_HOST to exact production origins. Configure database/cache connections for the production services.
- ☐ Generate unique high-entropy authentication, session, JWT, lookup-hash, and tenant-encryption secrets for this environment. Never commit live
.env*, secret exports, private keys, or token caches; sanitized .env.example templates are the intentional exception and must contain names, comments, and safe placeholders only.
- ☐ Remove placeholders, demo autologin, test injections, debugging/profiling switches, DevTools, and emergency authentication bypasses.
Recommended settings and process
- ☐ Store secrets in the hosting platform's secret store or another access-controlled secret manager. Restrict who can read or change them, and confirm logs and build output do not reveal values.
- ☐ Give each secret an owner, rotation procedure, and recovery procedure. Document the user and data impact of rotating signing or encryption keys before rotating them.
Module-specific settings
- ☐ Supply only the credentials and deliberate feature or license flags required by enabled modules and providers. Disable unused integrations instead of configuring speculative credentials.
- ☐ Treat mail, payment, shipping, AI, webhook, object-storage, collaboration, and enterprise settings as required only when the corresponding capability is enabled.
The installation prerequisites describe baseline application variables, while data encryption covers encryption keys and their operational constraints.
-
Review provider and module settings.
- ☐ Enable only the modules required for this environment and re-run generation when module discovery changes.
- ☐ Configure every enabled external provider – such as mail, payments, shipping, AI, webhooks, and object storage – with production endpoints and credentials.
- ☐ Review settings stored through the application UI as well as environment variables; tenant-scoped provider configuration may not come from the process environment.
- ☐ Run each available provider health check and complete a safe end-to-end test using the production account or an explicitly isolated production test resource.
- ☐ Confirm callback and webhook URLs use the canonical HTTPS hostname.
See modules and the Integrations user guide for the two configuration layers.
-
Provision and isolate the infrastructure.
- ☐ Size the application, database, Redis, search service, and worker capacity for expected load and peak operations such as imports or reindexing.
- ☐ Use durable production services and storage; do not rely on an ephemeral container filesystem for state.
- ☐ Put stateful services on private networking or firewall them to only the processes and operator paths that need access. Require TLS and least-privilege service identities when those services are external.
- ☐ Set connection-pool, acquisition, idle, request, CPU, memory, disk, and timeout budgets, and leave headroom for builds, migrations, background jobs, and backups.
- ☐ For multi-process deployments, use shared Redis-backed cache coordination, events, and asynchronous queues rather than process-local or SQLite state.
- ☐ Define who applies schema migrations, ensure only one migration run occurs for a release, and verify the target database supports the required extensions.
-
Protect data and prove backups can be restored.
- ☐ Back up PostgreSQL and every durable file or object-storage location that contains business data. Treat Redis and search indexes according to whether your topology uses them as rebuildable or durable state.
- ☐ Encrypt backups, restrict access, keep at least one failure-domain-separated copy, and define retention from business and regulatory requirements.
- ☐ Set recovery-point and recovery-time objectives, monitor backup jobs, and test a restore into an isolated environment on a schedule.
- ☐ Take a recoverable backup before migrations or other high-risk data operations and record the exact restore procedure for the chosen provider.
- ☐ Verify restored encrypted data remains readable with the restored key material; a database backup without its required keys is incomplete.
The VPS guide includes concrete PostgreSQL backup and restore commands. For attachments, review Storage Hub before selecting local or object storage.
-
Lock down operator and application access.
- ☐ Remove or disable demo accounts, rotate bootstrap credentials, and require unique operator accounts.
- ☐ Grant roles and API keys the minimum features and organization scope they need. Review privileged access separately.
- ☐ Protect hosting, DNS, database, backup, and source-control accounts with strong authentication and recovery procedures; enable MFA where the provider supports it.
- ☐ Limit SSH, console, and database administration paths by identity and network, and retain an audited break-glass route.
- ☐ Test that ordinary users and integrations cannot reach another tenant, organization, or privileged administration surface.
- ☐ Restrict CORS and real-time collaboration origins to the intended HTTPS origins; verify cookies and callbacks do not accept a sibling or wildcard origin unexpectedly.
- ☐ Verify the deployed CSP and other security headers from
packages/create-app/template/next.config.ts, adding only narrowly required provider origins.
- ☐ Rate-limit authentication, public APIs, uploads, and expensive operations. For enabled webhooks, enforce body-size bounds, verify signatures against the raw body, reject stale or replayed deliveries, and make processing idempotent.
Use Users and roles and API keys to review application access.
-
Run production workers and choose durable storage.
- ☐ Use the Redis-backed async queue for multi-process production work and run separately managed worker processes for the queues your enabled modules require.
- ☐ Disable in-app worker auto-spawn when dedicated workers own the queues; do not let two process models compete for the same operational role.
- ☐ Deploy the same release and compatible configuration to the web and worker processes.
- ☐ Confirm workers start after deploy, consume a test job, retry safely, and expose enough signals to detect a stalled or growing queue.
- ☐ Put uploaded files on a persistent volume or external object store, then test upload, download, deletion, quota, and backup behavior.
- ☐ Include scheduled jobs and event consumers in process supervision and restart policies.
Follow Queue & Workers for the production worker topology and Storage Hub for S3-compatible storage.
-
Make the deployment observable.
- ☐ Centralize structured application and worker logs with retention, access control, and sensitive-data filtering.
- ☐ Add uptime and external HTTPS checks for the public application, including
/api/healthz, plus readiness/dependency checks for the database, Redis, workers, and storage.
- ☐ Collect metrics and traces appropriate to the topology, and propagate alerts to an owned on-call or operations channel.
- ☐ Alert on certificate expiry, failed backups, repeated application errors, queue growth, worker absence, resource saturation, and disk exhaustion.
- ☐ Put dashboards, alert owners, and first-response runbooks in one discoverable location.
New Relic APM agent (development branch after v0.10.0). In the v0.10.0 configuration, application log forwarding is enabled. Review the configuration shipped with your release. In newer code, when NEW_RELIC_LICENSE_KEY is configured, the repository's newrelic.js keeps request parameters out of the agent's default attributes and disables application log forwarding. Existing deployments that rely on forwarded logs must explicitly set NEW_RELIC_FORWARD_LOGS=true and restart the instrumented process. Review application logs for personal data and secrets before opting in; forwarding sends their content to New Relic. Sensitive request-header exclusions remain in place.
For an EU-region New Relic account, set NEW_RELIC_HOST=collector.eu01.nr-data.net in the instrumented process environment. Review the account region, retention, access controls, and any international transfers before enabling monitoring; do not assume the destination meets your deployment's data-residency requirements. NEW_RELIC_HOST selects the APM agent collector, while the separate OTLP integration uses OTEL_EXPORTER_OTLP_ENDPOINT. See New Relic's Node.js agent host setting and EU collector endpoints.
Open Mercato provides guidance for structured logging, OTLP telemetry, and system-status variables.
-
Validate the release before production traffic.
- ☐ Run generation, the production build, tests, and migration checks for the exact commit or immutable artifact being released.
- ☐ Scan the standalone app locally and in CI before deployment, then inside the deployed staging and production workloads with their own runtime configuration. Resolve weak/default credentials and keep local plaintext secret files out of the deployed artifact; assign owners and evidence to remaining review warnings.
- ☐ Rehearse the release in a production-like environment using sanitized or synthetic data.
- ☐ Smoke-test HTTPS, sign-in, authorization boundaries, representative create/update/delete flows against a real database, file handling, background work, email/webhook delivery, and every business-critical integration.
- ☐ Verify health checks fail when a required dependency is unavailable and recover when it returns.
- ☐ Verify TLS, HTTP-to-HTTPS redirect, public security headers, origin/CORS behavior, and trusted proxy/client-address handling from outside the private network.
- ☐ Record the artifact identifier, configuration revision, migration set, approver, and evidence.
-
Plan and execute a controlled rollout.
- ☐ Define a change window, owner, communication channel, success metrics, and explicit abort thresholds.
- ☐ Confirm the pre-deploy backup and rollback inputs before changing the database or serving the new release.
- ☐ Roll out gradually when the platform supports it; otherwise use a maintenance window for changes that cannot safely overlap versions.
- ☐ Keep web and worker versions compatible during the transition and avoid processing new-shape jobs with old code.
- ☐ Watch logs, health, queues, latency, errors, and critical business flows throughout the observation window.
-
Prepare and rehearse rollback.
- ☐ Keep the previous deployable artifact and its configuration available without rebuilding from a moving branch.
- ☐ Write provider-specific rollback commands and identify who is authorized to run them.
- ☐ Classify database changes as backward-compatible or restore-requiring; do not assume an application rollback also reverses a migration.
- ☐ Define how workers, scheduled jobs, and inbound traffic are paused when rolling back incompatible data or job formats.
- ☐ Test rollback or restore in a non-production environment, then document the decision, timing, validation, and follow-up after any real rollback.
Readiness scanner
Run the Open Mercato Readiness Scanner against your standalone app locally before deployment, then inside the staging and production workloads before serving traffic:
npx --yes [email protected] scan . --fail-on high
Scanning is read-only. Credential checks are always enabled: supported root .env* files, visible runtime credentials, and supported Compose settings are assessed in memory without exposing values in findings. A strong injected secret does not hide an unsafe value still present in a deployed environment file. Resolve weak/default credentials and use runtime secret injection rather than shipping plaintext secret files.
See the scanner guide for all CLI options, reports, CI exit codes, local safe fixes with apply, server prerequisites, and the distinction between local warnings and production failures. KMS and secret-injection warnings still require operator review even on a correctly configured server.
Use its findings alongside this checklist. Static checks cannot prove that deployed TLS, backups, restore procedures, alerts, or provider settings work; operators must verify those items in the deployed environment.
Provider runbooks
- VPS / Docker Compose – host setup, Compose services, nginx, volumes, and host-level operations.
- Railway – CLI provisioning, source modes, Railway variables, domains, volumes, and resource state.
The provider runbook tells you how to configure that platform. This page remains the source of truth for what must be ready before production traffic.