# Shell

Open a terminal in your application's image, with its variables and addons, without touching the instances serving visitors.

A shell starts a new container from your deployed application's image, with the same environment variables and the same addons. Look at files, open a database prompt, try a command — the instances serving your visitors are not touched, and the container is removed when the session ends.

## In the console

Open the project's **Shell** tab and choose **Open shell**. The project needs a deployment first. If the connection drops, **Reconnect** starts a new session.

## From the CLI

```
nesly run --tty -- bash
nesly run --tty -- psql "$DATABASE_URL"
nesly run --tty --deployment dep_3k2m… -- sh    # a specific release's image
```

Without `--tty`, `nesly run` runs a command non-interactively and exits with its exit code — the form for migrations and CI: see [backups & commands](/docs/backups/).

## Limits

-   A session lasts up to 15 minutes by default. From the CLI,`--timeout` asks for longer, up to 30 minutes — something that needs hours is a workload to deploy, not a session.
-   The container's disk is temporary. Files written in a shell are gone when it ends; keep data in a database or object storage ([addons](/docs/addons/)).
-   Opening a shell needs a role that may deploy the project.

---
Canonical: https://nesly.net/docs/shell/
Markdown: Accept: text/markdown on the HTML URL, or replace the trailing slash with .md
