2025-11-17 11:14:02 +01:00
---
2025-11-30 22:56:06 +01:00
title: "Coder"
linkTitle: "Coder"
2025-11-17 11:14:02 +01:00
weight: 20
description: >
2025-12-16 10:12:07 +01:00
Cloud Development Environments for secure, scalable remote development
2025-11-17 11:14:02 +01:00
---
## Overview
2025-12-16 10:12:07 +01:00
Coder is an enterprise cloud development environment (CDE) platform that provisions secure, consistent remote development workspaces. As part of the Edge Developer Platform, Coder enables developers to work in standardized, on-demand environments defined as code, moving development workloads from local machines to centrally managed infrastructure.
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
The Coder stack deploys a self-hosted Coder instance with PostgreSQL database backend, integrated authentication, and edge connectivity capabilities.
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
## Key Features
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
* **Infrastructure as Code Workspaces**: Development environments defined using Terraform templates
* **IDE Agnostic**: Supports browser-based IDEs, VS Code, JetBrains IDEs, and other development tools
* **Secure Remote Access**: Workspaces run in controlled cloud or on-premises infrastructure
* **On-Demand Provisioning**: Developers create ephemeral or persistent workspaces as needed
* **AI Agent Support**: Secure execution environment for AI coding assistants
* **Template-Based Deployment**: Reusable workspace templates ensure consistency across teams
2025-11-17 11:14:02 +01:00
## Repository
2025-12-16 10:12:07 +01:00
**Code**: [Coder Stack Templates ](https://edp.buildth.ing/DevFW-CICD/stacks/src/branch/main/template/stacks/coder )
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
**Documentation**:
* [Coder Official Documentation ](https://coder.com/docs )
* [Coder GitHub Repository ](https://github.com/coder/coder )
2025-11-17 11:14:02 +01:00
## Getting Started
### Prerequisites
2025-12-16 10:12:07 +01:00
* Kubernetes cluster with ArgoCD installed (provided by `core` stack)
* CloudNativePG operator (provided by `core` stack)
* Ingress controller configured (provided by `otc` stack)
* cert-manager for TLS certificate management (provided by `otc` stack)
* Domain name configured via `DOMAIN_GITEA` environment variable
2025-11-17 11:14:02 +01:00
### Quick Start
2025-12-16 10:12:07 +01:00
The Coder stack is deployed as part of the EDP installation process:
1. **Trigger Deploy Pipeline**
- Go to [Infra Deploy Pipeline ](https://edp.buildth.ing/DevFW/infra-deploy/actions?workflow=deploy.yaml )
- Click on Run workflow
- Enter a name in "Select environment directory to deploy". This must be DNS Compatible. (if you enter `test-me` then the domain will be `coder.test-me.t09.de` )
- Execute workflow
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
2. **ArgoCD Synchronization**
ArgoCD automatically deploys:
- PostgreSQL database cluster (CloudNativePG)
- Coder application (Helm chart v2.28.3)
- Ingress configuration with TLS
- Database credentials and edge connectivity secrets
2025-11-17 11:14:02 +01:00
### Verification
2025-12-16 10:12:07 +01:00
Verify the Coder deployment:
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
```bash
# Check ArgoCD application status
kubectl get application coder -n argocd
# Verify Coder pods are running
kubectl get pods -n coder
# Check PostgreSQL cluster status
kubectl get cluster coder-db -n coder
# Verify ingress configuration
kubectl get ingress -n coder
```
Access the Coder web interface at `https://coder.{DOMAIN_GITEA}` .
## Architecture
### Component Architecture
The Coder stack consists of:
**Coder Control Plane**:
- Web application for workspace management
- API server for workspace provisioning
- Terraform executor for infrastructure operations
**PostgreSQL Database**:
- Single-instance CloudNativePG cluster
- Stores workspace metadata, templates, and user data
- Managed database user with `coder-db-user` secret
- 10Gi persistent storage on `csi-disk` storage class
**Networking**:
- ClusterIP service for internal communication
- Nginx ingress with TLS termination
- cert-manager integration for automatic certificate management
## Configuration
### Environment Variables
The Coder application is configured through environment variables in `values.yaml` :
**Access Configuration**:
- `CODER_ACCESS_URL` : Public URL where Coder is accessible (`https://coder.{DOMAIN_GITEA}` )
**Database Configuration**:
- `CODER_PG_CONNECTION_URL` : PostgreSQL connection string (from `coder-db-user` secret)
**Authentication**:
- `CODER_OAUTH2_GITHUB_DEFAULT_PROVIDER_ENABLE` : GitHub OAuth integration (disabled by default)
**Edge Connectivity**:
- `EDGE_CONNECT_ENDPOINT` : Edge connection endpoint (from `edge-credential` secret)
- `EDGE_CONNECT_USERNAME` : Edge authentication username
- `EDGE_CONNECT_PASSWORD` : Edge authentication password
### Helm Chart Configuration
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
Key Helm values configured in `stacks/coder/coder/values.yaml` :
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
```yaml
coder:
env:
- name: CODER_ACCESS_URL
value: "https://coder.{DOMAIN_GITEA}"
- name: CODER_PG_CONNECTION_URL
valueFrom:
secretKeyRef:
name: coder-db-user
key: uri
service:
type: ClusterIP
ingress:
enable: true
className: nginx
host: "coder.{DOMAIN_GITEA}"
annotations:
cert-manager.io/cluster-issuer: main
tls:
enable: true
secretName: coder-tls-secret
```
**Important**: Do not override `CODER_HTTP_ADDRESS` , `CODER_TLS_ENABLE` , `CODER_TLS_CERT_FILE` , or `CODER_TLS_KEY_FILE` as these are managed by the Helm chart.
### PostgreSQL Database Configuration
Defined in `stacks/coder/coder/manifests/postgres.yaml` :
**Cluster Specification**:
- 1 instance (single-node cluster)
- Primary update strategy: unsupervised
- Resource requests/limits: 1 CPU, 1Gi memory
- Storage: 10Gi using `csi-disk` storage class
**Managed Roles**:
- User: `coder`
- Permissions: createdb, login
- Password stored in `coder-db-user` secret
### ArgoCD Application Configuration
**Registry Application** (`template/registry/coder.yaml` ):
- Name: `coder-reg`
- Manages the Coder stack directory
- Automated sync with prune and self-heal enabled
**Stack Application** (`template/stacks/coder/coder.yaml` ):
- Name: `coder`
- Deploys Coder Helm chart v2.28.3 from `https://helm.coder.com/v2`
- Automated self-healing enabled
- Creates namespace automatically
- References values from `stacks-instances` repository
## Usage Examples
### Creating a Workspace Template
After deployment, create workspace templates using Terraform:
1. **Access Coder Dashboard**
```bash
open https://coder.${DOMAIN_GITEA}
```
2. **Create Template Repository**
Create a Git repository with a Terraform template:
```hcl
# main.tf
terraform {
required_providers {
coder = {
source = "coder/coder"
version = "~> 0.12"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.23"
}
}
}
resource "coder_agent" "main" {
os = "linux"
arch = "amd64"
}
resource "kubernetes_pod" "main" {
metadata {
name = "coder-${data.coder_workspace.me.owner}-${data.coder_workspace.me.name}"
namespace = "coder-workspaces"
}
spec {
container {
name = "dev"
image = "codercom/enterprise-base:ubuntu"
command = ["sh", "-c", coder_agent.main.init_script]
}
}
}
```
3. **Push Template to Coder**
```bash
coder templates push kubernetes-dev
```
### Provisioning a Development Workspace
2025-11-17 11:14:02 +01:00
```bash
2025-12-16 10:12:07 +01:00
# Create a new workspace from template
coder create my-workspace --template kubernetes-dev
# Connect via SSH
coder ssh my-workspace
# Open in VS Code
coder open my-workspace --ide vscode
# Stop workspace when not in use
coder stop my-workspace
# Delete workspace
coder delete my-workspace
2025-11-17 11:14:02 +01:00
```
2025-12-16 10:12:07 +01:00
### Integrating with Platform Services
Access EDP platform services from Coder workspaces:
```bash
# Connect to platform PostgreSQL
psql "postgresql://myuser@postgres .core.svc.cluster.local:5432/mydb"
# Access Forgejo
git clone https://forgejo.${DOMAIN_GITEA}/myorg/myrepo.git
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
# Query platform metrics
curl https://grafana.${DOMAIN}/api/datasources
```
2025-11-17 11:14:02 +01:00
## Integration Points
2025-12-16 10:12:07 +01:00
* **Core Stack**: Depends on ArgoCD for deployment orchestration and CloudNativePG operator for database management
* **OTC Stack**: Requires ingress-nginx controller and cert-manager for external access and TLS
* **Forgejo Stack**: Workspace templates can integrate with platform Git repositories
* **Observability Stack**: Workspace metrics can be collected by platform observability tools
* **Dex (SSO)**: Can be configured for centralized authentication (requires additional configuration)
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
## Troubleshooting
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
### Coder Pods Not Starting
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
**Problem**: Coder pods remain in `Pending` or `CrashLoopBackOff` state
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
**Solution**:
1. Check PostgreSQL cluster status:
```bash
kubectl get cluster coder-db -n coder
kubectl describe cluster coder-db -n coder
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
2. Verify database credentials secret:
```bash
kubectl get secret coder-db-user -n coder
kubectl get secret coder-db-user -n coder -o jsonpath='{.data.uri}' | base64 -d
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
3. Check Coder logs:
```bash
kubectl logs -n coder -l app=coder
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
### Cannot Access Coder UI
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
**Problem**: Coder web interface is not accessible at configured URL
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
**Solution**:
1. Verify ingress configuration:
```bash
kubectl get ingress -n coder
kubectl describe ingress -n coder
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
2. Check TLS certificate status:
```bash
kubectl get certificate -n coder
kubectl describe certificate coder-tls-secret -n coder
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
3. Verify DNS resolution:
```bash
nslookup coder.${DOMAIN_GITEA}
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
### Database Connection Errors
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
**Problem**: Coder cannot connect to PostgreSQL database
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
**Solution**:
1. Verify PostgreSQL cluster health:
```bash
kubectl get pods -n coder -l cnpg.io/cluster=coder-db
kubectl logs -n coder -l cnpg.io/cluster=coder-db
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
2. Check database and user creation:
```bash
kubectl get database coder -n coder
kubectl exec -it coder-db-1 -n coder -- psql -U postgres -c "\l"
kubectl exec -it coder-db-1 -n coder -- psql -U postgres -c "\du"
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
3. Test connection string:
```bash
kubectl exec -it coder-db-1 -n coder -- psql "$(kubectl get secret coder-db-user -n coder -o jsonpath='{.data.uri}' | base64 -d)"
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
### Workspace Provisioning Fails
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
**Problem**: Workspaces fail to provision from templates
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
**Solution**:
1. Check Coder provisioner logs:
```bash
kubectl logs -n coder -l app=coder --tail=100
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
2. Verify Kubernetes permissions for workspace creation:
```bash
kubectl auth can-i create pods --as=system:serviceaccount:coder:coder -n coder-workspaces
```
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
3. Review template Terraform configuration for errors
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
## Additional Resources
2025-11-17 11:14:02 +01:00
2025-12-16 10:12:07 +01:00
* [Coder Documentation ](https://coder.com/docs )
* [Coder Templates Repository ](https://github.com/coder/coder )
* [CloudNativePG Documentation ](https://cloudnative-pg.io/ )
* [ArgoCD Documentation ](https://argo-cd.readthedocs.io/ )
* [Coder Blog: 2025 Launch Week ](https://coder.com/blog/launch-week-2025-instant-infrastructure )