Code Server VS Code
VS Code in the browser with full extension support and persistent workspace.
[i]Overview
Code-server is Microsoft's VS Code editor running entirely in a web browser, developed by Coder to enable remote development workflows. Originally created to solve the challenge of accessing powerful development environments from any device, code-server maintains full compatibility with VS Code extensions while running on remote servers or containers. This browser-based IDE has revolutionized how developers approach remote work and resource-intensive development tasks.
This stack combines code-server with NGINX as a reverse proxy to create a robust web-based development environment. The NGINX component handles SSL termination, request routing, and can provide additional security layers through rate limiting and authentication. Code-server runs the actual VS Code instance with full extension marketplace access, integrated terminal, and file system operations, while NGINX manages external access and can serve static assets efficiently.
Development teams working across multiple devices, organizations requiring consistent development environments, and individual developers seeking powerful remote coding capabilities will find this combination particularly valuable. The setup enables coding from tablets, Chromebooks, or any device with a modern browser while leveraging server-grade hardware for compilation, testing, and resource-intensive operations. Remote development teams can maintain identical environments regardless of local hardware constraints.
[*]Key Features
- [+]Complete VS Code experience in browser with full extension marketplace access
- [+]Integrated terminal with sudo access for system-level operations
- [+]Real-time collaborative editing and shared development sessions
- [+]NGINX reverse proxy with SSL termination and custom domain support
- [+]Password and token-based authentication for secure access
- [+]Persistent workspace and configuration storage across container restarts
- [+]HTTP/2 support through NGINX for improved browser performance
- [+]Built-in file explorer with upload/download capabilities for local file management
[#]Common Use Cases
- [1]Remote development teams maintaining consistent coding environments across different operating systems
- [2]Educational institutions providing standardized programming environments for students on various devices
- [3]Freelance developers working from client sites or co-working spaces without local development setup
- [4]Organizations developing on powerful cloud instances while using lightweight local devices
- [5]Development on ARM-based devices like Raspberry Pi with browser access from desktop machines
- [6]Secure coding environments where source code must remain on controlled servers
- [7]Multi-platform development requiring different toolchains available through containerized environments
[!]Prerequisites
- [!]Minimum 2GB RAM recommended for smooth VS Code operation with multiple extensions
- [!]Docker host with ports 80, 443, and 8443 available for web access
- [!]Modern web browser with WebSocket support for real-time editor synchronization
- [!]Basic understanding of NGINX configuration for SSL certificates and custom domains
- [!]File system permissions allowing Docker volume mounting for persistent workspace storage
[!]
WARNING: 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 code-server: 3 image: lscr.io/linuxserver/code-server:latest4 environment: 5 PUID: 10006 PGID: 10007 TZ: ${TZ}8 PASSWORD: ${PASSWORD}9 SUDO_PASSWORD: ${SUDO_PASSWORD}10 ports: 11 - "8443:8443"12 volumes: 13 - code_config:/config14 - workspace:/workspace15 networks: 16 - code-net17 restart: unless-stopped1819 nginx: 20 image: nginx:alpine21 ports: 22 - "80:80"23 - "443:443"24 volumes: 25 - ./nginx.conf:/etc/nginx/nginx.conf:ro26 depends_on: 27 - code-server28 networks: 29 - code-net30 restart: unless-stopped3132volumes: 33 code_config: 34 workspace: 3536networks: 37 code-net: 38 driver: bridge[$].env Template
[.env]
1# Timezone2TZ=UTC34# Passwords5PASSWORD=secure_password6SUDO_PASSWORD=secure_sudo_password78# User/Group IDs9PUID=100010PGID=1000[i]Usage Notes
- [1]VS Code at http://localhost:8443
- [2]Enter password to access
- [3]Full VS Code extension support
- [4]Persistent workspace in /workspace
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
code-server
code-server:
image: lscr.io/linuxserver/code-server:latest
environment:
PUID: 1000
PGID: 1000
TZ: ${TZ}
PASSWORD: ${PASSWORD}
SUDO_PASSWORD: ${SUDO_PASSWORD}
ports:
- "8443:8443"
volumes:
- code_config:/config
- workspace:/workspace
networks:
- code-net
restart: unless-stopped
nginx
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- code-server
networks:
- code-net
restart: unless-stopped
[>]Quick Start
[terminal]
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 code-server:5 image: lscr.io/linuxserver/code-server:latest6 environment:7 PUID: 10008 PGID: 10009 TZ: ${TZ}10 PASSWORD: ${PASSWORD}11 SUDO_PASSWORD: ${SUDO_PASSWORD}12 ports:13 - "8443:8443"14 volumes:15 - code_config:/config16 - workspace:/workspace17 networks:18 - code-net19 restart: unless-stopped2021 nginx:22 image: nginx:alpine23 ports:24 - "80:80"25 - "443:443"26 volumes:27 - ./nginx.conf:/etc/nginx/nginx.conf:ro28 depends_on:29 - code-server30 networks:31 - code-net32 restart: unless-stopped3334volumes:35 code_config:36 workspace:3738networks:39 code-net:40 driver: bridge41EOF4243# 2. Create the .env file44cat > .env << 'EOF'45# Timezone46TZ=UTC4748# Passwords49PASSWORD=secure_password50SUDO_PASSWORD=secure_sudo_password5152# User/Group IDs53PUID=100054PGID=100055EOF5657# 3. Start the services58docker compose up -d5960# 4. View logs61docker compose logs -f[>]One-Liner
Run this command to download and set up the recipe in one step:
[terminal]
1curl -fsSL https://docker.recipes/api/recipes/code-server-vscode/run | bash[?]Troubleshooting
- [!]Connection refused on port 8443: Verify code-server container is running and PASSWORD environment variable is set
- [!]Extensions fail to install: Increase container memory allocation and check internet connectivity for marketplace access
- [!]NGINX 502 Bad Gateway: Ensure code-server service is healthy and inter-container networking allows communication
- [!]Authentication loop or constant password prompts: Clear browser cookies and verify PASSWORD matches between attempts
- [!]File permissions denied in terminal: Check PUID/PGID environment variables match host user permissions
- [!]Slow performance or timeouts: Increase code-server container resources and verify NGINX upstream timeout settings
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
code-servernginx
## Tags
#code-server#vscode#ide#browser#development
## Category
Development ToolsShortcuts: C CopyF FavoriteD Download