- In this guide you will learn to setup a raspi as dev-server powered by openSSH and VSCode
- You will need a working internet-connection for inital setup
- Insert your microSD-Card into the appropriat reader (fresh cards need to be formatted first so they are mountable for the OS, format them as fat32).
- Turn on your sound on your pc and turn volume up a bit. (important for later)
- Download Raspberry Pi Imager for Windows.
- Install the app and open it afterwards.
- Click the
CHOOSE OS-button and then click theRaspberry Pi OS (other)-button, selectRaspberry Pi OS Lite (64-bit)from shown list. (Raspberry Pi OS Lite is headless-linux without desktop-environment for server-like usecase i.e. development on Raspi via openSSH) - Click the
CHOOSE STORAGE-button and select your mounted microSD-Card from the list. - 🔴BEFORE FLASHING🔴 click the
COGWHEEL-button and configure the following settings:- 🔴you can scroll in the settings view🔴
- Check the box for
Set hostnameand leave the default-hostnameraspberrypi.localunchanged. - Check the box for
Enable SSHand leave the default config onUse password authentication. - Check the box for
Set username and passwordand configure your desired credentials. - If you want to use the Pi with WiFi, then check the box for
Configure wireless LANand enter your WiFi credentials. Otherwise leave it unchecked for use with Ethernet-Cable. - Check the box for
Set locale settings, selectEurope/Berlinfor time zone anddeas keyboard layout. - scroll down to the bottom and uncheck the
Enable telemetrybox, then check thePlay sound when finished-box and theEject media when finished-box - Click the
SAVE-button at the bottom and now you can click theWRITE-button to Flash this OS and config onto the microSD-Card
- After you heard a sound from the tool you are ready to eject the microSD-Card from your pc and its time to insert it into your raspis microSD-Card slot.
- Plugin the powersupply into the wall-socket and connect it to your raspis usb-c port. (The info-led should begin flashing after a bit)
- Leave the raspi booting and continue with setting up VSCode.
- Download VSCode from Microsofts Website
- Install Remote - SSH VSCode extension.
- Press
F1on your keyboard and search forRemote-SSH: Add New SSH Hostand hit enter. - Enter
ssh [email protected](configured previously in raspberrypi imager) and hit enter on your keyboard. - Then select the ssh-config file where you want to save this config to.
- Press
F1again and search forRemote-SSH: Connect to Hostand hit enter. - Select the configured host
raspberrypi.local. - Select
Linuxfrom the list as remote-host platform. - Enter the password for your user (configured previously in raspberrypi imager).
- Now your VSCode is connected to your rapsi via SSH. You can use the integrated terminal (ctrl+shift+ö) to interact with raspberry pi's shell and install software via apt.
- Here some links how to use apt on linux:
- https://ubuntu.com/server/docs/upgrade-introduction
- https://ubuntu.com/server/docs/package-management
Nice VSCode extensions for python development are: