Code Server - zbrewer/homelab GitHub Wiki

Code Server is a way to run VS Code on a remote machine and to access it via the browser. This allows me to use the same development environment from any machine, without installing anything locally. It also allows me to use the same (Linux) development environment no matter what machine I'm actively using (such as a Windows computer). Finally, this means that I only have to install build and other tools once and not on each machine I'm using for development.

Installation

Code-Server can be installed in an Ubuntu Server container on Proxmox using the install script listed in the Code-Server docs. The script prints instructions for starting Code-Server and running it as a systemd service on startup. The installation should be run as the user you would eventually like to use code-server as (not as root). Note that the user's shell might have to be changed from /bin/sh to /bin/bash.

After install, the password for code-server can be found in ~/.config/code-server/config.yaml. The bind address should also be set to 0.0.0.0:8080 so that the interface is accessible remotely, and not just via localhost. The contents of the file should be:

bind-addr: 0.0.0.0:8080
auth: password
password: <password>
cert: false

Spell Check

Spell check can be installed into Code-Server by clicking on the hamburger menu (3 lines) in the top left and then File > Preferences > Extensions. Search for Code Spell Checker and install.

LaTeX

The LaTeX Workshop extension can be installed, in a similar manner to the Spell Check extension, to provide tools for working with LaTeX documents. These include automatic previews, jumping between the source and preview, autocomplete, and more. Usage of this extension requires the installation of LaTeX on the Code-Server host. On Ubuntu (and Debian based distros) this can be done with sudo apt install texlive-full.

Hide Files

These can be hidden in the UI by clicking on the hamburger menu (3 lines) in the top left and then File > Preferences > Settings. Search for Files:Exclude and add patterns. Examples include:

**/.*
**/gems

Update

Update by re-running the install script as the user (not root):

$ curl -fsSL https://code-server.dev/install.sh | sh

Then reboot the container or restart the service.

⚠️ **GitHub.com Fallback** ⚠️