← All guides
Cursor env vars rescue
Cursor env vars work locally but break on the production server
CursorVPSSupabase
Short answer
A clean environment variable map for the production server with secrets rotated where needed.
Why this matters
The app runs fine in Cursor but crashes or behaves strangely on the server because every secret, API key, and callback URL is missing.
Walkthrough
- 01
Audit every variable the app needs
Search the codebase for process.env references and list each one.
- Separate public frontend variables from server-only secrets.
- Identify which variables must be available at build time vs runtime.
- Note which URLs and keys still point to local or test values.
- 02
Set variables on the production server
Load env vars from the deploy panel or server environment, not from files.
- Add each variable to your deploy panel environment store.
- Update all callback URLs, auth redirects, and webhook endpoints to the production domain.
- Rotate any key that was ever visible in Cursor workspace files.
- 03
Rebuild and verify
After setting env vars, rebuild the app and test every integration.
- Run a clean production build with the new environment.
- Test database connections, auth flows, payment webhooks, and email.
- Confirm no local URLs remain in the running app.
Where RepoAssistant fits
RepoAssistant cleans up Cursor environment variables during production deploy so nothing breaks on launch.