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