2026-09-08 12:34:00 -04:00
|
|
|
---
|
|
|
|
|
title: Template
|
|
|
|
|
---
|
2024-10-05 08:52:04 -07:00
|
|
|
|
|
|
|
|
Templates are written in
|
|
|
|
|
[Terraform](https://developer.hashicorp.com/terraform/intro) and define the
|
|
|
|
|
underlying infrastructure that all Coder workspaces run on.
|
|
|
|
|
|
2026-07-06 11:15:59 -04:00
|
|
|
The [template builder](./creating-templates.md#template-builder) is
|
|
|
|
|
the recommended way to create templates. It guides you through selecting base
|
|
|
|
|
infrastructure, adding modules, and configuring your template without writing
|
|
|
|
|
Terraform.
|
2024-10-05 08:52:04 -07:00
|
|
|
|
|
|
|
|
## Learn the concepts
|
|
|
|
|
|
2026-07-08 11:43:29 -04:00
|
|
|
While templates are written in standard Terraform, it's important to learn the Coder-specific concepts behind templates.
|
|
|
|
|
The best way to learn the concepts is by [creating a basic template from scratch](../../tutorials/template-from-scratch.md).
|
|
|
|
|
If you are unfamiliar with Terraform, see [HashiCorp's Tutorials](https://developer.hashicorp.com/terraform/tutorials) for common cloud providers.
|
2024-10-05 08:52:04 -07:00
|
|
|
|
2026-07-06 11:15:59 -04:00
|
|
|
## Create a template
|
2024-10-05 08:52:04 -07:00
|
|
|
|
2026-07-06 11:15:59 -04:00
|
|
|
The fastest way to get started is with the
|
|
|
|
|
[template builder](./creating-templates.md#template-builder), which
|
|
|
|
|
composes a working template from a base infrastructure template and optional
|
|
|
|
|
registry modules. Starter templates for popular platforms (AWS, Kubernetes,
|
|
|
|
|
Docker, and others) are available as base templates in the builder, or through
|
|
|
|
|
the [CLI](./creating-templates.md#cli).
|
2024-10-05 08:52:04 -07:00
|
|
|
|
|
|
|
|
## Extending templates
|
|
|
|
|
|
|
|
|
|
It's often necessary to extend the template to make it generally useful to end
|
|
|
|
|
users. Common modifications are:
|
|
|
|
|
|
|
|
|
|
- Your image(s) (e.g. a Docker image with languages and tools installed). Docs:
|
|
|
|
|
[Image management](./managing-templates/image-management.md).
|
|
|
|
|
- Additional parameters (e.g. disk size, instance type, or region). Docs:
|
|
|
|
|
[Template parameters](./extending-templates/parameters.md).
|
|
|
|
|
- Additional IDEs (e.g. JetBrains) or features (e.g. dotfiles, RDP). Docs:
|
|
|
|
|
[Adding IDEs and features](./extending-templates/index.md).
|
|
|
|
|
|
|
|
|
|
Learn more about the various ways you can
|
|
|
|
|
[extend your templates](./extending-templates/index.md).
|
|
|
|
|
|
|
|
|
|
## Best Practices
|
|
|
|
|
|
|
|
|
|
We recommend starting with a universal template that can be used for basic
|
|
|
|
|
tasks. As your Coder deployment grows, you can create more templates to meet the
|
|
|
|
|
needs of different teams.
|
|
|
|
|
|
|
|
|
|
- [Image management](./managing-templates/image-management.md): Learn how to
|
|
|
|
|
create and publish images for use within Coder workspaces & templates.
|
2025-12-09 13:03:02 +02:00
|
|
|
- [Dev Containers integration](../integrations/devcontainers/integration.md): Enable
|
2025-12-05 19:42:16 +02:00
|
|
|
native dev containers support using `@devcontainers/cli` and Docker.
|
2025-12-09 13:03:02 +02:00
|
|
|
- [Envbuilder](../integrations/devcontainers/envbuilder/index.md): Alternative approach
|
2025-12-05 19:42:16 +02:00
|
|
|
for environments without Docker access.
|
2024-10-05 08:52:04 -07:00
|
|
|
- [Template hardening](./extending-templates/resource-persistence.md#-bulletproofing):
|
|
|
|
|
Configure your template to prevent certain resources from being destroyed
|
|
|
|
|
(e.g. user disks).
|
|
|
|
|
- [Manage templates with Ci/Cd pipelines](./managing-templates/change-management.md):
|
|
|
|
|
Learn how to source control your templates and use GitOps to ensure template
|
|
|
|
|
changes are reviewed and tested.
|
|
|
|
|
- [Permissions and Policies](./template-permissions.md): Control who may access
|
|
|
|
|
and modify your template.
|
2025-08-28 10:12:08 +02:00
|
|
|
- [External Workspaces](./managing-templates/external-workspaces.md): Learn how to connect your existing infrastructure to Coder workspaces.
|
2024-10-05 08:52:04 -07:00
|
|
|
|
|
|
|
|
<children></children>
|