Ubuntu 使用下面代码安装:
curl -fsSL https://code-server.dev/install.sh | sh
配置守护进程
vim /usr/lib/systemd/system/code-server.service
输入以下配置
[Unit]
Description=code-server
After=network.target
[Service]
Type=exec
Environment=HOME=/root
ExecStart=/usr/bin/code-server
Restart=always
然后就可以通过以下命令来启动和关闭code-server服务了
start code-server
systemctl start code-server
stop code-server
systemctl stop code-server
code-server status
systemctl status code-server
开启SSL:
vim /root/.config/code-server/config.yaml
cert: /xxxx.crt
cert-key: /xxx.key