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:
- ssh into your nas
- 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.
- Go to
cd /etc/systemd/system
and create a service file - Create a new file
vim code-server.service
- 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
- Exit vim (click
ESC
and type:wq
) - Then start the service
systemctl start code-server.service
- Check that the service is running properly:
systemctl status code-server.service
- 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
.