code-server 可在伺服器上執行 VS Code,並透過瀏覽器遠端使用。本文記錄在 Ubuntu 上安裝 code-server 的步驟。
安裝腳本下載過程需要 curl。
apt update && apt install -y curl
透過官方安裝腳本安裝 code-server。
curl -fsSL https://code-server.dev/install.sh | sh
設為開機自動啟動並啟動目前使用者的 code-server 服務,再檢視狀態。
systemctl daemon-reload && systemctl enable --now code-server@$USER && systemctl start code-server@$USER && systemctl status code-server@$USER
首次啟動後,登入密碼會自動產生並寫入設定檔。
cat ~/.config/code-server/config.yaml
Deleting the wiki page "Service:VS Code" cannot be undone. Continue?