# Production checklist

URL: https://lyeve.com/docs/deploy/production-checklist/

Work through this before real users or real data reach a deployment. One line per item, each
linked to the page that explains it. With `APP_ENV` unset or `production`, the engine checks the
items marked "refused" itself and will not start until they pass.

## Secrets

- [ ] `JWT_SECRET` is a random value of at least 16 characters (refused). [Configuration](https://lyeve.com/docs/reference/configuration/#start-here)
- [ ] `ENCRYPTION_KEY` is a different random value of at least 32 characters, stored durably (refused). [Configuration](https://lyeve.com/docs/reference/configuration/#start-here)
- [ ] `LYEVE_AUDIT_HMAC_KEY` is exactly 64 hex characters (refused). [Configuration](https://lyeve.com/docs/reference/configuration/#start-here)
- [ ] `LYEVE_CONSOLE_KEY` holds the same value on the engine and LyEve Console. [Configuration](https://lyeve.com/docs/reference/configuration/#sign-in-tokens-and-passwords)
- [ ] `LYEVE_SETUP_TOKEN` is set when more than one replica can answer first-run setup. [Configuration](https://lyeve.com/docs/reference/configuration/#sign-in-tokens-and-passwords)
- [ ] Secrets live in a secret store or an uncommitted `.env` file. [Secure your instance](https://lyeve.com/docs/how-to/secure-your-instance/)

## Tokens and cookies

- [ ] The signing key at `JWT_KEY_PATH` is on a volume, or the same file on every replica. [Kubernetes](https://lyeve.com/docs/deploy/kubernetes/#the-signing-key)
- [ ] The signing key file is readable by its owner only (refused). [Configuration](https://lyeve.com/docs/reference/configuration/#what-production-refuses)
- [ ] `JWT_EXPIRY_SECS` is a deliberate choice of `3600` or less (refused above). [Secure your instance](https://lyeve.com/docs/how-to/secure-your-instance/)
- [ ] `SECURE_COOKIE=true`, and the deployment is served over HTTPS end to end (refused). [Docker images](https://lyeve.com/docs/deploy/docker/#reverse-proxy-and-tls)
- [ ] `PASSWORD_HASH_ALGO` and the password rules are chosen on purpose. [Secure your instance](https://lyeve.com/docs/how-to/secure-your-instance/)

## Network and proxies

- [ ] `LYEVE_CONSOLE_URL` is the console's public `https` URL. [Configuration](https://lyeve.com/docs/reference/configuration/#network-and-proxies)
- [ ] `LYEVE_BASE_URL` is the engine's public URL. [Configuration](https://lyeve.com/docs/reference/configuration/#network-and-proxies)
- [ ] `CORE_INTERNAL_URL` and `CORE_API_INTERNAL_URL` are set on the console. [Docker images](https://lyeve.com/docs/deploy/docker/#the-admin-image)
- [ ] `CORS_ORIGINS` lists the exact origins of your browser apps (`*` refused). [Secure your instance](https://lyeve.com/docs/how-to/secure-your-instance/)
- [ ] `TRUSTED_PROXIES` names your proxy or load balancer CIDRs. [Secure your instance](https://lyeve.com/docs/how-to/secure-your-instance/)
- [ ] `RATE_LIMIT_RPS` is set (refused unset). [Secure your instance](https://lyeve.com/docs/how-to/secure-your-instance/)
- [ ] Your proxy sets `X-Forwarded-Proto: https`, on internal plain-HTTP hops too. [Docker images](https://lyeve.com/docs/deploy/docker/#reverse-proxy-and-tls)
- [ ] The Admin API (port 3001) has no public host unless a tool outside your network needs it. [Docker images](https://lyeve.com/docs/deploy/docker/#reverse-proxy-and-tls)
- [ ] `super_admin` is held by as few accounts as possible. [Secure your instance](https://lyeve.com/docs/how-to/secure-your-instance/)

## Database

- [ ] The database user is not `postgres`, `root` or `sa` (refused). [Supported databases](https://lyeve.com/docs/deploy/#supported-databases)
- [ ] `DATABASE_URL` uses `sslmode=require` or stronger outside a private network. [Configuration](https://lyeve.com/docs/reference/configuration/#what-production-refuses)
- [ ] `DATABASE_MAX_CONNECTIONS` times the replicas stays under the database's limit. [Configuration](https://lyeve.com/docs/reference/configuration/#database)
- [ ] The database is backed up, and one restore has been tested. [Backup and restore](https://lyeve.com/docs/how-to/backup-and-restore/)
- [ ] Media is backed up with the database, or stored in a bucket with its own retention. [Object storage](https://lyeve.com/docs/features/object-storage/)

## More than one replica

- [ ] Every replica uses the same signing key file. [Kubernetes](https://lyeve.com/docs/deploy/kubernetes/#the-signing-key)
- [ ] `CACHE_DRIVER=redis` and `REDIS_URL` are set, and the boot log's `refresh token store` line says sessions are shared. [Scaling](https://lyeve.com/docs/scaling/)
- [ ] `RATE_LIMIT_BACKEND=redis` is set. [Rate limiting](https://lyeve.com/docs/features/rate-limiting/)
- [ ] Media goes to an S3-compatible bucket. [Object storage](https://lyeve.com/docs/features/object-storage/)

## Email

- [ ] Outbound email is configured if users rely on invitations, password resets or notifications. [Email](https://lyeve.com/docs/features/email/)

## Features and license

- [ ] `LYEVE_LICENSE_KEY` is set if you use paid features. [Licensing and tiers](https://lyeve.com/docs/concepts/licensing-and-tiers/)
- [ ] `LYEVE_PLUGINS` is empty or names exactly the features you run. [Licensing and tiers](https://lyeve.com/docs/concepts/licensing-and-tiers/)
- [ ] **Plugins** in the console, or `GET /api/admin/plugins/status`, shows the features you expect. [Licensing and tiers](https://lyeve.com/docs/concepts/licensing-and-tiers/)

## Monitoring

- [ ] Readiness probes and uptime checks use `/readyz`, liveness probes `/healthz`. [Health endpoints](https://lyeve.com/docs/deploy/docker/#health-endpoints)
- [ ] Metrics are scraped from `GET /api/admin/metrics` with `METRICS_TOKEN`. [Configuration](https://lyeve.com/docs/reference/configuration/#observability)
- [ ] Logs go somewhere durable, not only to container output. [Logs](https://lyeve.com/docs/features/logs/)

## Free hosting

- [ ] If any part runs on a free plan, its limits are acceptable. [Free-tier stack](https://lyeve.com/docs/deploy/free-tier-overview/#limits-of-the-free-stack)
