Skip to main content
The cpln workload connect command opens an interactive terminal session to a running container, similar to docker exec -it or kubectl exec -it. Use it to inspect container state, debug issues, or run commands interactively.

When to use this

Interactive debugging

Explore container filesystem, check processes, and inspect state

Troubleshooting

Diagnose issues directly inside the running container

Manual operations

Run one-off commands, database migrations, or maintenance tasks

Log inspection

View logs and files that aren’t exposed externally

Prerequisites

Install the Control Plane CLI. See Installation.
You need a running workload in at least one location. See the Create a Workload guide.
You need exec permission on the workload. See Workload Permissions.

Connect via Console

You can connect to workloads directly from the Control Plane Console:
1

Navigate to workload

Open your workload in the Console.
2

Click Connect

In the left pane, click Connect.
3

Configure connection

Use the dropdowns to select:
  • Location: The deployment location to connect to
  • Container: The container within the workload
  • Replica: The specific replica instance
4

Enter command

Type the shell command to use (e.g., bash, sh, node).
5

Connect

Click Connect to open an interactive terminal session in your browser.
You can copy the generated cpln workload connect command from the Console and paste it into your terminal to connect from the CLI instead.

Connect via CLI

Basic usage

This opens a bash shell in the first available container and replica.

Options

Connect to a specific location

List available locations with cpln workload get-deployments my-app.

Connect to a specific replica

When a workload has multiple replicas, target a specific one:

Connect to a specific container

For workloads with multiple containers (sidecars, init containers):

Use a different shell

Some containers don’t have bash. Use sh or another shell:

Common workflows

Debug a crashing container

Inspect database state

Check filesystem

Run a migration

Troubleshooting

The container doesn’t have bash. Use a different shell:
Alpine-based images typically use ash or sh.
The workload may not be running:
Wait for replicas to start or check the workload configuration.
The shell may be exiting. Try with a different shell or check container health:
You need exec permission on the workload. Check your policies or contact your admin.

Next steps

Execute Commands

Run non-interactive commands

Copy Files

Transfer files to/from workloads

Port Forwarding

Access workload ports locally

Command Reference

Full connect command reference