code-server (VS Code)
VS Code in the browser.
Overview
Code-server is an open-source project developed by Coder that enables developers to run Visual Studio Code entirely within a web browser by hosting the IDE on a remote server. Originally created to solve the limitations of local development environments, code-server transforms VS Code into a web application that maintains full feature parity with the desktop version, including extensions, themes, and integrated terminal access. The project emerged from the need to provide consistent development environments across different devices and enable coding from anywhere with just a browser.
This Docker deployment leverages the LinuxServer.io community image to containerize code-server with proper user permissions and configuration management. The stack mounts your project directories directly into the container while maintaining persistent configuration data, creating a portable development environment that can be deployed on any Docker-capable machine. The configuration includes password authentication and exposes the web interface on port 8443 for secure access.
Developers working across multiple devices, teams requiring standardized development environments, or anyone needing to code from restricted devices like Chromebooks will find this deployment particularly valuable. Educational institutions can provide students with consistent coding environments, while remote teams can ensure everyone works with identical tooling and dependencies regardless of their local machine specifications.
Key Features
- Complete VS Code experience running in any modern web browser
- Extension support through Open VSX Registry with thousands of available packages
- Built-in terminal with configurable sudo access for server administration
- Multi-user support with individual workspaces and configurations
- Real-time collaborative editing when combined with Live Share extensions
- Automatic workspace persistence across container restarts
- HTTPS support with self-signed certificates for secure remote access
- Native file system integration with drag-and-drop upload capabilities
Common Use Cases
- 1Remote development on powerful cloud servers while using lightweight local devices
- 2Educational coding bootcamps providing standardized development environments for students
- 3Development teams maintaining consistent tooling across Windows, Mac, and Linux workstations
- 4Freelance developers working from client locations without installing local development tools
- 5IoT and embedded development requiring direct access to target hardware over SSH
- 6Corporate environments with locked-down workstations preventing local IDE installation
- 7Code review sessions where multiple team members need identical project setups
Prerequisites
- Minimum 2GB RAM allocated to Docker (4GB+ recommended for larger projects)
- Available port 8443 on the host system for web interface access
- Valid project directory path to mount as the workspace volume
- Strong password set in PASSWORD environment variable for authentication
- Docker host with sufficient disk space for project files and extensions
- Modern web browser with JavaScript enabled and WebSocket support
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: linuxserver/code-server:latest4 container_name: code-server5 restart: unless-stopped6 environment: 7 PUID: 10008 PGID: 10009 TZ: UTC10 PASSWORD: ${PASSWORD}11 volumes: 12 - code_config:/config13 - /path/to/projects:/projects14 ports: 15 - "8443:8443"1617volumes: 18 code_config: .env Template
.env
1PASSWORD=changemeUsage Notes
- 1Docs: https://coder.com/docs/code-server/latest
- 2Access at http://localhost:8443 - login with PASSWORD env var
- 3Full VS Code experience in the browser
- 4Install extensions from Open VSX (not MS Marketplace)
- 5Mount /projects for your workspace files
- 6SUDO_PASSWORD env var enables sudo in terminal
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 code-server:5 image: linuxserver/code-server:latest6 container_name: code-server7 restart: unless-stopped8 environment:9 PUID: 100010 PGID: 100011 TZ: UTC12 PASSWORD: ${PASSWORD}13 volumes:14 - code_config:/config15 - /path/to/projects:/projects16 ports:17 - "8443:8443"1819volumes:20 code_config:21EOF2223# 2. Create the .env file24cat > .env << 'EOF'25PASSWORD=changeme26EOF2728# 3. Start the services29docker compose up -d3031# 4. View logs32docker 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/code-server/run | bashTroubleshooting
- Extensions fail to install: Change extension gallery URL to Open VSX instead of Microsoft Marketplace in settings
- Permission denied accessing mounted project files: Verify PUID and PGID match your host user ID and group ID
- Container keeps restarting: Check that port 8443 is not already in use by another service
- Cannot access terminal or sudo commands: Set SUDO_PASSWORD environment variable to enable privileged access
- Slow performance or timeouts: Increase allocated memory and ensure stable network connection to Docker host
- Lost workspace settings after restart: Verify code_config volume is properly mounted and persistent
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
Ad Space
Shortcuts: C CopyF FavoriteD Download