code-server allows you to run VS Code on any machine, anywhere (typically hosted on remote servers), and access it through a web browser (client-side).
I will install it on my Beelink SER8 machine (running Omarchy). While I could connect to the Beelink system via SSH using VS Code, I wanted to have a direct browser-based option for writing and running code on any mobile device, including my iPad.
Installation
- The easiest way to install
code-serveris to use theΒ install script.
curl -fsSL https://code-server.dev/install.sh | sh- To have Systemd, start code-server now and restart on boot:
sudo systemctl enable --now code-server@$USER- Visit http://127.0.0.1:8080 (might have to forward this port over SSH if installing on remote server).
- Your default password is in
~/.config/code-server/config.yaml.
Configuration
Specific Port
- Default port is
8080but we can change it to something different by editing config file:
nvim ~/.config/code-server/config.yaml- Just update
bind-addrto a different port (e.g.9090):
bind-addr: 127.0.0.1:9090- Since we are using Systemd, restart the service:
sudo systemctl restart code-server@$USER- Now, it can be accessed on http://127.0.0.1:9090.
LAN Access (β οΈ Insecure)
- Instead of
127.0.0.1, update the following in the config filenvim ~/.config/code-server/config.yaml:
bind-addr: 0.0.0.0:9090- Restart the service:
sudo systemctl restart code-server@$USER- It can now be accessed on
http://<beelink-ip>:9090. - If still not reachable, then the port is blocked by the machine firewall. Open the port on the remote machine:
sudo ufw allow 9090/tcp
sudo ufw status- Try to access it again on
http://<beelink-ip>:9090.
Update Password (β οΈ Insecure)
- Update the
passwordkey value in the config filenvim ~/.config/code-server/config.yaml:
password: <your_desired_password>- Restart the service:
sudo systemctl restart code-server@$USER