VS Code Server远程开发:在服务器上写代码,浏览器里调试

概述

VS Code Server(code-server)让你在任何设备的浏览器中获得 VS Code 的完整开发体验。

安装

# 一键安装
curl -fsSL https://code-server.dev/install.sh | sh

# 启动服务
systemctl --user enable --now code-server

配置

编辑 ~/.config/code-server/config.yaml

bind-addr: 0.0.0.0:8080
auth: password
password: 你的密码
cert: false

反向代理(Nginx)

server {
    listen 443 ssl;
    server_name code.你的域名.com;
    
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
    }
}

推荐插件

安装 Python、Docker、GitHub Copilot 等插件,获得完整的云端开发体验。

这篇文章对你有帮助吗?