[Answered] How to install Debian on Raspi 4 2GB Headless - For email server

promitheas@iusearchlinux.fyi to Selfhosted@lemmy.world – 7 points –

Hey guys, I would like to install Debian on my raspberry pi 4 model B 2gb, but I dont have a micro HDMI. I would like to install it headless. I watched a video where the guy created some files in the boot partition on the SD card to enable SSH, and I was wondering if I can do something similar with a Debian SD so I dont need to go out and buy a cable.

I couldn't find too many tutorials for Debian on the pi, and none to install it headless.

Thanks in advance!

Edit 1: I ended up going with raspbian lite because of some other issues that came up.

16

You are viewing a single comment

In case of Raspbian, you can create a wpa_supplicant.conf in the boot partition with:

network={
    ssid="testing"
    psk="testingPassword"
} 

and a empty ssh file.

For the user config, since bullseye you need to make an account on first boot, that can be done with a userconf file, but it's a bit more involved. You can see how to do it at the end of This blog post

Im planning on putting debian on it, so I think its slightly different because e.g. theres no raspberry pi user

Why not use Raspberry Pi OS? It's based off of Debian.

If you're planning on using plain Debian and the challenges that come with it, you probably should start with one of the pre-built images from the Debian foundation. You can mount the root partition with either a running linux box or WSL2. Then you can chroot into it to setup the wpa_supplicant.conf in the /etc/ folder and ensble sshd.

Thats something like what I'll be trying. I am on a linux laptop so I can do all that.