Coder Development Workspaces
Coder for remote development environments.
Overview
Coder is an open-source platform that enables organizations to provision secure, standardized development environments in the cloud or on-premises infrastructure. Originally developed to address the challenges of remote development, Coder creates consistent, reproducible workspaces that can be accessed from anywhere via a web browser or SSH. This platform eliminates the 'works on my machine' problem by ensuring all developers work within identical environments while maintaining the flexibility to customize tooling and configurations.
This stack combines Coder with PostgreSQL to create a robust remote development platform. PostgreSQL serves as Coder's metadata store, tracking workspace definitions, user sessions, provisioning state, and audit logs with ACID compliance ensuring data integrity during concurrent operations. The database handles complex queries for workspace analytics, user permissions, and resource allocation while supporting Coder's template system that defines how development environments are provisioned and configured.
Development teams transitioning to remote work, organizations seeking to standardize development environments, and companies managing large engineering teams will benefit from this configuration. The combination provides enterprise-grade reliability through PostgreSQL's proven stability while Coder delivers instant workspace provisioning, consistent development environments across team members, and centralized management of development resources. This setup particularly excels in environments where security, compliance, and resource optimization are critical requirements.
Key Features
- Template-based workspace provisioning with infrastructure-as-code definitions
- Web-based VS Code, JetBrains Gateway, and SSH access to development environments
- PostgreSQL-backed audit logging and workspace state management with ACID compliance
- Docker socket integration for container-based development environment provisioning
- Multi-user workspace management with role-based access control and quotas
- Real-time workspace status monitoring and resource usage analytics
- Git-ops workflow integration with automated environment updates
- Workspace hibernation and automatic resource cleanup to optimize costs
Common Use Cases
- 1Remote engineering teams needing consistent development environments across distributed developers
- 2Organizations onboarding new developers who require immediate access to fully configured workspaces
- 3Companies implementing security policies that restrict local development on employee devices
- 4Educational institutions providing students with standardized programming environments
- 5Enterprises managing compliance requirements through centralized development environment control
- 6Startups optimizing cloud costs by sharing development infrastructure and automatic resource cleanup
- 7Open source projects offering contributors pre-configured development environments
Prerequisites
- Docker Engine with daemon socket access for workspace container provisioning
- Minimum 4GB RAM (8GB+ recommended for multiple concurrent workspaces)
- Port 7080 available for Coder web interface access
- Understanding of infrastructure-as-code concepts for workspace template creation
- Basic PostgreSQL administration knowledge for database maintenance and backups
- Familiarity with container networking and volume management concepts
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 coder: 3 image: ghcr.io/coder/coder:latest4 container_name: coder5 restart: unless-stopped6 ports: 7 - "${CODER_PORT:-7080}:7080"8 environment: 9 - CODER_PG_CONNECTION_URL=postgres://${DB_USER}:${DB_PASSWORD}@coder-db/coder?sslmode=disable10 - CODER_HTTP_ADDRESS=0.0.0.0:708011 - CODER_ACCESS_URL=http://localhost:${CODER_PORT:-7080}12 volumes: 13 - /var/run/docker.sock:/var/run/docker.sock14 - coder_data:/home/coder/.config15 depends_on: 16 - coder-db1718 coder-db: 19 image: postgres:15-alpine20 container_name: coder-db21 restart: unless-stopped22 environment: 23 - POSTGRES_USER=${DB_USER}24 - POSTGRES_PASSWORD=${DB_PASSWORD}25 - POSTGRES_DB=coder26 volumes: 27 - coder_db_data:/var/lib/postgresql/data2829volumes: 30 coder_data: 31 coder_db_data: .env Template
.env
1# Coder2CODER_PORT=70803DB_USER=coder4DB_PASSWORD=coder_passwordUsage Notes
- 1Coder at http://localhost:7080
- 2Create first user on startup
- 3Define workspace templates
- 4Docker or Kubernetes backends
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
coder
coder:
image: ghcr.io/coder/coder:latest
container_name: coder
restart: unless-stopped
ports:
- ${CODER_PORT:-7080}:7080
environment:
- CODER_PG_CONNECTION_URL=postgres://${DB_USER}:${DB_PASSWORD}@coder-db/coder?sslmode=disable
- CODER_HTTP_ADDRESS=0.0.0.0:7080
- CODER_ACCESS_URL=http://localhost:${CODER_PORT:-7080}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- coder_data:/home/coder/.config
depends_on:
- coder-db
coder-db
coder-db:
image: postgres:15-alpine
container_name: coder-db
restart: unless-stopped
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=coder
volumes:
- coder_db_data:/var/lib/postgresql/data
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 coder:5 image: ghcr.io/coder/coder:latest6 container_name: coder7 restart: unless-stopped8 ports:9 - "${CODER_PORT:-7080}:7080"10 environment:11 - CODER_PG_CONNECTION_URL=postgres://${DB_USER}:${DB_PASSWORD}@coder-db/coder?sslmode=disable12 - CODER_HTTP_ADDRESS=0.0.0.0:708013 - CODER_ACCESS_URL=http://localhost:${CODER_PORT:-7080}14 volumes:15 - /var/run/docker.sock:/var/run/docker.sock16 - coder_data:/home/coder/.config17 depends_on:18 - coder-db1920 coder-db:21 image: postgres:15-alpine22 container_name: coder-db23 restart: unless-stopped24 environment:25 - POSTGRES_USER=${DB_USER}26 - POSTGRES_PASSWORD=${DB_PASSWORD}27 - POSTGRES_DB=coder28 volumes:29 - coder_db_data:/var/lib/postgresql/data3031volumes:32 coder_data:33 coder_db_data:34EOF3536# 2. Create the .env file37cat > .env << 'EOF'38# Coder39CODER_PORT=708040DB_USER=coder41DB_PASSWORD=coder_password42EOF4344# 3. Start the services45docker compose up -d4647# 4. View logs48docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/coder-workspace-stack/run | bashTroubleshooting
- Coder fails to start with 'connection refused' database error: Ensure PostgreSQL container is fully initialized before Coder starts, add health checks or startup delays
- Workspace provisioning fails with Docker socket permission denied: Verify /var/run/docker.sock has correct permissions and Coder container runs with appropriate user privileges
- PostgreSQL connection pool exhausted during high workspace activity: Increase max_connections in PostgreSQL configuration and tune Coder's database connection pool settings
- Workspace templates fail to execute with 'template not found' errors: Check template definitions are properly committed to database and Coder has read permissions
- Coder web interface inaccessible from external networks: Verify CODER_ACCESS_URL matches your actual domain/IP and firewall rules allow traffic on configured port
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
coderpostgresqlenvbuilder
Tags
#coder#remote-dev#workspaces#cloud-ide
Category
Development ToolsAd Space
Shortcuts: C CopyF FavoriteD Download