Skip to content

Shell and SSH

Get a shell on a running web app, worker or job container to inspect files, run a one-off script or poke at a problem, from the dashboard or from your terminal over SSH. For a database or cache, okctl connect opens psql or valkey-cli, or a tunnel to a local port.

Shell and SSH are available on Ownkube Compute to organization owners and admins. They are not exposed through the MCP server.

Open the deployment and choose Shell from the actions menu on the Overview tab. If the deployment has more than one replica, pick the instance. A terminal opens in the browser attached to that container.

  1. Install and sign in

    okctl v0.5.0 or later. See the CLI for install and okctl login.

  2. Open a shell

    Terminal window
    okctl ssh <deployment-id>

    The first run generates an SSH key if you have none and adds the public key to your Ownkube account. Omit the deployment id inside a directory you have linked with okctl link.

  3. Run one command

    Terminal window
    okctl ssh <deployment-id> -- ls -la /app
    okctl ssh <deployment-id> -- python manage.py migrate

okctl ssh config writes an entry for each of your apps into ~/.ssh/config, so the standard tools work:

Terminal window
okctl ssh config
ssh ok-my-api
scp ./fixture.json ok-my-api:/tmp/
sftp ok-my-api

Keys live on your user account, not on a deployment, under Settings → Profile → SSH keys in the dashboard.

Screenshot of the Profile settings page with the SSH keys section
Terminal window
okctl ssh keys list
okctl ssh keys add ~/.ssh/id_ed25519.pub
okctl ssh keys github <username> # import your public keys from GitHub
okctl ssh keys remove <key-id>
Terminal window
okctl connect <database-id>

Opens psql against the database with the right credentials. Needs psql on your machine.

okctl connect works over private networking and does not require public access on the database. For a browser-based query console, see the data console.

  • A shell runs inside the container with the same user and filesystem as your app. Changes to the filesystem do not survive a restart or a new revision; put them in the image or a variable instead.
  • A sleeping app has no container to attach to. Send it a request first, or turn sleep off while you debug.