How to Connect Visual Studio Code (VSCode) with AWS Lightsail using Remote SSH

WorldGoIT
4 min readAug 12, 2023

--

How to Connect Visual Studio Code (VSCode) with AWS Lightsail using Remote SSH

In this article, we will explore how to connect Visual Studio Code (VSCode) with AWS Lightsail using Remote SSH. AWS Lightsail is a simple and cost-effective way to launch and manage virtual private servers in the cloud, while VSCode is a popular and versatile code editor. By combining the power of both, developers can enhance their productivity and collaborate seamlessly on AWS Lightsail instances. Let’s dive into the step-by-step process of setting up this connection.

Ready

filezila

HOST : You can find the host address in AWS Lightsail, and make sure to set a static IP.

Key File : You can download the key file from AWS Lightsail.

How?

1. Remote — Download SSH Extension from VScode

Remote — When you download SSH, Remote Explorer is activated on the left.

remote ssh

2. Specify emails and folders in Remote Explorer

For remote configuration, specify the folder to install e-mail and settings. Any email can be set, and the folder can be added by default, ` C:/User/…(username)/.ssh/config`. Let’s set the folder and open the folder with Vscode.

3. Config file settings

If you open the above folder (…/.ssh/config), the config file is set. Enter values ​​for HostName, User, and IdentityFile in the configuration file as shown below .

Host xxxx.com

HostName 18.XXX.XX.XX — AWS Lightsail 고정 IP

User bitnami — (AWS Lightsail default username)

IdentityFile C:UsersXXDocumentsGitHubXXXLightsailDefaultKey-eu-central-1.pem — Location where the Security Key obtained from AWS Lightsail is stored

config

4. Remote folder connection

If you click Remote Explorer on the left again, SSH is successfully connected. Click the connected SSH Host to open the relevant SSH. At this time, specify a folder. In my case, I found the folder location where Wordpress was installed and opened Wordpress.

wordpress folder

5. Done

In my case, by opening the folder where Wordpress is located, I can open Wordpress in Vscode through SSH connection. Because of this, it has the advantage of being able to easily find code or find files instead of the existing Filezilla.

remote ssh

Conclusion

By connecting Visual Studio Code using AWS Lightsail and remote SSH, developers have the opportunity to efficiently code, collaborate, and deploy applications. Combining the simplicity of AWS Lightsail with the powerful editing capabilities of VSCode increases productivity and streamlines the development process. Its easy setup and user-friendly interface make it accessible to developers of all levels.

Connect your favorite code editor, Visual Studio Code, with AWS Lightsail to get all the benefits of remote development. Take advantage of cloud-based infrastructure, secure connectivity and collaboration capabilities to further enhance your development workflow.

Frequently Asked Questions

- Can I connect to multiple AWS Lightsail instances simultaneously using VSCode remote SSH?
- Yes, you can connect to multiple AWS Lightsail instances simultaneously. Each instance has its own VSCode window.

- In addition to AWS Lightsail, is the VSCode remote SSH extension available on other cloud platforms?
- Yes, you can use the VSCode remote SSH extension on other cloud platforms that support AWS Lightsail.

- Is the Remote SSH extension available in the free version of Visual Studio Code?
- Yes, the Remote SSH extension is available in both the free and paid versions of Visual Studio Code.

- Are there any additional charges for connecting to AWS Lightsail via remote SSH?
- No, there is an additional charge for connecting to your AWS Lightsail instance via remote SSH.

--

--

No responses yet