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

# Stop a hosted environment when you're not using it

> Suspend a hosted environment's workloads and database with forge env stop, keep its release and data, and bring it back with forge env start.

A staging or demo environment you use a few hours a week doesn't need to run the rest of the time. `reliant forge env stop` suspends a hosted environment: its workloads stop running and stop costing compute, and the environment keeps its URL, its release and its database's data. `reliant forge env start` brings it back on the same release, with nothing to rebuild or redeploy.

Hosting has no autoscaling and never stops an idle environment for you. Stopping is something you do by hand, and [Stopping and deleting an environment](https://docs.reliantlabs.io/hosting/overview.md#stopping-and-deleting-an-environment) compares it with `env delete`.

## Before you begin

* An environment on [Reliant hosting](https://docs.reliantlabs.io/hosting/overview.md). [Deploy a Go API with managed Postgres](https://docs.reliantlabs.io/guides/hosting/deploy-go-api-managed-postgres.md) creates one.
* Forge v1.6.1 or later (`reliant forge --version` inside the project).

**1. Stop the environment**

Run it from the project, naming the environment:

```bash terminal theme={null}
reliant forge env stop prod
```

```text theme={null}
stop requested for env prod; declared state is now:
  DEPLOYMENT  TIER       DECLARED    OBSERVED
  api         backend    suspended   ready
  shop        database   suspended   ready
  migrate     backend    suspended   ready
```

Every deployment of the environment is set to `suspended`, the managed database included. `OBSERVED` is where the platform is now; it converges over the next few minutes. Stopping is never refused.

**2. Check that it stopped**

`env status` compares what the platform runs with the environment's release:

```bash terminal theme={null}
reliant forge env status prod
```

```text theme={null}
Verifying environment prod against release v9.9.1 (1 image(s))
  source   control-plane observer (forge cannot read a hosted env's cluster)

  UNREACHABLE  registry.reliantapi.com/<org-id>/shop/shop
      workloads api
      UserSuspended: suspended by its owner; resume it from the deployment page
```

`UserSuspended` confirms it, and the API's URL now answers `503`. The release stays bound: v9.9.1 is still what the environment runs once it is started.

**3. Start it again**

```bash terminal theme={null}
reliant forge env start prod --wait
```

```text theme={null}
start requested for env prod; declared state is now:
  DEPLOYMENT  TIER       DECLARED   OBSERVED
  api         backend    running    pending
  shop        database   running    pending
  migrate     backend    running    ready
waiting for ready: api=pending shop=pending migrate=ready
waiting for ready: api=degraded shop=pending migrate=ready
waiting for ready: api=ready shop=ready migrate=ready
env prod: every deployment is ready
```

Starting takes a few minutes while the database and the workloads come back. The platform can refuse a start your organization isn't entitled to, for example because of a billing condition. It then starts nothing and prints the reason and the fix.

**4. Verify the data came back**

The database was suspended, not deleted, so the API reconnects to the same data:

```bash terminal theme={null}
curl https://<your-api-host>/readyz
```

```text theme={null}
{"status":"ready","checks":[{"name":"db","ok":true},{"name":"api_listener","ok":true}]}
```

`reliant forge env status prod` reports `2 match, 0 drifted, 0 missing` against the same release.

> [!TIP]
>
> To stop one workload and leave the rest running, pass `--target <name>` to `env stop` and `env start`. The names are the `DEPLOYMENT` column above.

## What this does not do

* **Nothing stops automatically.** No idle timer, schedule or scale-to-zero suspends an environment for you. Run `env stop` yourself, or from a script you run.
* **It is not `env down`.** `reliant forge env down` stops the processes `env up` started on your machine. `env stop` and `env start` act only on a hosted environment and refuse one that isn't hosted.
* **It is not a delete.** To remove the environment, use `reliant forge env delete`, which also deletes its database and its data unless you pass `--keep-data`. See [Stopping and deleting an environment](https://docs.reliantlabs.io/hosting/overview.md#stopping-and-deleting-an-environment).

## Troubleshooting

> [accordion] timed out after 5m0s waiting for env "prod" to be suspended
>
> `env stop --wait` can time out while the environment is already stopped. The stop request was accepted, and the platform keeps converging. Run `reliant forge env status prod`: when it reports `UserSuspended`, the environment is stopped.

> [accordion] the control plane refused to start env
>
> The organization isn't entitled to run the environment, usually because of billing. Resolve the condition the message names (billing is in **Reliant → Settings → Billing**, or ask an org admin), then run `reliant forge env start prod` again. Nothing was started.

## Next steps

> [card] [Preview environments](https://docs.reliantlabs.io/hosting/preview-environments.md)
>
> Environments per pull request that expire on their own.

> [card] [Detect configuration drift](https://docs.reliantlabs.io/guides/hosting/detect-config-drift.md)
>
> Check that what runs is what you declared.

> [card] [Inside Reliant hosting](https://docs.reliantlabs.io/deep-dives/inside-reliant-hosting.md)
>
> How the platform runs, suspends and meters an environment.

> [card] [env stop reference](https://docs.reliantlabs.io/reference/cli.md#reliant-forge-env-stop)
>
> Every flag of `env stop`, `env start` and `env delete`.


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