Visual Studio Code in the Browser
I reached the end of my dev rope trying to get my Windows 11 development environment working. I recently switched from poetry to UV for managing my Python3 environments and Windows is fighting me the entire way.
I realized that if AWS can have a cloud code option for editing code on the fly, then there has to be a Docker container out there for it.
I've used several of linuxserver's docker images in the past and they have always been incredibly well documented and easy to run. I basically took their default docker compose stack and just commented out specific things that I didn't need. I did change the default password though, don't worry.
services:
code-server:
image: lscr.io/linuxserver/code-server:latest
container_name: vscode_server
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- PASSWORD=changeme #optional
- SUDO_PASSWORD=changeme #optional
# - PROXY_DOMAIN=code-server.my.domain #optional
- DEFAULT_WORKSPACE=/config/workspace #optional
- PWA_APPNAME=code-server #optional
volumes:
- $PWD/config:/config
ports:
- 8443:8443
restart: unless-stopped
I setup my instance to be LAN-accessible only, so no reverse proxies required. Now I can have a single workspace that's configured the way I like it across all my devices. I can code from my PC, Steam Deck, or one of the junk laptops I have laying around.
Caveats
One thing I noticed is that not all of my preferred extensions were available to me. For instance, Pylance wasn't available. Apparently that's because Pylance is only available on Microsoft-signed instances of Visual Studio Code. That wasn't that big of a deal though, I just installed Pyright instead.
Getting things setup for me was super easy too. I installed pipx which allowed me to install uv globally for all of my projects. I can even spin up FastAPI instances from the container without having to map ports in the docker-compose file too.
I'm already super impressed with how it's working. There is a slight keyboard shortcut learning curve though as doing control + w doesn't just close your window in VS Code, but the entire VSCode instance you're actively using. But I'll take that over the pain of trying to get Windows to cooperate.