Understand environments and branches
Forest distinguishes between environments (your local dev, staging, production) and branches (layout and configuration changes in progress).- Your production environment is the live back-office your team uses
- Your development environment is your local Forest back-end
- Branches let you make layout changes without affecting production until you’re ready to deploy
Deploy your back-end
Deploy your back-end to your infrastructure
Host your Forest back-end on any platform that can run a Node.js application (AWS, Heroku, GCP, your own servers, etc.).Make sure to set the environment variables (
FOREST_ENV_SECRET, FOREST_AUTH_SECRET, DATABASE_URL) in your hosting platform.Create a production environment in Forest
In Forest, go to Project Settings → Environments → Add environment.Give it a name (e.g. “Production”) and enter the URL where your back-end is running.
For a full explanation of the development workflow, branches, schema updates, environment management, see Developer Workflow.
Keep the production schema up to date
.forestadmin-schema.json describes your data model to Forest. In development it’s regenerated every time your agent boots.
We recommend committing it with your code: schema changes then show up in pull-request diffs, can be reviewed, and can be reverted in Git.
Fail CI when the committed schema drifts
Because the file is generated locally, someone can change a data source or customization and forget to commit the regenerated schema, shipping a stale one. Add a CI step that regenerates it and fails when it differs from what’s committed, so a forgotten commit turns the build red:- Node.js
- Ruby
Call Your CI job needs the same environment variables as your back-end (
agent.generateSchemaOnly() (available since @forestadmin/agent 1.83.0) from a one-shot script that reuses your agent setup, then diff the result. Extract your agent into a shared factory that does not call .start():FOREST_ENV_SECRET, FOREST_AUTH_SECRET, DATABASE_URL): createAgent requires the secrets even though generation is offline by default. Experimental no-code customizations also fetch their configuration from Forest, which requires connectivity.Generate the schema at build time
Alternatively, you can generate the schema in your CI/CD pipeline and bake it into your build artifact instead of committing it. This isn’t the default, but some teams prefer it when merge conflicts on.forestadmin-schema.json or forgotten regenerations are a recurring pain: you trade the reviewable Git diff for a conflict-free, always-fresh file, and no longer commit it.
Run the same generation command, then bake the file into your image instead of diffing it:
- Node.js
- Ruby
What’s next
Production is live. Time to invite your team.Next: Invite your team →
Add users, create teams, and set up permissions