Skip to content
UsecaseBoard
← All use cases
coder.comsponsor

Write a Coder template from scratch with coder_agent and code-server

At a glance

Coder’s tutorial walks you through a Docker+Ubuntu workspace template in Terraform: coder_agent, code-server via coder_app, persistent home volume, then push with the CLI or dashboard. This workflow is listed under sponsor, devtools, templates, terraform, cde.

Agents / tools
Coder, Terraform, Docker, code-server

Building a tool for these workflows? See weekly rates.

What they did

Create a template directory with a Dockerfile (Ubuntu + sudo/curl + coder user) and main.tf that wires coder/docker providers, a coder_agent (startup installs code-server, sets git author env, CPU/RAM metadata), coder_app for the browser IDE, a persistent docker_volume for home, and an ephemeral docker_container gated by start_count. Then coder login and coder templates push (or zip-upload in the dashboard) and create a workspace from the new template.

Worth knowing

Needs Docker and Coder already installed. Docs tip: use the visual template builder if you do not want to write Terraform. The agent needs curl access to the control plane; remote compute needs agent auth credentials. Prefer immutable workspace id for volume names so renames do not destroy home data.

Save ideas in this browser. Upvotes count across the board.

Prompt excerpt

Scaffold Dockerfile + main.tf with coder_agent and code-server Then: Add persistent home volume and ephemeral docker_container Then: coder templates push and create a workspace from the template

Sponsored

CodeBuddy

Tencent Cloud AI coding assistant for IDE and CLI.

Try CodeBuddy ↗
Explore all →
codersponsor

Spin up your first Coder workspace in ~10 minutes

Official quickstart: install a container runtime, start coder server, create a Docker template in the template builder, launch a workspace, and connect VS Code Desktop or browser VS Code.

CoderDockerVS Code+1
Source ↗
codersponsor

Pick the right way to run AI coding agents on Coder

Docs overview of Coder Agents, Agent Relay, IDE agents, and agents-in-templates—plus Terraform snippet to install Claude Code/Codex modules into a workspace template.

CoderCoder AgentsClaude Code+1
Source ↗
codersponsor

Understand what ships inside a Coder workspace

Short official blog on workspace anatomy: reproducible templates with deps/IDEs/config, plus connection options—web IDEs, SSH + VS Code Remote, or local file sync.

CoderVS CodeSSH
Source ↗