Skip to content

Instantly share code, notes, and snippets.

@Chocksy
Created December 29, 2022 09:13
Show Gist options
  • Save Chocksy/a4c19fa5e62ea8a3649bea8815348df6 to your computer and use it in GitHub Desktop.
Save Chocksy/a4c19fa5e62ea8a3649bea8815348df6 to your computer and use it in GitHub Desktop.
Synology DSM 7.0 systemctl service run at startup (code-server)

Synology NAS with DSM 7.0 that runs code-server at startup

I wanted to run code-server on my synology nas but without running it via docker as i wanted it to have access to the main terminal and all the files. This could be a security risk but you do have options to improve that.

Steps to install it are:

  1. ssh into your nas
  2. run curl -fsSL https://code-server.dev/install.sh | sh

Steps to create a systemctl service that will run at boot and keep code-server running.

  1. Go to cd /etc/systemd/system and create a service file
  2. Create a new file vim code-server.service
  3. Add the following code in (type i to insert):
[Unit]
Description=Run vscode at startup
[Service]
Type=simple
ExecStart=/root/.local/bin/code-server

[Install]
WantedBy=multi-user.target
  1. Exit vim (click ESC and type :wq)
  2. Then start the service systemctl start code-server.service
  3. Check that the service is running properly: systemctl status code-server.service
  4. Enable the service so it runs at boot: systemctl enable code-server

Now you can access vs code via your browser by going to nas-address/ip:8080.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment