Now you can run a code-server as a service.

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

Now you should be able to take you safe development environment on your iPad or on your grandma slow computer,without being afraid that the server will stop.