Does your personal laptop struggle to keep up with your development needs? Maybe your company is looking for alternatives to continually needing to upgrade their developers’ laptops. Maybe a team of developers would benefit from a powerful remote server versus personal computers?
Today, remote development is even more streamlined than ever with the help of products like Visual Studio’s Remote – SSH extension or with Jetbrains Remote Development. In this blog post, I will give a brief overview of Visual Studio’s Remote – SSH extension and share a mini how-to on using it.
Visual Studio Code Remote – SSH Overview
The Visual Studio Code Remote – SSH extension allows you to open a remote folder via SSH while still being able to code locally like normal. As long as an SSH server is running remotely on your remote machine, you can use a remote machine, a virtual machine in the cloud, or a remote container.
The source code and heavy lifting are 100% remotely executed. While this extension may not fit all use cases, I would strongly encourage anyone to try it out. It’s helpful and relatively easy to use! However, as with any product, there can be some pain points. For example, opening a remote container within Visual Studio over SSH is possible, but it may take some trial and error to get it working properly.
Overall, I have had a very positive experience with the Remote – SSH extension, and I think it can be of benefit to almost anyone. In conjunction with a home server, I use this extension whenever possible to remove the heavy lifting from my laptop battery and CPU.
Now that we’ve covered what the Visual Studio Code Remote – SSH extension does, let’s dive into how to get it set up on your machine. This section will be a mini tutorial on how to get started.
Before we dive in, here are some requirements. Make sure you have these installed before moving on to the next step.
- Visual Studio Code
- SSH Client
- SSH Server
- Debian 8+
- Ubuntu 16.04+
- Windows 10+
- MacOS 10.14
Without further ado, let’s dive into setting up Visual Studio Code Remote – SSH!
- Install an SSH server if needed.
- I recommend setting up key-based authentication per user instead of using passwords.
Connect to Remote:
1. First, in a terminal, test that SSH to the remote server is working properly.
2. Next, navigate to the command palette in VS Code (Control + Shift + P). Select Remote-SSH: Connect to Host. Enter your remote server SSH host.
3. The bottom left corner of VS Code displays the current status. Here is what it looks like if you are connected.
4. Now, you can open any folder on the remote machine just like you would locally. File > Open Folder > Your Project Folder.
5. Within the VS Code terminal, run any commands just like it is a local project. Ports should be automatically forwarded. Here is the example project I used for these screenshots.
6. If needed, a port can be manually forwarded.
7. Everything is now up and running and all without any laptop fans spinning up.
Hopefully, this brief overview generates enough interest and gives you enough information to check out this VS Code feature on your own. If you’re not a VS Code fan, there are other options out there with similar benefits that I would encourage you to look into!
Remote SSH development is not a one size fits all, but it is a powerful tool for both teams and individuals. Depending on your requirements, I think it can benefit almost any project.
Thank you for taking the time to read this post! If you have comments, or if you use a different tool for remote SSH development, drop a comment below. And if you enjoyed this post, check out the many others on the Keyhole Dev Blog.