A web-based VS Code environment (code-server) with GitHub Copilot, secured with HTTPS (Let's Encrypt) and GitHub OAuth authentication.
┌─────────────────────────────────────────────────────────┐
│ Docker Host │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Traefik │ │ OAuth2-Proxy │ │ code-server │ │
│ │ (SSL/7443) │──│ (GitHub) │──│ (VS Code) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │
│ Let's Encrypt │
└─────────────────────────────────────────────────────────┘
The code-server container comes with a full development environment:
Languages & Runtimes:
- Node.js LTS (with npm)
- Python 3 (with pip and venv)
- Go 1.22
- Rust (with cargo)
CLI Tools:
- Docker CLI
- kubectl
- Terraform
- AWS CLI v2
VS Code Extensions:
- GitHub Copilot
- GitHub Copilot Chat
- Docker and Docker Compose installed
- A domain name pointing to your server
- Port 80 and 7443 accessible from the internet
- A GitHub account
- Go to GitHub Developer Settings
- Click New OAuth App
- Fill in the application details:
- Application name: Vibe Coding Terminal
- Homepage URL:
https://your-domain.com:7443 - Authorization callback URL:
https://your-domain.com:7443/oauth2/callback
- Click Register application
- Copy the Client ID
- Click Generate a new client secret and copy the secret
Add an A record pointing your domain to your server's IP address:
Type: A
Name: your-subdomain (or @ for root domain)
Value: YOUR_SERVER_IP
TTL: 300
# Copy the example environment file
cp .env.example .env
# Edit the .env file with your values
nano .envFill in the required values:
DOMAIN=your-domain.com
EMAIL=your-email@example.com
GITHUB_CLIENT_ID=<from step 1>
GITHUB_CLIENT_SECRET=<from step 1>
OAUTH2_PROXY_COOKIE_SECRET=<generate below>Generate a cookie secret:
openssl rand -base64 32 | tr -- '+/' '-_'Option A: Use the deployment script (recommended)
chmod +x deploy.sh
./deploy.shThe script will:
- Check prerequisites
- Configure environment interactively
- Generate cookie secret
- Build and start all services
Option B: Manual deployment
# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Check status
docker-compose psDeployment script commands:
./deploy.sh # Full deployment
./deploy.sh --status # Show status
./deploy.sh --logs # View logs
./deploy.sh --restart # Restart services
./deploy.sh --stop # Stop services- Navigate to
https://your-domain.com:7443 - You'll be redirected to GitHub for authentication
- Authorize the OAuth app
- VS Code will load in your browser
- Click the Copilot icon in the VS Code sidebar (or bottom status bar)
- Click Sign in to GitHub
- Complete the device authorization flow
- Start coding with Copilot suggestions
| Shortcut | Action |
|---|---|
Ctrl+` |
Open/close terminal |
Ctrl+Shift+P |
Command palette |
Ctrl+P |
Quick file open |
Tab |
Accept Copilot suggestion |
Esc |
Dismiss Copilot suggestion |
Alt+] / Alt+[ |
Next/previous Copilot suggestion |
The following data is persisted across container restarts:
- Project files:
/home/coder/project→vibe-code-server-projectvolume - VS Code settings/extensions:
vibe-code-server-datavolume - SSL certificates:
vibe-traefik-letsencryptvolume
To work with files from your host machine, edit docker-compose.yml:
code-server:
volumes:
- ./workspace:/home/coder/projectEdit .env and uncomment:
GITHUB_ALLOWED_USERS=user1,user2,user3Edit .env and uncomment:
GITHUB_ALLOWED_ORG=your-organizationIf Let's Encrypt fails to issue a certificate:
- Ensure port 80 is accessible from the internet
- Verify DNS is properly configured
- Check Traefik logs:
docker-compose logs traefik
If GitHub authentication fails:
- Verify the callback URL matches exactly:
https://your-domain.com:7443/oauth2/callback - Check OAuth2-proxy logs:
docker-compose logs oauth2-proxy - Ensure the cookie secret is properly base64 encoded
- Check code-server logs:
docker-compose logs code-server - Verify the container is running:
docker-compose ps - Rebuild the image:
docker-compose build code-server
docker-compose pull
docker-compose up -d --build# Backup project files
docker run --rm -v vibe-code-server-project:/data -v $(pwd):/backup alpine tar czf /backup/project-backup.tar.gz -C /data .
# Backup VS Code settings
docker run --rm -v vibe-code-server-data:/data -v $(pwd):/backup alpine tar czf /backup/vscode-backup.tar.gz -C /data .docker-compose downdocker-compose down -v- All traffic is encrypted via TLS 1.2+
- GitHub OAuth ensures only authorized users can access
- code-server runs as non-root user (
coder) - Secrets are managed via environment variables (never commit
.env) - The Traefik dashboard is protected by OAuth (optional)
MIT