Restructures the Install section into the five-phase deployment spine, so the reading order matches the order a deployment actually happens: **plan, prepare, install, validate, operate.** Today the first thing a reader sees is a shell command, and architecture and sizing sit downstream in Administration, after the point where they would have been useful. Resolves [DOCS-869](https://linear.app/codercom/issue/DOCS-869). Part of [DOCS-685](https://linear.app/codercom/issue/DOCS-685) and [DOCS-738](https://linear.app/codercom/issue/DOCS-738). > [!IMPORTANT] > **Stacked on [#28960](https://github.com/coder/coder/pull/28960)** (DOCS-871, terminology). Base is that branch, not `main`. Retarget to `main` after it merges. > > **Paired with coder/coder.com [#1077](https://github.com/coder/coder.com/pull/1077)**, which must merge **first**. Without it, every inbound link to a moved page 404s in the gap. ## Deliberately mechanical No prose changes. The only edits inside moved pages are relative link and image path repairs, so the diff reads as renames. That is the point: this is the highest link-breakage change in the project, and it should be reviewable as such. The prose work is [DOCS-868](https://linear.app/codercom/issue/DOCS-868) (phase overview, architecture rewrite, sizing split, actor table) and [DOCS-872](https://linear.app/codercom/issue/DOCS-872) (new pages). ## The new spine ```text Install and deploy Coder /install ├── Coder CLI [unchanged, retired by DOCS-870] ├── 1. Plan your deployment │ ├── Architecture and components [from admin/infrastructure] │ └── Coder Validated Architecture [from admin/infrastructure] │ └── 1k / 2k / 3k / 10k users ├── 2. Prepare prerequisites │ ├── Licensing [from admin/licensing] │ ├── Air-gapped deployments [from install/airgap] │ └── Mirror images and registries [from install/registry-mirror-artifactory] ├── 3. Install the control plane │ ├── Docker / Kubernetes / Rancher / OpenShift │ ├── Cloud marketplace and VM images │ └── Unofficial install methods ├── 4. Validate your deployment │ └── Scale testing [from admin/infrastructure] │ ├── Scale test utility │ └── Scaling best practices └── 5. Operate and maintain ├── External provisioners [from admin/provisioners] ├── Upgrading (+ best practices, ESR guides) └── Uninstall ``` Leaving Install: release channels become `reference/releases`, feature stages become `reference/feature-stages`. `docs/admin/infrastructure/` is gone entirely, which is what DOCS-738 recommended. ## Numbers - 31 pages moved, all as `git mv` renames. - 1 page deleted: `admin/infrastructure/index.md`, whose content was a one-line section blurb. - 5 new placeholder index pages, one per phase, each a sentence of orientation plus `<children></children>`. The nav schema requires a path on every entry, so a phase cannot exist without one. - 265 relative links and asset paths repaired across 57 files. - `docs/manifest.json` restructured. Entry count goes 460 to 464: plus 5 stubs, minus the deleted Infrastructure entry. ## Reviewer attention, please **The redirects PR repairs 19 existing redirects, not just adds new ones.** This was the surprise. `redirects.json` already had entries whose *destinations* pointed at pages this PR moves, so they would have started redirecting to 404s. Examples: `/docs/architecture/architecture`, `/docs/admin/architectures`, `/docs/scaling/scale-testing`, `/docs/licensing`, `/docs/enterprise`, `/docs/install/offline`, `/docs/platforms`, `/docs/install/1-click`, `/docs/admin/upgrade`, `/docs/install/cloud/ec2`, and both `feature-stages` aliases. All 19 are fixed in the paired PR. **This PR touches `scripts/`, so it is not docs-only.** Two release tools write to paths that moved and would have broken silently at release time: - `scripts/update-release-calendar.sh`: `DOCS_FILE` now points at `docs/reference/releases.md`. - `scripts/releaser/docs.go`: `releasesFile`, and also `kubernetesFile` and `rancherFile`, which pointed at `docs/install/kubernetes.md` and `docs/install/rancher.md`. <details> <summary>Deliberate scope decisions</summary> - **Self-managed vs cloud grouping is flattened.** The reconciled IA nested platform pages under a "Self-managed platforms" parent. That would need two more placeholder index pages for groups with no content yet, so the platform pages sit directly under Phase 3 and the grouping lands with the DOCS-868 prose. - **Release-notes URLs left alone.** `scripts/releaser/release.go` and `scripts/release/generate_release_notes.sh` embed `https://coder.com/docs/install/releases` and `/docs/install/upgrade` in release-note templates. The redirects cover them, and changing the strings would require updating Go test fixtures in `scripts/release/main_internal_test.go`. Better as its own change. - **In-product doc links left alone.** Several `site/src` pages link to `coder.com/docs/admin/provisioners` and similar. Those are absolute URLs, so the redirects cover them. Updating them is a frontend change that would pull frontend review into a docs restructure. - **`admin/security/audit-logs.md` line 237** is hand-written prose below the generated table, and its `../licensing/index.md` link had to move with the licensing page. Verified `make gen` does not revert it. - **`reference/feature-stages.md`** has generated blocks whose relative links changed depth with the move. The generator named in its own marker comment (`scripts/release/docs_update_feature_stages.sh`) no longer exists in the repo, so those links were repaired by hand and the file is effectively hand-maintained. Worth its own issue. - **`install/cli.md` keeps its nav slot** here. DOCS-870 retires it. </details> ## Verification | Check | Result | |---|---| | Broken relative link scan | 0 in `install/`, `admin/`, `reference/`. 21 remain, all pre-existing illustrative examples in `docs/.style/style-guide/**` and one malformed URL in `docs/README.md` | | `make gen` | clean, manifest not clobbered, phase structure intact | | `make lint/markdown` | pass, 508 files, 0 errors | | `make lint/emdash` | pass | | `make lint/docs-html` | pass | | `make lint/prose` | pass, 1 intentional demo error, no new findings | | `make pre-commit` | pass, including `lint/go`, `lint/ts`, `lint/shellcheck`, and a slim build | | Manifest audit | every path resolves to a file on disk; entry-by-entry diff shows only the expected moves | Generated with Coder Agents on behalf of @nickvigilante. <details> <summary>CI note: doc-check failure is infrastructure, not this PR</summary> `Analyze PR for Documentation Updates Needed` fails before it reviews anything: the Coder account behind `agents-chat-action` returns `User is not active (status = "suspended")`. It isn't a required check. `check-docs` (linkspector) and every other check pass on `58ed9e3e4b`. _CI note added by Coder Agents on behalf of @nickvigilante._ </details>
11 KiB
title
| title |
|---|
| Networking |
Coder's network topology has three types of nodes: workspaces, the control plane, and users.
The control plane must have an inbound address reachable by users and workspaces, but otherwise, all topologies just work with Coder.
When possible, we establish direct connections between users and workspaces. Direct connections are as fast as connecting to the workspace outside of Coder. When NAT traversal fails, connections are relayed through the control plane. All user-workspace connections are end-to-end encrypted.
Tailscale's open source backs our websocket/HTTPS networking logic.
Requirements
In order for clients and workspaces to be able to connect:
Note
We strongly recommend that clients connect to Coder and their workspaces over a good quality, broadband network connection. The following are minimum requirements:
- better than 400ms round-trip latency to the control plane and to their workspace
- better than 0.5% random packet loss
- All clients and agents must be able to establish a connection to the control
plane (
CODER_ACCESS_URL) over HTTP/HTTPS. - Any reverse proxy or ingress between the Coder control plane and clients/agents must support WebSockets.
In order for clients to be able to establish direct connections:
Note
Direct connections via the web browser are not supported. To improve latency for browser-based applications running inside Coder workspaces in regions far from the Coder control plane, consider deploying one or more workspace proxies.
- The client is connecting using the CLI (e.g.
coder sshorcoder port-forward). Note that the VSCode extension and JetBrains Plugin, andssh coder.<workspace>all utilize the CLI to establish a workspace connection. - Either the client or workspace agent are able to discover a reachable
ip:portof their counterpart. If the agent and client are able to communicate with each other using their locally assigned IP addresses, then a direct connection can be established immediately. Otherwise, the client and agent will contact the configured STUN servers to try and determine whichip:portcan be used to communicate with their counterpart. See STUN and NAT for more details on how this process works. - All outbound UDP traffic must be allowed for both the client and the agent on
all ports to each others' respective networks.
- To establish a direct connection, both agent and client use STUN. This
involves sending UDP packets outbound on
udp/3478to the configured STUN server. If either the agent or the client are unable to send and receive UDP packets to a STUN server, then direct connections will not be possible. - Both agents and clients will then establish a WireGuard️ tunnel and send UDP traffic on ephemeral (high) ports. If a firewall between the client and the agent blocks this UDP traffic, direct connections will not be possible.
- To establish a direct connection, both agent and client use STUN. This
involves sending UDP packets outbound on
Control plane
Workspaces connect to the control plane via its external address, set
by ACCESS_URL. There must not be a
NAT between workspaces and the control plane.
Users connect to the control plane's dashboard and API through its ACCESS_URL
as well. There must not be a NAT between users and the control plane.
Template admins can overwrite the site-wide access URL at the template level by
leveraging the url argument when
defining the Coder provider:
provider "coder" {
url = "https://coder.namespace.svc.cluster.local"
}
This is useful when debugging connectivity issues between the workspace agent and the control plane.
Web Apps
The control plane relays dashboard-initiated connections between the user and the workspace. Web terminal <-> workspace connections are an exception and may be direct.
In general, port forwarded web apps are faster than dashboard-accessed web apps.
🌎 Geo-distribution
Direct connections
Direct connections are a straight line between the user and workspace, so there is no special geo-distribution configuration. To speed up direct connections, move the user and workspace closer together.
Establishing a direct connection can be an involved process because both the client and workspace agent will likely be behind at least one level of NAT, meaning that we need to use STUN to learn the IP address and port under which the client and agent can both contact each other. See STUN and NAT for more information on how this process works.
If a direct connection is not available (e.g. client or server is behind NAT), Coder will use a relayed connection. By default, Coder uses Google's public STUN server, but this can be disabled or changed for Air-gapped deployments.
Relayed connections
By default, your control plane also runs a built-in DERP relay which can be used for both public and Air-gapped deployments.
However, Tailscale maintains a global fleet of DERP relays intended for their product, and has allowed Coder to access and use them.
You can launch coder server with Tailscale's DERPs like so:
coder server --derp-config-url https://controlplane.tailscale.com/derpmap/default
Custom Relays
If you want lower latency than what Tailscale offers or want additional DERP relays for air-gapped deployments, you may run custom DERP servers. Refer to Tailscale's documentation to learn how to set them up.
After you have custom DERP servers, you can launch Coder with them like so:
# derpmap.json
{
"Regions": {
"1": {
"RegionID": 1,
"RegionCode": "myderp",
"RegionName": "My DERP",
"Nodes": [
{
"Name": "1",
"RegionID": 1,
"HostName": "your-hostname.com"
}
]
}
}
}
coder server --derp-config-path derpmap.json
Dashboard connections
The dashboard (and web apps opened through the dashboard) are served from the control plane, so they can only be geo-distributed with High Availability mode in our Premium Edition. Reach out to Sales to learn more.
Browser-only connections
Note
Browser-only connections is a Premium feature. Learn more.
Some Coder deployments require that all access is through the browser to comply
with security policies. In these cases, pass the --browser-only flag to
coder server or set CODER_BROWSER_ONLY=true.
With browser-only connections, developers can only connect to their workspaces via the web terminal and web IDEs.
Workspace Proxies
Note
Workspace proxies are a Premium feature. Learn more.
Workspace proxies are a Coder Premium feature that allows you to provide low-latency browser experiences for geo-distributed teams.
To learn more, see Workspace Proxies.
Latency
Coder measures and reports several types of latency, providing insights into the performance of your deployment. Understanding these metrics can help you diagnose issues and optimize the user experience.
There are three main types of latency metrics for your Coder deployment:
-
Dashboard-to-server latency:
The Coder UI measures round-trip time to the control plane or workspace proxy using built-in browser timing capabilities.
This appears in the user interface next to your username, showing how responsive the dashboard is.
-
Workspace connection latency:
The latency shown on the workspace dashboard measures the round-trip time between the workspace agent and its DERP relay server.
This metric is displayed in milliseconds on the workspace dashboard and specifically shows the agent-to-relay latency, not direct P2P connections.
To estimate the total end-to-end latency experienced by a user, add the dashboard-to-server latency to this agent-to-relay latency.
-
Database latency:
For administrators, Coder monitors and reports database query performance in the health dashboard.
How latency is classified
Latency measurements are color-coded in the dashboard:
- Green (<150ms): Good performance.
- Yellow (150-300ms): Moderate latency that might affect user experience.
- Red (>300ms): High latency that will noticeably affect user experience.
View latency information
- Dashboard: The global latency indicator appears in the top navigation bar.
- Workspace list: Each workspace shows its connection latency.
- Health dashboard: Administrators can view advanced metrics including database latency.
- CLI: Use
coder ping <workspace>to measure and analyze latency from the command line.
Factors that affect latency
- Geographic distance: Physical distance between users, the control plane, and workspaces.
- Network connectivity: Quality of internet connections and routing.
- Infrastructure: Cloud provider regions and network optimization.
- P2P connectivity: Whether direct connections can be established or relays are needed.
How to optimize latency
To improve latency and user experience:
- Deploy workspace proxies: Place proxies in regions closer to users, connecting back to your single control plane deployment.
- Use P2P connections: Ensure network configurations permit direct connections.
- Strategic placement: Deploy your control plane in a region where most users work.
- Network configuration: Optimize routing between users and workspaces.
- Check firewall rules: Ensure they don't block necessary Coder connections.
For help troubleshooting connection issues, including latency problems, refer to the networking troubleshooting guide.
External Network Access
By default, Coder will access some external network endpoints in order to download dependencies and send usage data. However, all of these features can be disabled. Learn how to configure Coder for air-gapped environments.
Up next
- Learn about Port Forwarding
- Troubleshoot Networking Issues