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

# nsc run-compose

Quickly start a set of containers from your compose project in an ephemeral environment.

Removed: use [`nsc docker attach-context`](/docs/reference/cli/docker-attach) instead.

`run-compose` no longer exists as a CLI command. The rest of this page is kept for historical reference.

`run-compose` started a set of containers defined in a [compose file](https://docs.docker.com/compose/compose-file/)
in an ephemeral environment. Similar to `docker-compose`, `nsc run-compose`
uses *compose.yaml* (preferable), *compose.yml*, *docker-compose.yaml* or
*docker-compose.yml* file in working directory.

## Usage

```bash theme={null}
nsc run-compose [--dir <dir>] [--development] [-o <plain|json>]
```

### Example

In the following example, `nsc` starts containers using compose file in the
current directory:

<Steps titleSize="h4">
  <Step title="Start the containers">
    Start the containers defined in the compose file:

    ```bash theme={null}
    nsc run-compose
    ```

    ```text nocopy Output theme={null}
    Created new ephemeral environment! (id: 9f8q34lp1v0v6).

    More at: https://cloud.namespace.so/01gr1g2rpb7ahzddy3f227exq9/instance/9f8q34lp1v0v6
    ```
  </Step>

  <Step title="Connect to the instance">
    Connect using the instance ID from the output:

    ```bash theme={null}
    nsc ssh 9f8q34lp1v0v6
    ```
  </Step>

  <Step title="Inspect the containers">
    List the created containers with `nerdctl`:

    ```bash theme={null}
    nerdctl ps
    ```
  </Step>

  <Step title="Expose a service">
    Expose any service from the compose file publicly using the
    [`nsc expose`](/docs/reference/cli/expose) command with the flag `--source containerd`.
  </Step>
</Steps>

## Options

<h3 id="--dir-dir">
  \--dir \<dir>
</h3>

To specify a working directory from where `nsc` loads the compose file.

<h3 id="--development">
  \--development
</h3>

Specify to enables development facilities, including making containers optional.

<h3 id="-o-type">
  -o \<type>
</h3>

Specifying `run-compose` command output format. Supported options are `json` and
`plain`. By default `plain` output format is used.

<h3 id="--wait">
  \--wait
</h3>

Wait for all containers to start running.
