Hugo Future Imperfect Slim

Tracey Jaquith · PoohBot Pictures

Technophile · Optimist · Cyclist · Archivist · Design · Video · TV · Kubernetes · Docker

2 minutes read

Add VSCode (and its builtin terminal) to your mobile devices! Edit your code and projects from a browser, backed by a modest virtual machine that hosts your code files and directories.

Inspirations:

Prerequisites

  • A VM/server with 1GB+ RAM, 2 cores+. ($10/month digital ocean ubuntu VM is fine for this).

Setup code-server

Setup code-server on a VM of your choice.

wget -qO- https://raw.githubusercontent.com/cdr/code-server/main/install.sh | bash -ex

( you could switch the ~/.config/code-server/config.yaml file bind-addr to 0.0.0.0:8080, and then access it over http://[IP ADDRESS]:8080/ )

However! I’d strongly recommend https://, done in minutes (below), if you own a domain and can add an A record with something like code.DOMAIN pointing to your IP ADDRESS.

Don’t have a domain name?

Get one free at Freenom :)

Setup https access

Install caddy (go-based) with built-in lets encrypt and more.

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/cfg/gpg/gpg.155B6D79CA56EA34.key' |sudo apt-key add -
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/cfg/setup/config.deb.txt?distro=debian&version=any-version' |sudo tee -a /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

edit /etc/caddy/Caddyfile

change this config line from :80 to your DNS name, and uncomment the reverse_proxy line:

# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace the line below with your
# domain name.
code.DOMAIN

# Another common task is to set up a reverse proxy:
reverse_proxy localhost:8080

reload caddy

sudo systemctl reload caddy

Start browsing!

https://[code.DOMAIN]

enter password from your VM’s server file: ~/.config/code-server/config.yaml

Other

You can restart your code-server at any time, if needed for some reason, via:

sudo systemctl restart code-server@$USER

Say something

Comments

Nothing yet.

Recent posts

See more

Categories

Tags

#spottheshuttle 1940s 1st-person 3d accident aids-lifecycle airplane animals appeltart apple-pie apple-watch architecture arkit art ascii-art asia augmented-reality baking bali bay-area biking birthday cafe-racer camaro camera-video cars cat-pee cat-psychology cats coding college colorspaces computer-vision cornell crictl css dark-mode decaf deinterlace desert design diy docker documentary ducting emacs endeavour family ffmpeg food games geek gitlab golden-gate-bridge google-cardboard green-magic-man h.264 hack highway-1 home https hugo hyperlapse internet-archive ios iphone javascript k3s kubernetes landscapes linux lisp luke-battling-darth mac macosx mashup metal montclair motion-jpeg motorcycle mplayer nasa new-bay-bridge news ninja oakland partioning php php-htm-mode politics protest rancher recording remaster remix remodel shuttle small-town star-wars swift technical time-lapse time-machine timing-belt-adjustment top-end-rebuild tracey traefik training-ride vacation valve-job video virtual-reality vlog vscode weekend-mechanic work x264 xcode yuvj420p zx6

About

tracey is a nonstop dance party. so you dont have to. dont ask me about k8s. thanks for dropping by today. you look nice.