Code Server role
Deploy Code Server (VS Code in the browser), a web-based development environment with Traefik reverse proxy integration.
Usage
Configure Code Server settings in your inventory:
1 2 3 4 5 6 7 8 | |
Include the role in your playbook:
1 2 3 4 | |
The role provides these tags:
- code-server-install - Deploy Code Server container
- code-server-uninstall - Remove Code Server container
Docs
Deploy Code Server to your Docker host:
1 | |
Remove Code Server installation:
1 | |
Configuration Details
The role deploys Code Server with:
- LinuxServer.io Image: lscr.io/linuxserver/code-server
- Traefik Integration: Automatic HTTPS via Traefik reverse proxy
- Persistent Storage: Configuration and workspace data
- User Permissions: PUID=1000, PGID=1000
- Timezone: Europe/Zurich
- Sudo Access: Optional sudo with configurable password
Accessing Code Server
After deployment, Code Server is available at:
- URL: https://code-server.rwcloud.ch
- Port: 8443 (internal, accessed via Traefik)
Environment Variables
The container is configured with:
- PUID=1000 / PGID=1000 - User/group IDs
- TZ=Europe/Zurich - Timezone
- SUDO_PASSWORD - Password for sudo within the container
- PROXY_DOMAIN=code-server.rwcloud.ch - Domain for proper URL handling
- DEFAULT_WORKSPACE=/config/workspace - Default project directory
Storage
One volume is created:
- config - Contains VS Code configuration, extensions, and workspace files
Features
Code Server provides: - Full VS Code experience in the browser - Extension marketplace access - Git integration - Terminal access with sudo privileges - Multi-file editing - IntelliSense and debugging - Collaborative coding (via Live Share extension)
Workspace
Your code projects are stored in /config/workspace within the container. Mount additional volumes if you need access to specific host directories:
1 2 3 | |
Security
- Access is controlled via Traefik
- Sudo requires the configured password
- Consider adding authentication middleware in Traefik for additional security
