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

# astro dev restart

<Info>The behavior and format of this command are the same for both Astro and Astro Private Cloud.</Info>

Stop your Airflow environment, rebuild your Astro project into a Docker image, and restart your Airflow environment with the new Docker image.

This command can be used to rebuild an Astro project and run it locally. For more information, read [Build and run a project locally](/docs/cli/v1.42/run-airflow-locally).

## Usage

```sh wrap theme={null}
astro dev restart
```

<Note>
  In standalone mode, this command recreates the virtual environment instead of rebuilding a Docker image. If you started your environment with `astro dev start --standalone` without setting `dev.mode` to `standalone`, pass `--standalone` so this command restarts your standalone environment.
</Note>

## Options

| Option               | Description                                                                                                                              | Possible Values                                                                                                                          |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `--build-secrets`    | Run `docker build --secret` to mount a secret value to your Docker image.                                                                | `id=<your-secret-id>, src=<path-to-secret> .` See [Docker documentation](https://docs.docker.com/build/building/secrets/#secret-mounts). |
| `-e`,`--env`         | Path to your environment variable file. Default is `.env`                                                                                | Valid filepaths                                                                                                                          |
| `-i`, `--image-name` | The name of a pre-built custom Docker image to use with your project. The image must be available on your local machine.                 | A valid name for a pre-built Docker image based on Astro Runtime                                                                         |
| `-k`, `--kill`       | Kill all running containers and remove all data before restarting. Equivalent to running `astro dev kill` followed by `astro dev start`. | None                                                                                                                                     |

## Examples

```sh wrap theme={null}
$ astro dev restart --env=/users/username/documents/myfile.env
```

## Related commands

* [`astro dev start`](/docs/cli/v1.42/astro-dev-start)
* [`astro dev stop`](/docs/cli/v1.42/astro-dev-stop)
* [`astro dev kill`](/docs/cli/v1.42/astro-dev-kill)
* [`astro dev init`](/docs/cli/v1.42/astro-dev-init)
* [`astro dev run`](/docs/cli/v1.42/astro-dev-run)
* [`astro dev logs`](/docs/cli/v1.42/astro-dev-logs)
