2026-08-27 12:34:13 -04:00
---
title : Air-gapped Deployments
---
2022-10-19 06:12:43 -05:00
2025-08-29 09:34:44 -05:00
All Coder features are supported in air-gapped / behind firewalls / disconnected / offline.
2025-03-10 15:58:20 -05:00
This is a general comparison. Keep reading for a full tutorial running Coder
2025-08-29 09:34:44 -05:00
air-gapped with Kubernetes or Docker.
2023-03-02 14:59:31 -06:00
2026-01-23 15:40:17 -06:00
| | Public deployments | Air-gapped deployments |
|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2026-06-22 11:39:12 -04:00
| Terraform binary | By default, Coder downloads Terraform binary from [releases.hashicorp.com ](https://releases.hashicorp.com ) | Terraform binary must be included in `PATH` for the VM or container image. [Supported versions ](../../provisioner/terraform/install.go#L23-L24 ) |
2026-01-23 15:40:17 -06:00
| Terraform registry | Coder templates will attempt to download providers from [registry.terraform.io ](https://registry.terraform.io ) or [custom source addresses ](https://developer.hashicorp.com/terraform/language/providers/requirements#source-addresses ) specified in each template | [Custom source addresses ](https://developer.hashicorp.com/terraform/language/providers/requirements#source-addresses ) can be specified in each Coder template, or a custom registry/mirror can be used. More details below |
| STUN | By default, Coder uses Google's public STUN server for direct workspace connections | STUN can be safely [disabled ](../reference/cli/server.md#--derp-server-stun-addresses ) users can still connect via [relayed connections ](../admin/networking/index.md#-geo-distribution ). Alternatively, you can set a [custom DERP server ](../reference/cli/server.md#--derp-server-stun-addresses ) |
| DERP | By default, Coder's built-in DERP relay can be used, or [Tailscale's public relays ](../admin/networking/index.md#relayed-connections ). | By default, Coder's built-in DERP relay can be used, or [custom relays ](../admin/networking/index.md#custom-relays ). |
| PostgreSQL | If no [PostgreSQL connection URL ](../reference/cli/server.md#--postgres-url ) is specified, Coder will download Postgres from [repo1.maven.org ](https://repo1.maven.org ) | An external database is required, you must specify a [PostgreSQL connection URL ](../reference/cli/server.md#--postgres-url ) |
| Telemetry | Telemetry is on by default, and [can be disabled ](../reference/cli/server.md#--telemetry ) | Telemetry [can be disabled ](../reference/cli/server.md#--telemetry ) |
| Update check | By default, Coder checks for updates from [GitHub releases ](https://github.com/coder/coder/releases ) | Update checks [can be disabled ](../reference/cli/server.md#--update-check ) |
2026-04-06 20:43:49 +02:00
| License validation | License keys are validated locally using cryptographic signatures. No outbound connection to Coder is required | No changes needed. See [offline license validation ](../admin/licensing/index.md#offline-license-validation ) |
2026-08-12 11:35:36 -04:00
| AI Governance Usage Count | By default, deployments with [AI Governance ](../ai-coder/ai-governance.md ) report usage data | [Contact us ](https://coder.com/contact ) to request a license with usage reporting off. |
2023-03-02 14:59:31 -06:00
2025-08-29 09:34:44 -05:00
## Air-gapped container images
2023-03-02 14:59:31 -06:00
2023-08-23 12:27:57 +03:00
The following instructions walk you through how to build a custom Coder server
image for Docker or Kubernetes
2022-10-19 06:12:43 -05:00
2023-08-23 12:27:57 +03:00
First, build and push a container image extending our official image with the
following:
2022-10-19 06:12:43 -05:00
2023-08-23 12:27:57 +03:00
- CLI config (.tfrc) for Terraform referring to
[external mirror ](https://www.terraform.io/cli/config/config-file#explicit-installation-method-configuration )
2022-10-19 06:12:43 -05:00
- [Terraform Providers ](https://registry.terraform.io ) for templates
2023-08-23 12:27:57 +03:00
- These could also be specified via a volume mount (Docker) or
[network mirror ](https://www.terraform.io/internals/provider-network-mirror-protocol ).
See below for details.
2022-10-19 06:12:43 -05:00
2025-03-10 15:58:20 -05:00
> [!NOTE]
> Coder includes the latest
2026-06-22 11:39:12 -04:00
> [supported version](../../provisioner/terraform/install.go#L23-L24)
2023-08-23 12:27:57 +03:00
> of Terraform in the official Docker images. If you need to bundle a different
> version of terraform, you can do so by customizing the image.
2023-03-07 13:52:45 +00:00
2023-03-20 04:47:36 -04:00
Here's an example Dockerfile:
2022-10-19 06:12:43 -05:00
2026-07-15 14:07:09 -04:00
```dockerfile
2022-10-19 06:12:43 -05:00
FROM ghcr.io/coder/coder:latest
USER root
RUN apk add curl unzip
# Create directory for the Terraform CLI (and assets)
RUN mkdir -p /opt/terraform
2023-03-07 13:52:45 +00:00
# Terraform is already included in the official Coder image.
2026-06-22 11:39:12 -04:00
# See ../../scripts/Dockerfile.base#L15
2023-03-07 13:52:45 +00:00
# If you need to install a different version of Terraform, you can do so here.
# The below step is optional if you wish to keep the existing version.
2026-06-22 11:39:12 -04:00
# See ../../provisioner/terraform/install.go#L23-L24
2022-10-19 06:12:43 -05:00
# for supported Terraform versions.
2025-03-06 21:35:41 +05:00
ARG TERRAFORM_VERSION = 1 .11.0
2023-03-07 13:52:45 +00:00
RUN apk update && \
curl -LOs https://releases.hashicorp.com/terraform/${ TERRAFORM_VERSION } /terraform_${ TERRAFORM_VERSION } _linux_amd64.zip \
2022-10-19 06:12:43 -05:00
&& unzip -o terraform_${ TERRAFORM_VERSION } _linux_amd64.zip \
&& mv terraform /opt/terraform \
&& rm terraform_${ TERRAFORM_VERSION } _linux_amd64.zip
ENV PATH = /opt/terraform:${ PATH }
# Additionally, a Terraform mirror needs to be configured
# to download the Terraform providers used in Coder templates.
# There are two options:
2023-10-04 15:40:09 -04:00
# Option 1) Use a filesystem mirror.
# We can seed this at build-time or by mounting a volume to
# /opt/terraform/plugins in the container.
# https://developer.hashicorp.com/terraform/cli/config/config-file#filesystem_mirror
# Be sure to add all the providers you use in your templates to /opt/terraform/plugins
2022-10-19 06:12:43 -05:00
2023-10-04 15:40:09 -04:00
RUN mkdir -p /home/coder/.terraform.d/plugins/registry.terraform.io
ADD filesystem-mirror-example.tfrc /home/coder/.terraformrc
2022-10-19 06:12:43 -05:00
# Optionally, we can "seed" the filesystem mirror with common providers.
2023-03-20 04:47:36 -04:00
# Comment out lines 40-49 if you plan on only using a volume or network mirror:
2023-10-04 15:40:09 -04:00
WORKDIR /home/coder/.terraform.d/plugins/registry.terraform.io
2025-03-06 21:35:41 +05:00
ARG CODER_PROVIDER_VERSION = 2 .2.0
2022-10-19 06:12:43 -05:00
RUN echo "Adding coder/coder v ${ CODER_PROVIDER_VERSION } " \
&& mkdir -p coder/coder && cd coder/coder \
&& curl -LOs https://github.com/coder/terraform-provider-coder/releases/download/v${ CODER_PROVIDER_VERSION } /terraform-provider-coder_${ CODER_PROVIDER_VERSION } _linux_amd64.zip
2023-10-04 15:40:09 -04:00
ARG DOCKER_PROVIDER_VERSION = 3 .0.2
2022-10-19 06:12:43 -05:00
RUN echo "Adding kreuzwerker/docker v ${ DOCKER_PROVIDER_VERSION } " \
&& mkdir -p kreuzwerker/docker && cd kreuzwerker/docker \
&& curl -LOs https://github.com/kreuzwerker/terraform-provider-docker/releases/download/v${ DOCKER_PROVIDER_VERSION } /terraform-provider-docker_${ DOCKER_PROVIDER_VERSION } _linux_amd64.zip
2025-03-06 21:35:41 +05:00
ARG KUBERNETES_PROVIDER_VERSION = 2 .36.0
2023-03-20 04:47:36 -04:00
RUN echo "Adding kubernetes/kubernetes v ${ KUBERNETES_PROVIDER_VERSION } " \
2023-10-04 15:40:09 -04:00
&& mkdir -p hashicorp/kubernetes && cd hashicorp/kubernetes \
2023-03-20 04:47:36 -04:00
&& curl -LOs https://releases.hashicorp.com/terraform-provider-kubernetes/${ KUBERNETES_PROVIDER_VERSION } /terraform-provider-kubernetes_${ KUBERNETES_PROVIDER_VERSION } _linux_amd64.zip
2025-03-06 21:35:41 +05:00
ARG AWS_PROVIDER_VERSION = 5 .89.0
2023-03-20 04:47:36 -04:00
RUN echo "Adding aws/aws v ${ AWS_PROVIDER_VERSION } " \
&& mkdir -p aws/aws && cd aws/aws \
&& curl -LOs https://releases.hashicorp.com/terraform-provider-aws/${ AWS_PROVIDER_VERSION } /terraform-provider-aws_${ AWS_PROVIDER_VERSION } _linux_amd64.zip
2022-10-19 06:12:43 -05:00
2023-10-04 15:40:09 -04:00
RUN chown -R coder:coder /home/coder/.terraform*
2022-10-19 06:12:43 -05:00
WORKDIR /home/coder
# Option 2) Use a network mirror.
2023-10-04 15:40:09 -04:00
# https://developer.hashicorp.com/terraform/cli/config/config-file#network_mirror
# Be sure uncomment line 60 and edit network-mirror-example.tfrc to
# specify the HTTPS base URL of your mirror.
2022-10-19 06:12:43 -05:00
2023-10-04 15:40:09 -04:00
# ADD network-mirror-example.tfrc /home/coder/.terraformrc
2022-10-19 06:12:43 -05:00
USER coder
2023-10-04 15:40:09 -04:00
# Use the .terraformrc file to inform Terraform of the locally installed providers.
ENV TF_CLI_CONFIG_FILE = /home/coder/.terraformrc
2022-10-19 06:12:43 -05:00
```
2025-03-10 15:58:20 -05:00
> [!NOTE]
2023-02-05 22:36:20 -06:00
> If you are bundling Terraform providers into your Coder image, be sure the
2023-08-23 12:27:57 +03:00
> provider version matches any templates or
2026-06-22 11:39:12 -04:00
> [example templates](../../examples/templates)
2023-08-23 12:27:57 +03:00
> you intend to use.
2023-02-05 22:36:20 -06:00
2024-10-05 08:52:04 -07:00
```tf
2022-10-19 06:12:43 -05:00
# filesystem-mirror-example.tfrc
provider_installation {
filesystem_mirror {
2023-10-04 15:40:09 -04:00
path = "/home/coder/.terraform.d/plugins"
2022-10-19 06:12:43 -05:00
}
}
```
2024-10-05 08:52:04 -07:00
```tf
2022-10-19 06:12:43 -05:00
# network-mirror-example.tfrc
provider_installation {
network_mirror {
url = "https://terraform.example.com/providers/"
}
}
```
2025-03-06 21:35:41 +05:00
<div class="tabs">
### Docker
2022-10-19 06:12:43 -05:00
2024-11-13 16:04:10 +11:00
Follow our [docker-compose ](./docker.md#install-coder-via-docker-compose )
2023-08-23 12:27:57 +03:00
documentation and modify the docker-compose file to specify your custom Coder
image. Additionally, you can add a volume mount to add providers to the
filesystem mirror without re-building the image.
2022-10-19 06:12:43 -05:00
2024-07-23 11:48:58 -05:00
First, create an empty plugins directory:
2022-10-19 06:12:43 -05:00
2026-07-15 14:07:09 -04:00
```sh
2022-10-19 06:12:43 -05:00
mkdir $HOME /plugins
```
2025-03-06 21:35:41 +05:00
Next, add a volume mount to compose.yaml:
2022-10-19 06:12:43 -05:00
2026-07-15 14:07:09 -04:00
```sh
2025-03-06 21:35:41 +05:00
vim compose.yaml
2022-10-19 06:12:43 -05:00
```
```yaml
2025-03-06 21:35:41 +05:00
# compose.yaml
2022-10-19 06:12:43 -05:00
services :
coder :
image : registry.example.com/coder:latest
volumes :
2022-11-14 04:05:19 +08:00
- ./plugins:/opt/terraform/plugins
2022-10-19 06:12:43 -05:00
# ...
2023-03-02 14:59:31 -06:00
environment :
CODER_TELEMETRY_ENABLE : "false" # Disable telemetry
2023-11-22 20:04:56 -06:00
CODER_BLOCK_DIRECT : "true" # force SSH traffic through control plane's DERP proxy
CODER_DERP_SERVER_STUN_ADDRESSES : "disable" # Only use relayed connections
2023-03-02 14:59:31 -06:00
CODER_UPDATE_CHECK : "false" # Disable automatic update checks
2022-10-19 06:12:43 -05:00
database :
2025-03-06 21:35:41 +05:00
image : registry.example.com/postgres:17
2022-10-19 06:12:43 -05:00
# ...
```
2025-03-10 15:58:20 -05:00
The
[terraform providers mirror ](https://www.terraform.io/cli/commands/providers/mirror )
command can be used to download the required plugins for a Coder template.
This can be uploaded into the `plugins` directory on your offline server.
2022-10-19 06:12:43 -05:00
2025-03-06 21:35:41 +05:00
### Kubernetes
2022-10-19 06:12:43 -05:00
2023-08-23 12:27:57 +03:00
We publish the Helm chart for download on
[GitHub Releases ](https://github.com/coder/coder/releases/latest ). Follow our
[Kubernetes ](./kubernetes.md ) documentation and modify the Helm values to
specify your custom Coder image.
2022-10-19 06:12:43 -05:00
```yaml
# values.yaml
coder :
image :
repo : "registry.example.com/coder"
tag : "latest"
2023-03-02 14:59:31 -06:00
env :
# Disable telemetry
- name : "CODER_TELEMETRY_ENABLE"
value : "false"
# Disable automatic update checks
- name : "CODER_UPDATE_CHECK"
value : "false"
2023-11-22 20:04:56 -06:00
# force SSH traffic through control plane's DERP proxy
- name : CODER_BLOCK_DIRECT
value : "true"
2023-03-02 14:59:31 -06:00
# Only use relayed connections
- name : "CODER_DERP_SERVER_STUN_ADDRESSES"
2023-11-22 19:14:01 +02:00
value : "disable"
2023-03-02 14:59:31 -06:00
# You must set up an external PostgreSQL database
- name : "CODER_PG_CONNECTION_URL"
value : ""
2022-10-19 06:12:43 -05:00
# ...
```
2023-07-19 15:51:44 -03:00
2025-03-06 21:35:41 +05:00
</div>
2025-08-29 09:34:44 -05:00
## Air-gapped docs
2023-07-19 15:51:44 -03:00
2025-08-29 09:34:44 -05:00
Coder also provides air-gapped documentation in case you want to host it on your
2023-08-23 12:27:57 +03:00
own server. The docs are exported as static files that you can host on any web
server, as demonstrated in the example below:
2023-07-19 15:51:44 -03:00
2023-08-23 12:27:57 +03:00
1. Go to the release page. In this case, we want to use the
[latest version ](https://github.com/coder/coder/releases/latest ).
2. Download the documentation files from the "Assets" section. It is named as
`coder_docs_<version>.tgz` .
2023-07-19 15:51:44 -03:00
3. Extract the file and move its contents to your server folder.
2023-08-23 12:27:57 +03:00
4. If you are using NodeJS, you can execute the following command:
`cd docs && npx http-server .`
2024-08-13 18:39:46 +03:00
5. Set the [CODER_DOCS_URL ](../reference/cli/server.md#--docs-url ) environment
variable to use the URL of your hosted docs. This way, the Coder UI will
reference the documentation from your specified URL.
2023-07-19 15:51:44 -03:00
2023-08-23 12:27:57 +03:00
With these steps, you'll have the Coder documentation hosted on your server and
accessible for your team to use.
2023-08-25 23:48:35 +03:00
2026-07-06 11:15:59 -04:00
## Template builder
The template builder requires outbound access to `registry.coder.com` for
`terraform init` to resolve module sources at template composition time.
For fully air-gapped deployments, disable the template builder:
```sh
CODER_DISABLE_TEMPLATE_BUILDER = true
```
When the builder is disabled, template creation falls back to the standard
upload and CLI workflows. The **New Template** button on the **Templates** page
links to the starter templates page instead of the builder.
For deployments using a self-hosted module registry mirror, set the registry URL
instead of disabling the builder:
```sh
CODER_TEMPLATE_BUILDER_REGISTRY_URL = registry.internal.example.com
```
This makes the builder generate module source paths pointing at your mirror
rather than `registry.coder.com` .
2026-08-31 09:32:24 -04:00
The value is a bare host, optionally with a port (for example, `mirror.internal:8443` ).
A leading `http(s)://` scheme and trailing slash are stripped, and a path, query, fragment, or credentials is rejected at server start.
2026-09-02 10:04:35 -04:00
For a complete walkthrough of setting up the mirror, see
[Mirror the Coder Registry with JFrog Artifactory ](./registry-mirror-artifactory.md ).
2024-01-25 08:01:56 +03:00
## Coder Modules
2026-02-16 22:29:48 +05:00
To use Coder modules in offline installations, you can either:
- [Mirror the Coder Registry with JFrog Artifactory ](./registry-mirror-artifactory.md ) (recommended)
- [Manually publish modules to Artifactory or use a private git repository ](../admin/templates/extending-templates/modules.md#offline-installations )
2024-01-25 08:01:56 +03:00
2023-08-25 23:48:35 +03:00
## Firewall exceptions
In restricted internet networks, Coder may require connection to internet.
Ensure that the following web addresses are accessible from the machine where
Coder is installed.
- code-server.dev (install via AUR)
- open-vsx.org (optional if someone would use code-server)
- registry.terraform.io (to create and push template)
- v2-licensor.coder.com (developing Coder in Coder)
2023-11-22 20:04:56 -06:00
## JetBrains IDEs
Gateway, JetBrains' remote development product that works with Coder,
2025-05-29 17:56:44 -07:00
[has documented offline deployment steps. ](../admin/templates/extending-templates/jetbrains-airgapped.md )
2023-11-22 20:04:56 -06:00
## Microsoft VS Code Remote - SSH
Installation of the
[Visual Studio Code Remote - SSH extension ](https://code.visualstudio.com/docs/remote/ssh )
(for connecting a local VS Code to a remote Coder workspace) requires that your
local machine has outbound HTTPS (port 443) connectivity to:
- update.code.visualstudio.com
- vscode.blob.core.windows.net
- \*.vo.msecnd.net
2024-10-05 08:52:04 -07:00
## Next steps
- [Create your first template ](../tutorials/template-from-scratch.md )
- [Control plane configuration ](../admin/setup/index.md )