Observe
Terminal
Open a shell inside a running container from the browser, and know why it closes.
Updated
The Terminal page opens a shell inside one of a service's running containers, from the browser. Use it to look around a container, run a one-off command or check what your application sees, such as its files and its environment. The shell runs inside the container, never on the server underneath it.
Open a shell
Open Terminal in the rail, under Infrastructure, and choose:
Service: the service to enter, from the organization the console is in. Only running services are listed, because a stopped service has no container to open. With none running, the page reads "No service is running. Deploy one and open a shell here."
Shell:
sh,bash,zshorash.shis the default. The other three work only when the service's image includes them.Container: which container to enter. This menu appears only when the service runs more than one, as an application with replicas or a compose stack does. Otherwise the shell opens in the service's only running container.
The shell opens as soon as the choices are made. Its status chip reads Connecting, then Connected. The choices are kept in the page's address, so a bookmarked or shared link opens the same service, shell and container.
Connect with SSH
Above the terminal, the Connect with SSH line holds the command that opens the same service and shell from a terminal on your own machine, with a copy button. It follows your choice of Shell: choosing bash adds +bash after the service's id. The line reads "Select a running service to get the SSH command" until a service is chosen.
The command works with any public key under Settings, then SSH keys. SSH access covers keys and what the gateway allows, and Connect with SSH walks through a first connection.
The terminal is 80 by 24
Programs inside the container see a terminal of 80 columns by 24 rows, and it does not resize; the page says so beside the status chip ("Programs inside see 80 by 24"). The console draws the terminal as wide as the page allows, and never narrower than 80 columns. Two things follow:
Output wider than 80 columns shows in full on a wide screen.
The shell believes it wraps at column 80, so a command line longer than that is redrawn as though it wrapped there.
Full-screen programs such as editors and pagers draw themselves at 80 by 24.
Close a shell
Typing exit ends the shell but leaves the connection open. Press Close shell to close it. Once a shell has closed, for any reason, Open a new shell starts another with the same choices.
Cloud records each shell opened, with its service, container and shell, in its audit log. What you type is not recorded.
When a shell closes
A closed shell prints the reason in the terminal and beside the status chip:
| Sentence | What happened |
|---|---|
| Closed after 30 minutes idle. | Nothing was typed and nothing was printed for thirty minutes. |
| The engine closed the connection. | The container stopped or was replaced by a deploy, or the platform ended the stream. |
| Nothing is running. | The service has no running container any more. |
| Too many open connections. Close one and try again. | Your account already has 8 logs, terminals and SSH sessions open, or the platform is at its own ceiling for a moment. |
| The engine did not answer. Try again in a minute. | The platform did not respond. |
| Sign in to continue. | Your session ended. Sign in and open the terminal again. |
| The connection was lost. | The network dropped between your browser and Cloud. |
Logs and terminal closed has more on each.
Changes inside a container do not last
A deploy replaces a service's containers. Files you create or change from the terminal are gone after the next deploy unless they are on a volume.