A Remote Web Dev Setup I’m Finally Happy with

Written by ramontayag | Published 2019/04/11
Tech Story Tags:

TLDRvia the TL;DR App

As someone that makes software, I’ve always wanted to bring lighter gear with me, but doing so meant having to forgo power and storage space needed to some software development tasks.

Having the form-factor of a laptop tablet or a really small computer is the answer to giving your shoulders a break, but it’s also the answer to being less productive… unless you use a remote development machine do the heavy lifting.

What I’ve Tried

The road to this setup was long and winding. Although I tweaked this a setup a bit in ways not worth mentioning, the setup that mostly worked for me was Mosh, TMUX, and Vim — all on the remote machine. The problem with this setup was that Vim was completely in the terminal, and it made me want to pull my hair whenever I wanted to copy and paste something — I could never get copy-to-system-clipboard working correctly. And although mosh helps with slow connections, since all work is done on the machine, when your connection is slow you feel it.

Because of my gripes with Vim being completely in the remote machine, the only missing piece was to be able to use just any editor — gVim, MacVim, Microsoft VSCode, Sublime Text — and have any changes I make automatically sync to the remote server.

This is where Mutagen comes in.

Without need to install anything on the remote machine, mutagen allows you to quickly (read: I don’t even notice that my code is syncing to a remote machine) make changes to remote files. Now, I can use MacVim with system copy-and-paste working beatifully, or if remote pairing, Microsoft VS Code or tmate.

Setup Now

  • Remote machine. This can be one your favorite cloud hosting: Google Cloud, AWS, Digital Ocean, Linode.
  • Terminal has two tabs open: one for the remote machine and another for the local one

Left window is the remote machine, right is the local.

  • The connection to the remote machine is Mosh + TMUX
  • There’s one folder where all the code is. For me, this is `src`. That’s the only one I setup with Mutagen to sync with the remote machine. I had to tweak what Mutagen does not sync so that I don’t download cache files, log files, or any large files.
  • When I start up a development server on the remote machine, I fire up ngrok, so I visit my sites on a domain like `https://abc1828.ngrok.com`.

I like this setup because my battery lasts longer. I can use a cheaper and lighter machine, and I can still plug into a large monitor when I’m not on-the-go. I also don’t sweat it when I need to download and build Docker images even on a HSDPA connection on the beach.

There is just one thing I want to improve: to be able to shut down the remote machine automatically after not using it for 30 minutes. I haven’t found a simple solution.

Hardware

I’m cheating a bit. I type this on a Macbook Pro, powerful enough to do everything locally. However, I’ve been using a remote setup (and giving my SSD an extra 60GB of space because I’ve removed Docker) for about a month now. When the time is right, I will complete the transformation and transfer everything to a Microsoft Surface Go (I will install Linux on it), or a GPD MicroPC + a portable monitor, or even put everything on a phone with MaruOS and get a portable monitor.

My top three hardware candidates. Left to right: Microsoft Surface Go with Linux, GPD MicroPC, MaruOS on a phone.

As long as the machine can plug into a large monitor, has bluetooth, and can browse heavy sites without issues, it’s a candidate for this kind of setup.

I’d love to know how you customise this to work for you. Please leave comments below.


Published by HackerNoon on 2019/04/11