Deploy with Node.js
Start from a project created with the Node.js target. See Run locally.
1. Register a production GitHub App
npm run setup:github-app -- --base-url cms.example.comCredentials are written to .env.production.local. Move them to your host's secret store.
2. Set environment variables
In your host's secret store, set:
BETTER_AUTH_URLto your public URL, such ashttps://cms.example.com.BETTER_AUTH_SECRETto a new value fromopenssl rand -base64 32.DATABASE_URLto a file on persistent storage, such asfile:/var/lib/pagescms/pagescms.db, or alibsql://URL withDATABASE_AUTH_TOKEN.ADMIN_EMAILSto your verified sign-in email for instance-wide Admin access. Separate multiple addresses with commas; if unset, no one is an instance administrator.
See Environment variables for the rest. Back up the database.
3. Build and start
npm install
npm run migrate
npm run build
npm startThe app listens on port 3000. Change it with npm start -- --port 8080 --host 0.0.0.0. Run it under a process manager such as systemd or PM2.
4. Add a reverse proxy
Terminate HTTPS at the proxy and forward to the app's port. The proxy must overwrite X-Forwarded-For with the client IP, since sign-in rate limits rely on it. Don't expose the app's port directly.
Open your URL and sign in with GitHub.