VSCode-Server for browser-based remote development

VSCode-Server lets you run Visual Studio Code in the browser on remote servers. It’s lightweight, fast, and perfect for secure development environments.

I wanted a setup that lets me continue coding from a low-performance tablet while on vacation, without compromising my usual workflow.

This guide shows how to install and configure it with a custom SSL certificate using NGINX.

LXC Container and VSCode-Server

LXC provides lightweight, efficient containers ideal for running VSCode-Server. Proper resource allocation ensures smooth editing and extension use even on modest hardware.

ResourceRecommendedNotes
CPU1–2 vCPUsHandles editing and extensions smoothly
Memory1–2 GB512 MB minimum, more for larger projects
StorageSSD / fast overlayfsSpeeds up indexing and extensions
Network<20 ms latencyEnsures responsive remote editing

With these settings, LXC delivers near-native performance with minimal overhead.

System Preparation

sudo dnf update -y
sudo dnf install curl nano vim nginx -y

Install VSCode-Server

curl -fsSL https://code-server.dev/install.sh | sh
sudo systemctl enable --now code-server@$USER

Edit the listener configuration:

nano ~/.config/code-server/config.yaml
bind-addr: 0.0.0.0:8080

Restart the service:

sudo systemctl restart code-server@$USER

Firewall

sudo firewall-cmd --add-port={80,443}/tcp --permanent
sudo firewall-cmd --reload

SSL and NGINX

Place your SSL certificate and key:

  • /etc/nginx/conf.d/vscode.examplecorp.io.crt
  • /etc/nginx/conf.d/vscode.examplecorp.io.key

Create /etc/nginx/conf.d/vscode-server.conf:

server {
    listen 80;
    server_name vscode.examplecorp.io;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name vscode.examplecorp.io;

    ssl_certificate /etc/nginx/conf.d/vscode.examplecorp.io.crt;
    ssl_certificate_key /etc/nginx/conf.d/vscode.examplecorp.io.key;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
        proxy_buffering off;                 # Improves WebSocket responsiveness              
        proxy_read_timeout 3600s;            # Avoid disconnects for long sessions        
        client_max_body_size 100M;           # Allow large files
} }

Test and start NGINX:

sudo nginx -t
sudo systemctl enable --now nginx

Access and Login

Open https://vscode.examplecorp.io in your browser.
By default, code-server generates a password on first launch. You can see or change it in:

Example:

bind-addr: 0.0.0.0:8080
auth: password
password: your-chosen-password
cert: false

Note: This setup is single-user only. Multi-user access is not supported. Each system user would need a separate code-server instance if multiple people need access.

Upgrade

Upgrading does not remove user data stored in ~/.local/share/code-server:

curl -fsSL https://code-server.dev/install.sh | sh
sudo systemctl restart code-server@$USER

Troubleshooting

  • WebSocket 1006: If the workbench fails to connect, check that proxy_set_header Upgrade and proxy_set_header Connection upgrade exist in your NGINX config.
  • Service won’t start: Use journalctl -u code-server@$USER -f to check logs for port conflicts or permission issues.