4 ways Code-Server changed my workflow by allowing me to use VS Code anywhere

5 days ago 1

I’ve spent the last couple of months testing self-hosted apps. During this journey, I’ve encountered everything from must-have utilities that improved my quality of life to weird tools that are fairly useful despite their quirkiness. Code-Server falls in the first category, and it’s essentially a self-hosted VS Code instance that’s designed to run inside a browser.

As someone who uses VS Code to edit Python code, YAML configs, Ansible playbooks, and Dendron-based notes, here are some reasons why I consider Code-Server an essential part of my computing setup.

Running Code-Server

Related

4 I can leverage a powerful, centralized server

And pair it with unsupported devices

Unlike its IDE sibling, Visual Studio Code is a fairly lightweight application that works well on underpowered systems, like the Raspberry Pi series. However, VS Code still isn’t available on smartphones and tablets – and no, emulating it via Winlator or Mobox doesn’t count, either. With all the firepower packed into the newer iPads, it’s a real shame I couldn’t use them to edit my code files.

Thankfully, I can host a Code-Server instance on my beloved dual Xeon workstation and access it from any machine over my local network, including devices that aren’t technically compatible with VS Code. This may be extremely niche, but I often tinker with RISC-V machines, and Code-Server is great for editing my project files on systems powered by this new ISA.

3 No more file clutter on local systems

I won’t have to choke my SBC’s microSD card with project files

Some Ansible files and the command to execute a Playbook

Being able to organize code files is an invaluable skill for programmers. But with all the configuration files, notes, and code documents I end up creating for my projects, arranging all the files becomes a pain, especially when I need to switch devices. Without Code-Server, I’d end up storing multiple files across the different paraphernalia in my home lab. For devices like my Single-Board Computers, this can be a real problem, as my project files can end up occupying quite a bit of storage space.

Meanwhile, running Code-Server on a workstation ensures that my client devices won’t get filled with random programming documents and failed projects. Better yet, since everything runs on a centralized server, I only have to organize my code files on a single machine, instead of doing so on multiple devices.

2 I won’t have to worry about losing my work

Thanks to a high-availability setup and daily NAS backups

A Proxmox cluster consisting of two nodes

Messing with config files is an essential part of computing projects, but considering the experimental nature of DIY ideas, things can go south pretty often. For example, modifying the wrong config file or toggling a setting I wasn’t supposed to could result in my guinea pig of a device (especially SBCs in this case) becoming inaccessible and reducing hours of coding work to nothing.

But since I store everything on Code-Server, I don’t have to worry about losing my code documents on the client device. Of course, my server is far from infallible, but that’s where my high-availability setup comes into play. Even if my primary workstations were to render my primary server offline, my secondary mini-PCs ensure that the Code-Server instance stays operational. Pair that with daily NAS backups for the virtual machine running Code-Server, and I can rest easy knowing my painfully crafted programming files will remain safe and sound.

1 Switching between devices is no longer an issue

I have the same coding environment regardless of the system

Running Code-Server on a PC

Since I review tech for a living, I often end up working on numerous devices at once. Heck, even after graduating from college, I still use my MacBook for everyday tasks, Linux-based servers for DIY projects, and a Windows setup for gaming, Visual Studio projects, and other miscellaneous tasks. Self-hosting a Code-Server lets me use the same setup across my arsenal of systems, and I don’t have to install the same set of extensions every time I pick up a new device.

Better yet, I can easily swap my devices and continue my work from where I left off. Sure, I could accomplish that with the Remote Development extension set on the official VS Code, but I’d have to go the whole hog and configure the extension on the client devices as well as my server, as opposed to just accessing my Code-Server instance from a web browser.

Still, it has one major weakness

Downloading some extensions in Code Server

Although I’ve fully migrated to Code-Server, it has one major issue that needs to be addressed. Unlike the core functionalities of VS Code, the Extensions Marketplace isn’t open-source. As such, Code-Server relies on the Open-VSX Extension Gallery. While it includes most of my favorite extensions, some notable options like Live Server, GitHub Copilot, and Remote Development toolkit remain inaccessible.

But if you’re willing to overlook this issue, you’ll find Code-Server an amazing addition to your self-hosted arsenal, especially if you’re a part of the coding faction.

A render showing the Visual Studio Code logo with a bunch of Windows in the background.

Related

Read Entire Article