Install VS Code Server on VPS - Run IDE in Browser

Install VS Code Server on VPS - Run IDE in Browser

June 2026 · 8 min read

VS Code Server is a lightweight version of Visual Studio Code that runs on your server, allowing you to access the IDE through a web browser from any device. No local installation needed—just a web browser and internet connection. This guide will walk you through installing code-server (OpenVSCode Server) on your VPS, setting up HTTPS encryption, password protection, and configuring SSH tunnels for secure remote development access.

System Requirements and Preparation

Before installing VS Code Server, ensure your VPS meets these minimum specifications:

Connect to your VPS via SSH and update the system:

sudo apt update && sudo apt upgrade -y

Installing code-server

The easiest way to install code-server is using the official installation script, which automates the entire process:

curl -fsSL https://code-server.dev/install.sh | sh

This script will:

After installation, start the service:

systemctl start code-server@$USER
systemctl enable code-server@$USER
Note: If you're running as root, replace $USER with your actual username

Configuring Authentication and Security

The configuration file for code-server is located at ~/.config/code-server/config.yaml. Edit it to customize your setup:

nano ~/.config/code-server/config.yaml

A typical configuration file looks like this:

bind-addr: 127.0.0.1:8080
auth: password
password: your_secure_password_here
cert: false

Key configuration options:

View your current password:

cat ~/.config/code-server/config.yaml | grep password

Generate a strong new password:

openssl rand -base64 24

Update the password in your config file and restart the service:

systemctl restart code-server@$USER

Setting Up Nginx Reverse Proxy with HTTPS

To access code-server through your domain with HTTPS encryption, configure Nginx as a reverse proxy:

sudo nano /etc/nginx/sites-available/code-server

Add the following configuration (replace code.domain.com with your domain):

server {
    listen 80;
    server_name code.domain.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name code.domain.com;

    ssl_certificate /etc/letsencrypt/live/code.domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/code.domain.com/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    location / {
        proxy_pass http://127.0.0.1:8080/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
        proxy_request_buffering off;
    }
}

Enable the site:

sudo ln -s /etc/nginx/sites-available/code-server /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Obtain an SSL certificate using Certbot (install first if needed):

sudo apt install certbot python3-certbot-nginx -y
sudo certbot certonly --nginx -d code.domain.com

SSH Tunnel Method (Alternative)

If you prefer not to expose code-server publicly, use an SSH tunnel to securely access it from your local machine:

ssh -L 8080:localhost:8080 user@your_vps_ip

After establishing the tunnel, open your browser and visit:

http://localhost:8080

Enter your code-server password and you're in. This method is ideal for development work requiring maximum security since all traffic is encrypted through SSH.

SSH Tunnel Benefits: End-to-end encryption, no public exposure, perfect for local development. Secure and simple setup without managing certificates.

Managing Extensions and Settings

code-server supports nearly all VS Code extensions. Install them through the UI or command line:

code-server --install-extension ms-python.python
code-server --install-extension golang.go
code-server --install-extension rust-lang.rust-analyzer

Extensions are stored in ~/.local/share/code-server/extensions/

Popular extensions for server development:

Extension Purpose
Python Python syntax checking, debugger, and IntelliSense
Go Go language development tools
Prettier Auto-format JavaScript, HTML, CSS, JSON
GitLens Advanced Git integration and blame info
Docker Manage Docker containers and images

Verify VS Code Server Is Working

Check if the service is running:

systemctl status code-server@$USER

You should see active (running) in the output.

Verify that port 8080 is listening:

ss -tlnp | grep 8080

Expected output: LISTEN 127.0.0.1:8080

Test HTTP connectivity:

curl -s http://127.0.0.1:8080 | head -20

You should see HTML markup from the code-server interface.

Check service logs for any errors:

journalctl -u code-server@$USER -n 50 --no-pager
Tip: If you see errors in the logs, read from the first error line to understand what went wrong. Common issues are port conflicts, permission problems, or missing dependencies.

Troubleshooting Common Issues

Port 8080 Already in Use

If code-server fails to start, change the port in the configuration:

sudo nano ~/.config/code-server/config.yaml

Modify the bind-addr line to use a different port, such as 8081:

bind-addr: 127.0.0.1:8081

Save and restart:

systemctl restart code-server@$USER

502 Bad Gateway Error on HTTPS via Nginx

This typically occurs with WebSocket connections. Add these headers to your Nginx configuration:

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_buffering off;
proxy_request_buffering off;

Test and reload Nginx:

sudo nginx -t && sudo systemctl reload nginx

Cannot Login with Password

Verify the password is set in your config:

grep password ~/.config/code-server/config.yaml

If missing, generate and set a new password:

openssl rand -base64 24

Update the config file:

sed -i 's/password: .*/password: YOUR_NEW_PASSWORD/' ~/.config/code-server/config.yaml

Replace YOUR_NEW_PASSWORD with your actual password, then restart:

systemctl restart code-server@$USER

Extensions Installation Timeout

If extension installation is slow or timing out, check your internet connection:

ping marketplace.visualstudio.com

When installing via command line, increase retry attempts:

code-server --install-extension ms-python.python --install-extension-pack-retry-count 10

Alternatively, install extensions through the code-server web UI for better reliability.


Frequently Asked Questions

Q1: Can I share VS Code Server with my team members?

Yes, you can, but proceed with caution regarding security. It's recommended to use SSH key authentication instead of simple passwords, and implement strict firewall rules. For true team collaboration, consider deploying separate instances per user or exploring tools like Theia IDE which have better multi-user support features built-in.

Q2: Is VS Code Server secure if accessed over HTTPS?

Very secure. HTTPS uses TLS 1.2+ encryption for all communications. Combined with a strong password, security is robust. For additional hardening, restrict access by IP address, use a VPN, or implement additional authentication layers like 2FA through your reverse proxy.

Q3: What are the minimum RAM requirements for VS Code Server?

The absolute minimum is 512 MB, though extensions can increase memory usage significantly. 2 GB is recommended for comfortable daily use, and 4 GB is ideal if you're installing large extensions like Python, Go, Rust-analyzer, or Docker tools that perform heavy static analysis.


For developers looking for a reliable and fast VPS to run VS Code Server, asiagb.com provides VPS hosting in Thailand with high-speed SSD storage and 99% uptime, ideal for remote development environments that need to run 24/7.