Headless Raspberry Pi

Step 1. Download a lite Raspbian image

Download the version you need. As we want to install a headless version download the Raspian XXXXX Lite version.

Step 2. Copy the image

From a Linux terminal use the following command to find your SD Card:

sudo fdisk -l

This will show you something like

Disk /dev/sdc 14.86 Gib ......

Ensure you select here the correct disk.

Afterwards copy the image with the following comand. Replace /dev/sdX by the correct path.

sudo dd bs=4M if=2019-07-10-raspbian-buster.img of=/dev/sdX conv=fsync

Step 3. Enable ssh

To activate ssh at the first start you just have to create a file ssh in the boot folder.

touch /run/media/your_username/boot/ssh

The path above might be different on your system.

Step 4. Add network info

Create a file in /run/media/your_username/boot/ called: wpa_supplicant.conf.

sudo nano /run/media/your_username/boot/wpa_supplicant.conf

Then paste the following into it (replace your country code, SSID and Password):

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev 
{ ssid="network SSID" 
  psk="network password" 

Step 5. Find your Raspberry Pi in your network

One solution is to login to your router.

In case you do not have access to your router you can scan your ip range with nmap. Use the following command and search for your Raspberry Pi:

sudo nmap -sP

Adjust to your ip range. In many cases it is or

Step 6. Login to your Raspberry Pi

Use the following command to login:

ssh pi@

Password by default: raspberry


ip route for wifi

In case you want to route the traffic of your linux machine of a specific IP through a specific interface ip routecommand should be used.

One example below asuming wlp2s0 is your wifi.

sudo ip route add via dev wlp2s0

This will lead all the traffic with target ip range trough the interface of your wifi (assuming is the wifi router).

I did not yet found a solution to route the traffic of a target “domain” through a specific interface. Happy for any input.