Using VSCode for Remote Coding

Using VSCode for Remote Coding

Daily short news for you
  • That's terrifying, grep.app is a website that allows you to search for anything in the public repositories of Github. Just type in a few characters and it will instantly find where that snippet is located. I wonder how much data one has to store to be sufficient 🤔!

    » Read more
  • Good news for those who missed the 5-day online course with Google GenAI last time. Now you can learn by reading and practicing the content. Join us now 🥳

    5-Day Gen AI Intensive Course with Google Learn Guide

    » Read more
  • Everyone check out if the free ChatGPT account has been given access to DALL·E yet. Today I logged in and saw this icon and was able to use OpenAI's image creation tool. However, I only tried creating 3 images and now I have to wait until tomorrow. It seems there's a limit of 3 images per day 😅

    » Read more

The Issue

There are times when you need to edit files directly on a server to participate in debugging or development. This process typically involves SSHing into the server, navigating to the project directory, using command-line editors like nano or vim to open files, and making edits. If you're a Vim enthusiast, you can turn it into a powerful text editor, but for others, Vim might be challenging to use.

In VSCode, there is an extension called Remote - Tunnels that allows you to directly open a project on a server while still utilizing all the features of VSCode. This means you can have syntax highlighting, code highlighting, and most of the extensions installed in your code editor. In today's article, let me guide you through the process.

Setup Steps

First, install the Remote - Remote - Tunnels.

Then click on the Remote button with two arrows in the lower-left corner of the screen.

Bước 1

Choose "Connect to Host" and then select "Add new SSH host" if you haven't added any configurations before.

Bước 2

An input box appears, requesting information to SSH into the server. For example, I log in as [email protected]:

Bước 3

Here, since I have set up SSH using an SSH key, VSCode automatically uses the key in my machine. If you don't have a key or log in with a password, you'll need to enter the password each time you "Connect to Host."

After entering the information, a new window will open to notify you that you have successfully connected to the server. Click on the "Open Folder" button to browse to your project folder, and then click "OK" to start writing code.

Buoc 4

In my opinion, besides coding, this method allows you to manage the files and folders created by the project during runtime. Additionally, you can commit directly from here, but be cautious as it may lead to unintended issues.

Premium
Hello

Me & the desire to "play with words"

Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

View all

Subscribe to receive new article notifications

or
* The summary newsletter is sent every 1-2 weeks, cancel anytime.
Author

Hello, my name is Hoai - a developer who tells stories through writing ✍️ and creating products 🚀. With many years of programming experience, I have contributed to various products that bring value to users at my workplace as well as to myself. My hobbies include reading, writing, and researching... I created this blog with the mission of delivering quality articles to the readers of 2coffee.dev.Follow me through these channels LinkedIn, Facebook, Instagram, Telegram.

Did you find this article helpful?
NoYes

Comments (0)

Leave a comment...