Connect to Your Workspace via SSH
This guide will walk you through setting up Secure Shell (SSH) access for your workspaces. This allows you to securely connect to and interact with your development environment directly from your local terminal.
Prerequisites
Before attempting to connect, ensure you have an SSH key pair generated on your local machine. If you need to generate one, open your local terminal and run:
ssh-keygen -t ed25519 -C "[email protected]"
Add Your SSH Key (via UI)
Navigate to User Settings > SSH Keys and click on Add SSH Key to add or upload your public key.
Adding a public SSH key in the UI.
Manage SSH keys with the Codesphere CLI
Run these commands locally with CS_TOKEN set to your Codesphere API token. If you use a Codesphere instance other than Enterprise Cloud, set CS_API to your instance's API URL, for example https://codesphere.example.com/api.
- Run
cs add ssh-key ~/.ssh/id_ed25519.pubto upload your public key. Replace the example path~/.ssh/id_ed25519.pubwith the path to your own public key file. - Run
cs list ssh-keysto view your registered keys and their fingerprints. - Run
cs delete ssh-keyto choose a key to remove, or pass its fingerprint as an argument.
See the Codesphere CLI reference for command options.
Alternative: Add your SSH key (via Public API)
See the SSH section of the Public API reference to register, list, or remove public keys over HTTP.
Connect to Your Workspace
Once your public key is registered, you can find your workspace's connection string directly in the platform.
- Open your active workspace.
- Click the editor dropdown in the top-right toolbar.
- Select Connect via SSH.
- Copy the connection string from the modal and paste it into your local terminal.
Copying the connection string from the Workspace.
Example command:
ssh -J <dcId>.ssh.<your_domain> user@<workspaceId>
The data center ID can be found in resource group settings (admins only).
Connect from a Local IDE
Refer to your IDE's official documentation for SSH remote development setup: