March 9, 2023

LET'S START WITH A FEW QUESTIONS

Have you ever spent long hours configuring your development environment, and then you change something on your computer and now your project won’t build?


Have you ever been constrained to a specific OS that is not quite to your liking?

Would you like to be able to work on something more lightweight than your loud and hot laptop while you are not at your home office?

If the answer to any of the above is yes, scroll into the journey through Remote development and let’s see if we can improve your experience.

1. SETTING UP REMOTE DEVELOPMENT

We first need to decide how to do it. There are various network file system protocols (NFS, CIFS/SMB) which we can use to “mount” the remote directory as if it was a local one.

Also we need SSH access to be able to actually run our code on the remote machine. Oh, and also we would need to allow the running application through a firewall so we can actually test it. And also we might want to tweak how we send data to improve performance.

If any of this sounds like a tedious process, that’s  because it is. Luckily, two of our favorite IDE vendors ship this out of the box.

2. VS Code Remote Tunnels


VS Code has an extension called Remote Tunnels which enables remote access to remote VS Code instances.

Prerequisites:
  • VS Code / VS Code for the Web on the client
  • VS Code / VS Code tunnel / SSH access on the server
  • Microsoft / Github Account

The remote explorer can be accessed by either logging into VS Code on a server machine with a Microsoft or a GitHub account or via SSH.

Everything you need to know about remote development

It also allows us to run commands via built in terminal, just like we would do locally and then allows us to expose a port via a tunnel:

Everything you need to know about remote development

So we can access it via the provided URL.

It will also download all locally installed extensions, so stuff like linters, formatters can run on the server, improving performance by reducing the number of round trips.

And yes, all of this also works with Visual Studio Code for the Web!

 

Note: Microsoft’s Remote Tunnels extension is proprietary, so you won’t be able to use it with the open source version of VS Code.

3. Jetbrains Gateway

JetBrains’ solution works via JetBrains Gateway which acts as a bridge between local IDE and server machine. It manages the connection and dependencies that are necessary for it to work.

Prerequisites:
  • JetBrains IDE on client machine
  • JetBrains IDE / SSH access on server machine
  • JetBrains account / subscription

or their IDE of choice, SSH access to the remote machine.

Everything you need to know about remote development

After a successful connection, JetBrains Gateway will download everything it needs to the server machine, and start our IDE of choice. Everything runs on the server, including Intellisense server, our IDE is just displaying the remote state. This is great because it improves performance and we are getting the true state from where the code is located.

 

We can run tasks using the integrated terminal, just like natively and if our build is successful it will also provide us with an URL which we can visit in our browser to test the application.

 

Note: at this time, JetBrains Gateway only supports Linux hosts as a server machine, but it can be run on Windows via WSL.

4. Cloud

Both of the solutions also support cloud providers like GitHub Codespaces or Gitpod, so we don’t even need to manage a server machine.

Another option is to use our own VPS servers, if we consume a lot of processing power or need a more flat rate pricing.

Taking it a step further would be containerizing the entire dev environment and hosting that somewhere, moving to a cleaner, more atomic and easy to setup environment. But that a whole another topic for itself.

 

Possibilities are endless, but the main takeaway is that these extensions essentially decouple us from our hardware, enabling us to have a running development environment at all times regardless of our workstation setup. Develop on Mac, Windows, Linux, ChromeOS, Android, iOS… Even a smart watch.

Everything You Need to Know about Remote Development

For more exciting updates regarding AI and everything tech follow us on LinkedIN, Instagram and Facebook!

Author: Nikola Malinović

More great projects we done