Skip to main content

The environment "main" is not currently active


1 comment

  • Chad Carlson

    You will receive that error on a created project that has not yet been initialized with a code base.

    The main environment is automatically activated when you push your code to it, so run the following commands from your local project repository:

    • Set as remote

      $ platform project:set-remote <project ID>
      Setting the remote project for this repository to: myapp (<project ID>)

      You can retrieve your <project ID> with the command platform project:list.

    • Push to

      If you have not already initialized a Git repository for your project, first run git init. Then,

      $ git add .
      $ git commit -m "Moving to"
      $ git push platform main
    • When the build process has completed you can SSH into master with:

      $ platform ssh

    If in the future you add and push a development branch to, unlike master that branch dev will not automatically be activated. In order to SSH into dev, you can activate it from within your local project directory using

    $ git checkout dev
    $ platform environment:activate

Please sign in to leave a comment.