---
title: "CLI & SSH Access | Coder"
description: "Full terminal access, scripting, and automation"
image: "https://coder.com/og/explore/how-coder-works/cli-and-ssh"
canonical: "https://coder.com/explore/how-coder-works/cli-and-ssh"
---

[Developers use](https://coder.com/explore/how-coder-works)

# CLI & SSH Access

Full terminal access, scripting, and automation

Direct access

## Every workspace is accessible via SSH. Use the Coder CLI for simplified access, or configure standard SSH directly.

Coder CLI

## Command-line interface for workspaces

## SSH config

Use standard SSH clients by adding Coder workspaces to your SSH config. One command sets it up.

- **Works with existing SSH tools** — Once configured, Coder workspaces appear as standard SSH hosts. Use them with scp, rsync, ssh-copy-id, or any SSH-based tool.

## Use cases

### Interactive development

SSH into workspace, run commands, debug in real-time

### Scripting & automation

Automate workspace provisioning, testing, deployments

### File transfer

Scp, rsync, sftp for moving files and data

### Port forwarding

Access workspace services on localhost

### Editor integration

VS Code Remote-SSH, JetBrains Gateway

### Tooling

Ansible, Terraform, deployment tools

WireGuard peer-to-peer tunneling

## Coder uses WireGuard to create direct, encrypted tunnels between your device and workspaces. No VPN gateway, no hairpinning.

**No corporate VPN required:** Developers connect directly to workspaces without routing through a slow VPN gateway. Works from anywhere: home, office, coffee shop.

### <50ms latency

Direct peer-to-peer connection. Feels like SSH to a local machine.

### Encrypted end-to-end

WireGuard encryption ensures traffic is secure from laptop to workspace.

API automation

## Beyond CLI, use the REST API for programmatic control. Perfect for CI/CD, custom portals, and integrations.

- **Use in CI/CD pipelines** — Create ephemeral workspaces for testing, run tests, then destroy
- **Build custom workflows** — Automate onboarding, provisioning, and lifecycle management
- **OpenAPI spec available** — Generate client libraries for any language. Full docs at /api/v2/swagger

FAQs

## FAQs

### Can I use my existing SSH keys?

Yes. By default, Coder uses your existing SSH keys from ~/.ssh. You can also configure custom keys. The `coder config-ssh` command adds Coder workspaces to your SSH config automatically.

### Do I need to install anything besides the CLI?

No. The Coder CLI is a single binary with no dependencies. If you only want to use standard SSH (no CLI), you don't need to install anything—just run `coder config-ssh` once to configure your SSH client.

### Can I SSH from a CI/CD pipeline?

Yes. Generate an API token, use the CLI to login non-interactively, then SSH or use API calls. Perfect for running tests in ephemeral workspaces as part of your CI pipeline.

### What if I lose internet connection?

Your SSH session will disconnect. When you reconnect, you can resume. If you were running a long-running process, use tmux or screen inside the workspace to keep it alive across disconnections.

### How does port forwarding work?

Use `coder port-forward my-workspace 3000:3000` to forward port 3000 from the workspace to localhost:3000 on your machine. Access workspace services (web servers, databases) as if they were local.

## Ready to learn more?

[Try Open Source](https://coder.com/docs/install)

[Book a demo](https://coder.com/demo) [Contact sales](https://coder.com/contact/sales)
