PHP Developer Guide
Other documentationsDemoCommunityGitHub
  • Forest Admin
  • Getting started
    • How it works
    • Quick start
      • Symfony
      • Laravel
    • Create your agent
    • Troubleshooting
    • Migrating legacy agents
      • Pre-requisites
      • Recommendations
      • Migration steps
      • Code transformations
        • API Charts
        • Live Queries
        • Smart Charts
        • Route overrides
        • Smart Actions
        • Smart Fields
        • Smart Relationships
        • Smart Segments
  • Data Sources
    • Getting Started
      • Collection selection
      • Naming conflicts
      • Query interface and Native Queries
        • Fields and projections
        • Filters
        • Aggregations
    • Provided data sources
      • Doctrine
      • Eloquent
        • Polymorphic relationships
    • Write your own
      • Translation strategy
        • Structure declaration
        • Capabilities declaration
        • Read implementation
        • Write implementation
        • Intra-data source Relationships
      • Contribute
  • Agent customization
    • Getting Started
    • Actions
      • Scope and context
      • Result builder
      • Static Forms
      • Dynamic Forms
      • Related data invalidation
    • Charts
      • Value
      • Objective
      • Percentage
      • Distribution
      • Leaderboard
      • Time-based
    • Fields
      • Add fields
      • Move, rename and remove fields
      • Override binary field mode
      • Override writing behavior
      • Override filtering behavior
      • Override sorting behavior
      • Validation
    • Hooks
      • Collection hook
      • Collection override
    • Pagination
    • Plugins
      • Write your own
    • Relationships
      • To a single record
      • To multiple records
      • Computed foreign keys
      • Under the hood
    • Search
    • Segments
  • Frontend customization
    • Smart Charts
      • Create a table chart
      • Create a bar chart
      • Create a cohort chart
      • Create a density map
    • Smart Views
      • Create a Map view
      • Create a Calendar view
      • Create a Shipping view
      • Create a Gallery view
      • Create a custom tinder-like validation view
      • Create a custom moderation view
  • Deploying to production
    • Environments
      • Deploy on AWS
      • Deploy on Heroku
      • Deploy on GCP
      • Deploy on Ubuntu
    • Development workflow
    • Using branches
    • Deploying your changes
    • Forest Admin CLI commands
      • init
      • login
      • branch
      • switch
      • set-origin
      • push
      • environments:create
      • environments:reset
      • deploy
  • Upgrade
    • Laravel agent upgrade to v3
  • Under the hood
    • .forestadmin-schema.json
    • Data Model
      • Typing
      • Relationships
    • Security & Privacy
Powered by GitBook
On this page

Was this helpful?

  1. Deploying to production

Environments

PreviousCreate a custom moderation viewNextDeploy on AWS

Last updated 1 year ago

Was this helpful?

This is the official documentation of the forestadmin/laravel-forestadmin v2+ and forestadmin/symfony-forestadmin PHP agents.

Once your project successfully installed, a local Development environment is created for you, with a temporary pre-deploy-to-production branch (more on branches later).

Your first objective should be to deploy to Production.

Deploying to Production

Forest Admin is meant to help you manage your operations: this can only happen if your team operates on your Production data. To do so, you need to create your Production Environment.

Click "Deploy to production" on the top banner or in the "Environments" tab of your Project settings.

Deploy your Agent

In the first step, you need to input your Agent's URL. This is the URL of the server onto which you have deployed (or will soon deploy) your Agent's codebase:

Note that for security reasons, your agent must use the HTTPS protocol.

The URL must not end with a trailing /.

Connect to your database

In the next step, you need to fill out your Production database credentials:

Your database credentials never leave your browser and are solely used to generate environment variables on the next step, so they are never exposed.

Set your environment variables

The final step requires that you add environment variables to your server. Follow the on-screen instructions:

Once your server is successfully detected and running with the indicated environment variables, a "Finish" button will appear. Click on it to finalize the creation of your Production Environment.

Creating a Remote Environment

Now that your admin panel is live in production, you might want to add an extra step for testing purposes. Forest Admin allows you to create Remote Environments (for test, qa, staging, pre-production,... purposes).

To create a new Remote Environment, go to your Project settings (1):

Then from the "Environments" Tab, click on "Add a new environment" (2).

You can choose to deploy to a Remote Environment before going to production (see below), it's up to you.

Choose your Environment name

You'll first be asked to input the name of the Remote Environment you wish to create:

Enter your Agent's URL for that Environment

Deploy your Agent server in this specific environment, then input its URL:

Connect to your database

You need a separate database for this new environment: if you're creating a Staging, then it must be your staging data, so your staging database.

Your database credentials never leave your browser and are solely used to generate environment variables on the next step, so they are never exposed.

Set your environment variables

The final step requires that you add environment variables to your server. Follow the on-screen instructions:

Once your server is successfully detected and running with the indicated environment variables, a Finish button will appear. Click on it to finalize the creation of your new Remote Environment.

Change Environment origin

You can change the origins of your Environments to create complex workflows, for instance, dev > staging > preprod > production. All the layouts of an environment will be generated based on its parent's layout.

To do so, click on the Environment you wish to change the origin of, and from its details page, select the desired origin in the "Set Origin" section.

All child Environments will be refreshed based on the new hierarchy.

Set an Environment as Production

A standard project usually has a production and at least a staging Environment, but you may be using other Remote Environments. At some point, you may feel the need to set another Environment as your Production Environment (also known as "reference").

To set as production an Environment it should have the actual reference as origin.

To do so, click on the Environment you wish to set as production, and from its details page, click "Set as production".

The actual reference will take the new production as the origin. All children layouts will be refreshed. Any layout change that is not applicable will be ignored.

Delete an Environment

You may also delete an Environment. Be very careful as there is no going back!

If you need help deploying your Agent's codebase, here are step-by-step guides showing how it can be done , , or .

on AWS
on Heroku
on Google Cloud Platform
on a standard Ubuntu server