fix(security): require setup token for first user on tunnels Prevent unauthorized users from claiming Owner access on public `try.coder.app` tunnels before initial setup. - Generate a setup token at startup when using a tunnel with no existing users. - Require the token for first-user creation via the API, web UI, and CLI. - Block GitHub/OIDC first-user signup until setup is complete. - Support custom tokens via `--setup-token` / `CODER_SETUP_TOKEN` and non-interactive CLI setup. - Update development scripts, documentation, and tests. - Preserve existing behavior for deployments with an access URL or existing users. Validated with automated tests and 23/23 manual scenarios using a real tunnel. Refs CORE-784
3.7 KiB
title
| title |
|---|
| Google Cloud Platform |
In this guide, you will learn how to deploy the Coder control plane instance and your first template.
Requirements
This guide assumes you have roles/compute.instanceAdmin.v1 access to your Google Cloud Platform project.
Launch a Coder instance from the Google Cloud Marketplace
We publish an Ubuntu 22.04 VM image with Coder and Docker pre-installed.
Two stock keeping units (SKUs) are available via the Google Cloud Marketplace:
- License purchase via Google Cloud Marketplace
- A solution to deploy VM's on GCP (Bring Your Own License)
Be sure to keep the default firewall options checked so you can connect over HTTP, HTTPS, and SSH.
We recommend keeping the default instance type (e2-standard-4, 4 cores and 16 GB memory) if you plan on provisioning Docker containers as workspaces on this VM instance.
Keep in mind this platforms is intended for proof-of-concept deployments and you should adjust your infrastructure when preparing for production use.
See: Scaling Coder
This screencast shows launching a Coder VM from the Google Cloud Marketplace.
Be sure to add a keypair so that you can connect over SSH to further configure Coder.
After launching the instance, wait 30 seconds and navigate to the public IPv4 address. You should be redirected to a public tunnel URL.
The setup page asks for a setup token before it creates the first user. To find it, connect to the instance over SSH and read the Coder service logs:
journalctl -u coder.service -b
Copy the token from the line that starts with Setup token:.
That's all! Use the UI to create your first user, template, and workspace. We recommend starting with a Docker template since the instance has Docker pre-installed.
Configure the control plane
Coder is primarily configured by server-side flags and environment variables. Given you created or added key-pairs when launching the instance, you can configure your Coder deployment by logging in via SSH or using the console:
ssh ubuntu@<gcp-public-IPv4>
sudo vim /etc/coder.d/coder.env # edit config
sudo systemctl daemon-reload
sudo systemctl restart coder # restart Coder
Give developers VM workspaces (optional)
Instead of running containers on the Coder instance, you can offer developers full VM instances with the gcp-linux template.
Before you can use this template, you must authorize Coder to create VM instances in your GCP project. Follow the instructions in the gcp-linux template README to set up authentication.


