> ## Documentation Index
> Fetch the complete documentation index at: https://docs.forest.app/llms.txt
> Use this file to discover all available pages before exploring further.

# forest environments:create

> Create a remote or production environment in a Forest project

# forest environments:create

Create a new environment in a project. Use it to add a remote environment (such as staging) or the first production environment.

## Usage

```bash theme={null}
forest environments:create --name <NAME> [options]
```

## Options

| Option | Description |
| - | - |
| `-n, --name` | Name of the environment (required) |
| `-u, --url` | URL of the application serving the Forest back-end. Required, except with `--type production` |
| `-t, --type` | Environment type: `remote` (default) or `production` |
| `-p, --projectId` | The ID of the project to work on |
| `--disableRoles` | Create the environment without roles. Not allowed with `--type production` |
| `--format` | Output format: `table` (default) or `json` |

## Environment types

| Type | Use |
| - | - |
| `remote` | A shared, non-production environment, such as staging. A remote environment needs a `--url`: without one, Forest has no back-end to reach and the environment stays inactive |
| `production` | The project's production environment. The URL is optional at creation and can be set later with [`forest environments:update`](https://docs.forest.app/reference/cli/environments-update) |

Development environments are not created with this command: [`forest init`](https://docs.forest.app/reference/cli/init) creates your personal development environment.

> [!NOTE]
>
> `--disableRoles` is rejected with `--type production`, because the production environment is where Forest creates the project's default roles.

## Examples

```bash theme={null}
# Create a staging environment
forest environments:create --name staging --url https://staging-api.example.com

# Create the production environment without a URL yet
forest environments:create --name Production --type production

# Create an environment in a specific project and print it as JSON
forest environments:create -n preprod -u https://preprod-api.example.com -p 42 --format json
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.