![Picture3 Coding on Raspberry Pi remotely with Visual Studio Code Picture3](https://besomi.com/wp-content/uploads/2024/02/Picture3.png)
Do you always find it hard to program and code on your Raspberry Pi? every time you need to connect it to a display, keyboard, and mouse every time? Well, here’s the solution! After this guide, you can use only your PC for everything. Just power up your Raspberry Pi, and let your PC handle it. We’ll be using something called SSH to make this happen. But what’s SSH?
1- SSH
SSH or Secure Shell is a network communication protocol that enables two computers to communicate.
And for our luck, Raspberry Pi OS has a built-in future which allows us
to enable SSH with simple steps.
2- Enable SSH in Raspberry Pi
First of all, we need to open “Terminal” if we are using “Raspberry Pi OS with desktop” or just start typing the commands if we are using “Raspberry Pi OS Lite”
Enter sudo raspi-config This command will show you all the available options. Now with the arrows select Interfacing Options, navigate to and select SSH, choose Yes, and select Ok.
![Picture4 Coding on Raspberry Pi remotely with Visual Studio Code Picture4](https://besomi.com/wp-content/uploads/2024/02/Picture4.png)
Now we have to set our Visual Studio code.
3- Install the Extensions on VS Code
Visual Studio Code offers a lot of extensions, and to install any extension we have to click on the extensions button and then search for “Remote – SSH” and it will show up, click install to install it.
![Picture5 Coding on Raspberry Pi remotely with Visual Studio Code Picture5](https://besomi.com/wp-content/uploads/2024/02/Picture5.png)
4- Add Raspberry Pi IP to SSH
Once you’ve successfully installed the extension, you’ll notice a new section dedicated to it. Go to this section and select the small ‘+’ button to incorporate a new host
![Picture6 Coding on Raspberry Pi remotely with Visual Studio Code Picture6](https://besomi.com/wp-content/uploads/2024/02/Picture6.png)
5- Enter the SSH credentials
You will be prompted to provide the SSH connection command. If your Raspberry Pi is running the Raspberry Pi OS, the username is typically ‘pi’. Also, you can type “raspberrypi” instead of your IP. Once you have input the connection command, as illustrated below, press Enter.
ssh pi@raspberrypi or ssh pi@192.168.1.16
![Picture7 Coding on Raspberry Pi remotely with Visual Studio Code Picture7](https://besomi.com/wp-content/uploads/2024/02/Picture7.png)
6- Select the configuration file
SSH keys need to be stored on your local file system, and VS Code will inquire about your preference for their location. I opted for the .ssh folder under my user directory, as depicted in the image.
![Picture8 Coding on Raspberry Pi remotely with Visual Studio Code Picture8](https://besomi.com/wp-content/uploads/2024/02/Picture8.png)
You will see a notification that says ‘Host added!’
7- Establish a connection with your Raspberry Pi.
You should be able to see your Raspberry Pi as listed under the ‘SSH’ on the left side. Click on the small folder icon to connect to your host.
![Picture10 Coding on Raspberry Pi remotely with Visual Studio Code Picture10](https://besomi.com/wp-content/uploads/2024/02/Picture10.png)
You’ll be prompted for the password; enter it and then press ‘Enter’.
![Picture11 Coding on Raspberry Pi remotely with Visual Studio Code Picture11](https://besomi.com/wp-content/uploads/2024/02/Picture11.png)
VS Code will ask you to select the OS of your Raspberry Pi, which is Linux, and then it will inform you that it is installing ‘VS Code Server’ on the Raspberry Pi, which is necessary for synchronization between the development environment and its file system.
![Picture12 Coding on Raspberry Pi remotely with Visual Studio Code Picture12](https://besomi.com/wp-content/uploads/2024/02/Picture12.png)
8- Navigate through your folders
Click ‘Open Folder’ to show all your folders, then choose one to start coding in
![Picture13 Coding on Raspberry Pi remotely with Visual Studio Code Picture13](https://besomi.com/wp-content/uploads/2024/02/Picture13.png)
![Picture14 Coding on Raspberry Pi remotely with Visual Studio Code Picture14](https://besomi.com/wp-content/uploads/2024/02/Picture14.png)
Great job! You’ve successfully learned how to remotely code on a Raspberry Pi using VS Code on your computer with the Remote – SSH extension.
9-Conclusion
Time is precious in software development, whether it’s a professional pursuit or a hobby. The repetitive task of synchronizing files between systems can significantly impact your productivity. This guide will assist you in establishing an efficient and productive workflow.