-
下载code-server:
wget https://github.com/coder/code-server/releases/download/v4.5.1/code-server-4.5.1-linux-amd64.tar.gz
可以访问code-server GitHub 页面获取下载连接。
-
解压:
tar -zxvf code-server-4.5.1-linux-amd64.tar.gz
-
将解压后的文件移动到
/opt
目录下,并重命名:mv code-server-4.5.1-linux-amd64 /opt/code-server
-
创建软链到
/usr/bin
目录下:ln -s /opt/code-server/code-server /usr/bin/code-server
-
修改配置文件
~/.config/code-server/config.yaml
:vim ~/.config/code-server/config.yaml
-
添加code-server服务:
vim /lib/systemd/system/codeweb.service
写入如下内容:
[Unit] Description=The nginx HTTP and reverse proxy server After=network.target remote-fs.target nss-lookup.target [Service] Type=simple ExecStart=/usr/bin/code-server KillSignal=SIGQUIT TimeoutStopSec=5 KillMode=process PrivateTmp=true StandardOutput=syslog StandardError=inherit [Install] WantedBy=multi-user.target
评论