As I mentioned in my last article, I said that code-server lacks a service to run it in the background or at startup. I build a systemd service to solve this issue.
If you want to have the code-server running n the background just follow this steps:
- Create the systemd service with this command
sudo nano /etc/systemd/system/code-server.service
- Paste the code below.
[Unit]
Description=Code-Server Service
After=network.target
[Service]
Type=simple
Restart=always
User= yourUser
ExecStart=/usr/local/bin/code-server
[Install]
WantedBy=multi-user.target
- Start the service
sudo service code-server start
- Check the status
sudo service code-server status
- Optional enable the process at startup
sudo systemctl enable code-server
Top comments (0)