# Use the console and power controls

> Start, stop, restart and kill a server, send console commands and read its live output and resource usage.

Source: https://docs.coritan.com/managed-containers/console/

In the dashboard:

- /dashboard/servers/…/console: https://www.coritan.com/dashboard/servers

The **Console** tab is where you watch a server run. It streams the server's output as it happens, takes the commands you type, and shows live CPU, memory, disk and network use. The power buttons sit at the top of the server page, so you can start or stop the server from any tab.

## Before you begin

- The server must have finished installing. The console is not available while the server's status is `installing`, `install_failed`, `transferring` or `suspended`.
- On a server someone shared with you, the owner must have given you the matching permissions: Console (or Command, which grants the same) to open the console and send commands, and Power to start, stop, restart and kill. [Share a server with other users](/managed-containers/users/) lists them.
- A free server that is asleep starts with **Wake server** instead of **Start**. See [How free servers work](/managed-containers/free-servers/).

## Start, stop or restart the server

1. In the [dashboard](https://www.coritan.com/dashboard/servers), go to **Container Apps** and open the server.
2. At the top of the page, select the power action you need:
   - **Start** starts a stopped server.
   - **Restart** stops a running server and starts it again.
   - **Stop** shuts a running server down cleanly, so it saves its data first.

The page only offers the actions that fit the server's state: **Start** while it is stopped, **Restart** and **Stop** while it runs.

## Kill a server that does not stop

Kill ends the server process at once, without letting it save. Use it only when **Stop** does not work.

1. Open the server, then open **More power actions** (the button with three dots) at the top of the page.
2. Select **Kill process…**.
3. Read the warning and select **Kill process**.

> [!WARNING]
> Kill does not wait for the server to save. You lose anything the server has not yet written to disk, such as the last minutes of a game world.

## Send a command

1. Open the server, then the **Console** tab.
2. Type the command in the box under the output, for example `say Server restarts in 5 minutes`.
3. Press <kbd>Enter</kbd> or select **Send**.

The server's reply appears in the output. While the console is disconnected, the box says so and the command goes through the API instead. The output then shows `>` followed by your command.

## Read the output and live stats

- The status next to the server's name says whether the output is live: **Connected**, **Connecting**, **Reconnecting**, **Paused in background** or **Disconnected**. Select **Reconnect** whenever it is not connected.
- When you leave the tab in the background, the console pauses and reconnects when you come back.
- The output keeps the last 2,000 lines.
- The **Live stats** card shows **CPU**, **Memory** and **Disk** against the plan's limits, **Network in**, **Network out** and **Uptime**.
- For Minecraft servers, the card and the bar above the output also show **Players**, **Version** and **Online now** when the game answers the server list ping.

## Result

The status badge at the top of the page changes as the server starts or stops, and a message confirms each action, such as `Starting the server.` The output shows the server's own messages as it boots, and commands you send appear with their replies.

## Troubleshooting

**Console unavailable**
: The server is installing, being moved, suspended, or its install failed. The page says which. The console opens again when the server is ready. For a failed install, see [Troubleshoot servers](/managed-containers/troubleshooting/).

`Access denied. You need console permission.`
: The owner has not given you the Console permission on this server. Ask them to add it on the **Users** tab.

`Connection limit reached. Close other console sessions first.`
: Your account has 8 consoles open on this server, or 32 across all servers. Close console tabs you are not using.

`Session expired. Please sign in again.`
: Your session ended. Sign in again, then reopen the console.

`Cannot reach the host this server runs on`
: The console could not reach the machine that runs the server. It keeps trying. If it stays disconnected, [contact support](https://www.coritan.com/dashboard/support).

`Cannot send power actions while server is suspended`
: A suspended server cannot start. Select **Open Billing** on the banner to check the plan's billing status, or open a support ticket.

`Free servers must be started via the wake endpoint, not a direct power start/restart`
: This is a free server. Start it with **Wake server** on the **Console** tab.

**This server is locked**
: We locked the server during an abuse review. It can be stopped but not started. Select **Open review ticket** to reply to the ticket.

`world_optimization_running`
: We are removing unused chunks from the world, and the server cannot start until that finishes. Try again after the number of seconds in `retry_after_seconds`.

`rate_limited`
: You sent more than 24 power actions to this server in 60 seconds. Wait for the number of seconds in the `Retry-After` header.

## Related

- [Server settings](/managed-containers/settings/) shows the startup command the server runs.
- [Schedule server tasks](/managed-containers/schedules/) sends commands and power actions on a timer.
- [Server limits and rate limits](/managed-containers/limits/) lists every limit on this page.

## With the API

Send a power action with `POST /api/v1/client/servers/{uuid}/power`. The body's `signal` is `start`, `stop`, `restart` or `kill`.

```bash
curl -X POST https://api.coritan.com/api/v1/client/servers/$SERVER/power \
  -H "Authorization: Bearer $CORITAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"signal": "restart"}'
```

The response is `{"message": "Power action 'restart' sent"}`. It confirms that the signal was sent, so read the server's state afterwards to see the result.

Send a console command with `POST /api/v1/client/servers/{uuid}/command`. The command goes in the `command` query parameter, URL-encoded, at most 1,000 characters.

```bash
curl -X POST "https://api.coritan.com/api/v1/client/servers/$SERVER/command?command=say%20Hello" \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

`GET /api/v1/client/servers/{uuid}/resources` returns the server's `state` (such as `running`, `starting`, `stopping` or `offline`), `is_suspended`, and `utilization`, which holds `cpu_absolute`, `memory_bytes`, `memory_limit_bytes`, `disk_bytes`, `network.rx_bytes`, `network.tx_bytes` and `uptime` in milliseconds.

`GET /api/v1/client/servers/{uuid}/status-ping` asks a Minecraft server who is online. When `reachable` is `true`, the response carries `players_online`, `players_max`, `sample` (some player names), `version`, `motd` and `latency_ms`. When the game does not answer (stopped, still booting, or not Minecraft), `reachable` is `false` and the other fields are empty.

To stream the output, open the console socket with your access token in the `token` query parameter. `GET /api/v1/client/servers/{uuid}/websocket` returns the socket's address as `socket`. The socket signs you in with your access token, so you do not need the `token` field of that response.

```text
wss://api.coritan.com/ws/console/<server uuid>?token=<access token>
```

Messages are JSON objects with an `event` and `args`. Send `{"event": "send logs", "args": []}` for the recent output, `{"event": "send command", "args": ["say Hello"]}` to run a command, and `{"event": "set state", "args": ["restart"]}` for a power action. The socket sends `console output`, `status` and `stats` events as the server runs.

## API

- `POST /api/v1/client/servers/{uuid}/power`: Execute power action (start, stop, restart, kill) (https://docs.coritan.com/api/reference/client/container-apps/servers/#op-post-api-v1-client-servers-uuid-power)
- `POST /api/v1/client/servers/{uuid}/command`: Execute a command on the server (https://docs.coritan.com/api/reference/client/container-apps/servers/#op-post-api-v1-client-servers-uuid-command)
- `GET /api/v1/client/servers/{uuid}/websocket`: Get WebSocket token and endpoint for console access (https://docs.coritan.com/api/reference/client/container-apps/servers/#op-get-api-v1-client-servers-uuid-websocket)
- `GET /api/v1/client/servers/{uuid}/resources`: Get server resource usage and limits (https://docs.coritan.com/api/reference/client/container-apps/servers/#op-get-api-v1-client-servers-uuid-resources)
- `GET /api/v1/client/servers/{uuid}/status-ping`: Ask the game itself who is online (https://docs.coritan.com/api/reference/client/container-apps/servers/#op-get-api-v1-client-servers-uuid-status-ping)
