netstat -plntu systemctl status code-serverĪnd the code-server service is up and running on default port ‘8080’.Īs a result, you’ve set up the code-server to run as a system service. systemctl start code-server systemctl enable code-server systemctl daemon-reloadĪfter that, start the code-server service and add it to the system boot using the following command. User=code WorkingDirectory=/home/code Environment=PASSWORD=hakasevscodeserv ExecStart=/home/code/bin/code-server -host 127.0.0.1 -user-data-dir /home/code/data -auth password Restart=always cd /etc/systemd/system/ vim rviceĬhange the ‘Environment’ option for a password with your own and paste the configuration into it. Go to the ‘/etc/systemd/system’ directory and create a new service file ‘rvice’ using vim editor. The code-server service will run under the user ‘code’, with default port ‘8080’ and enabled password authentication. In this step, we will set up the code-server to run as a system service. Step 2 – Setup Code-Server as a Systemd Service Now you’ve created a new user ‘code’ and downloaded the code-server binary to the home directory of user ‘code’. chmod +x ~/bin/code-serverĪnd create a new data directory for storing the user data. Now make the code-server as an executable binary file. su - code wget Įxtract the code-server and rename the directory as ‘bin’. Now log in as ‘code’ user and download the code-server binary file. Step 1 – Add User and Download Code-Server Binaryįirst, we will add a new user and download the code-server binary file from GitHub.Īdd a new user ‘code’ using the command below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |