Want to set up a Raspberry Pi without plugging in a monitor? This headless setup guide is for you! Follow along as we download the Raspberry Pi OS, flash it to an SD card, enable SSH, set a static IP, and connect remotely—all in minutes. Ideal for servers, experiments, or anyone who hates extra cables. No desktop needed, just a Pi, SD card, and Ethernet. Check out my other videos for SSH key setup and Linux tips. Subscribe and join the community for more Raspberry Pi projects!
RaspberryPi #HeadlessSetup #PiProjects #TechTutorials #Linux #SSH #DIYTech #RaspberryPiOS #RemoteAccess #TechForBeginners #PiServer #Electronics #MakerCommunity #RaspberryPi4 #RaspberryPi5
Introduction to Headless Setup 00:00:00
Why Headless Setup 00:00:06
Equipment Needed 00:00:28
Downloading Raspberry Pi OS 00:01:24
Choosing the OS Version 00:02:05
Unzipping the Image File 00:03:52
Writing Image to SD Card 00:04:12
Handling Auto-Mount Issues 00:05:02
Checking Disks with Parted 00:05:36
Unmounting SD Card 00:06:49
Using DD Command 00:08:02
Enabling SSH on Boot 00:12:07
Setting Static IP Address 00:12:33
Configuring SSH Keys 00:14:54
Setting File Permissions 00:16:36
Unmounting and Final Setup 00:18:55
Connecting to Pi via SSH 00:20:04
Verifying Connection 00:21:23
Conclusion and Next Steps 00:22:04
Call to Subscribe 00:22:52
Thanks for watching!
Find us on other social media here:
- https://www.NeuralLantern.com/social
Please help support us!
- Subscribing + Sharing on Social Media
- Leaving a comment or suggestion
- Subscribing to our Blog
- Watching the main “pinned” video of this channel for offers and extras
Hey there! Let’s talk about how to install your Raspberry Pi from scratch and get to first boot
and first login without actually having to plug in a monitor at all. This is a pure headless
setup because for me personally, I hate walking over to like a TV or a monitor or something
and plugging the Pi in or getting my portable monitor out. It’s just a pain in the butt.
card, get it all installed, and then connect to it and configure it right away. Of course this video
assumes that you’re not going to use your Pi with a desktop or a monitor at all because if you are
you might as well just start doing that. But for me you know a lot of my Pi’s are just headless
they’re servers or they’re fun experiments or whatever. So the first thing that we should do
obviously you need an SD card and you need an SD card reader so if you’re on this video you
card and an SD card reader. This is like a super old reader where you can stick a card in there.
I got a slightly newer one plugged into the computer right now and if you bought an SD card
or a micro SD card with the Pi you probably had a little adapter that came with it, a regular SD
card adapter. So you can stick the tiny little card into the adapter but if you’re lucky and
your card reader has a slot for micro SD you probably just need that. So the first thing that
is go over to raspberrypi.com their foundation has a common org i think org is more for the
community but go to raspberrypi.com and then click on software and download the raspberry
pi operating system so i’m going to do this the manual way i’m just going to write an image if
you want to do this with an imager or if you have like something else that you already know how to
do that’s totally fine go ahead and do it i really just want you to put the operating system onto
because I’ll be posting about how to do this with Windows and other stuff.
I guess you don’t need that if you’re going to use the imager,
but it’s more fun to do it manually.
All right, so notice how it says manually install an operating system.
I’m going to click on the download options.
Select the operating system so modern Pis can use the 64-bit OS.
That’s what I’m going to do.
If you have, I think, like a Pi 1 or 2,
you might be stuck using the legacy, like the 32-bit.
like the 32-bit what’s the difference between those two 32-bit oh don’t do legacy I think that’s
like really old I don’t know maybe it depends on how old your Pi is but just hover the mouse and
notice how one of them says 32-bit that’s what you would use if you’re if your board is not 32 but
as far as I understand I mean definitely the Pi 4 and the Pi 5 for me they worked with 64 bits
I think my Pi 3 worked with 64 bits although I’m not 100 sure everything was okay after install
was okay after install so just basically click on that then it’ll ask you all right what what
version of the 64-bit do you want to download uh if you’re going to be installing a desktop you
don’t really need this video so i’m just going to assume you don’t need a desktop you want this to
be totally headless so that means the desktop is too much it’s too much to download it’s kind of a
waste same thing for desktop with recommended software instead i’m going to click on the light
version because that’s the fastest to download and it’s all we need so i’m going to click on that and
So I’m gonna click on that and it’ll download.
And you could probably pause the video right now
because I already downloaded this.
So pause the video and then wait for your download to finish
and then come back with me.
This is where I chose to save my image file.
You probably actually don’t have a.image file.
You probably have an image that ends in the XZ extension.
If we look at the website again,
at least as of the time I made this video,
at the very bottom of that says.xz at the end.
That just means it’s a zipped image
so that it’s faster to download.
So in order to unzip that and make it a regular image,
you basically say unxz and then type the name of the file.
Actually, it would probably end in xz if you had it.
So you just kind of wait a little while for that to unzip
and then when you’re done,
it’ll show the image file like I have.
Okay, anyway, so now that we’ve downloaded the image file,
file the next thing we need to do is actually write to the SD card so I’m
going to take the SD card right now and stick it into the card reader.
Oh um this is going to be awkward.
Awkward!
My giant fingers aren’t working.
Oh I almost did it. I almost got it.
Oh man, welcome to my life.
Bro, I need a flashlight or something.
Oh my god, finally, finally, finally.
Okay, I am kind of in a dark room and it’s like upside down and my hands are big and
it’s like way over there.
It’s already plugged in.
already plugged in. I didn’t want to unplug the card reader because sometimes they don’t show up
again if you plug them back in and you have to like reset the USB root hub. I really didn’t want
to do that. So let’s see. The first thing that you probably should have done actually before
plugging in the SD card, so maybe unplug your SD card real fast just to check, is just take note
of what’s already plugged into your computer. I already know so it’s fine for me, but for you,
program called parted which is short for partition editor it’ll just show you what
disks and partitions and stuff you have in your system so i’m going to run it if you don’t have
it it’s probably for you sudo apt install parted i’m going to do print uh devices and
oh okay i’m on a host machine right now i got to send that usb into the guest so i guess it
all worked out notice how it’s telling me this is the only disk that’s present it’s like my
machine disk so then i’m going to tell my host machine to give that card reader to the guest
machine usb host device card reader finish hopefully the video didn’t skip or do anything
weird and then if i do print devices again now another thing showed up and uh i’m able to access
it i know for sure this is dev sd god damn it i know this is dev sdb because that’s what just
just showed up so remember that that’s very important you don’t want to get that wrong
and notice these annoying pop-ups that happen that’s because there was already a file system
on the card because you know i play around with these things and it’s not erased right now so
that’s okay you can just close these little pop-ups if you’re if you’re linux auto mounts
or anything like that but you have to unmount before you start writing to the card because if
you write to a card or a drive or anything that’s already mounted somewhere like then you’re probably
your data. So I’m going to do mount just to check what the mounts are and I’m going to search for
SDB since I know that’s the device that just showed up. So it’s telling me that it’s mounted
on those two folders which we recognize at this point because we just saw them pop up. So I’m
just going to unmount them real fast to make sure that I don’t screw anything up.
Okay all right and then one more time mount pattern matching with grep against SDB. Now
grip against sdb now they’re gone so it’s probably safe to write to the sd card now
so um the first thing that i’ll do is i’ll say sudo actually let me just list real fast the
image okay so we’re gonna write the image to the sd card using that card reader and
i should probably also point out that if you don’t understand what i’m doing on the command line
you could just follow along but i have other videos that are you know fairly decent tutorials
command line and connecting to machines over the remote and making ssh keys and stuff like that so
i’m going to go ahead and use a command called dd which writes directly to some drive or block
device it’s very very dangerous so be careful you could destroy your whole computer this way
i actually did this once a long time ago i didn’t check what the output specification was
and i watched my computer totally erase itself and a little tear went down on my cheek so we’ll
on my cheek. So we’ll specify the in file, if equals, and that’s pretty easy. I just have to
specify the image I just downloaded. Make sure you unzip yours before you do this. Then the out
file is going to be the block device that just showed up. devsdb. If you see other tutorials on
the internet with like, you know, sdb1 and 2, those numbers after the sdb or the block device,
those usually are just partitions. So you want to write the whole entire card, or sorry, the whole
the whole entire image to the whole entire card you don’t want to specify a partition
i’m also going to specify conv equals fsync for me it’s a little bit safer i don’t know if this
is needed on sd cards but for usb thumb drives they’ll sometimes lie to you and say that data
has been written even though it has not in order to appear faster than they really are so if you
do conv fsync it makes that safe again because you don’t want to you don’t want the command to
you unplug the device and then whoops you have corrupted data now because it didn’t finish
and then i’m going to do status equals progress just so i can see what’s happening
okay so uh at this point now we’re just waiting i’m going to watch the progress for myself very
carefully and then i’m going to uh i guess i’m going to pause the video and i’ll come back when
So you should just probably pause the video right now and then when your card is finished
writing then come back and resume with me.
We’ll do an initial IP address and we’ll connect to it.
We’ll set up the SD card and all that stuff without ever plugging in a monitor.
Totally headless.
It’s pretty sweet.
Okay, I’m going to pause.
Okay, I’m back.
So I had an issue that I want to share with you real fast.
the auto mounting service just came up and produced a folder and I get I got kind of scared and then
when I went to go into the files I started getting read write errors so I think I actually corrupted
my card I ended up disabling the service that auto mounts and then writing the card again from
scratch so just for you the command that you would probably need if you have the auto mounting
stop udisk2.service.
You don’t want to disable it
because you probably want it running
after you’re done doing all your installs,
but you want to do stop so that it stops right now
and then start the SD card writing
all over again from scratch.
So with that in mind, let’s see.
Hopefully this is going to show up now.
Pseudo parted.
And then I’ll do print devices again to see what’s up.
Okay, so it’s in there.
Now let’s see if we have read write errors
let’s see if we have read write errors or if it’s actually going to work this time.
So I turned off the auto mounting service, which means I have to mount it from scratch probably.
So let’s just double check to make sure it didn’t actually mount media mic. Okay. So nothing’s in
there. So that’s good. So now I am going to go into the temp folder and then the pie folder
and then the boot folder and the root are just going to be mounted. So I’m going to say sudo
is that what I just saw? I forgot. SDB, yeah. SDB1 goes to boot.
And then SDB2 goes to root. Now we have access, hopefully, to the file system. So I’m going to go
into the boot file system. So this is the boot partition that your Pi will have when it’s running
and stuff. So first thing we need to do is tell the Pi that we want its SSH server to be enabled
at boot. There’s not really that much that we have to do here. We’ll just
basically create an empty file with the touch command. So I’m going to say touch
SSH and now if you look there’s an SSH file it’s totally empty but that lets
the pi know that we want the SSH server to run whenever it boots. Then we have to
modify the command line so that we can set a fixed IP in advanced. So you know
sudo nano command line or vim or whatever you like to use. What you’re
like to use what you’re looking for here is root weight right after that you have to put the
specification for the ip address that you want so you probably should know what your ip address sub
what your ip subnet is before you start we’re not going to do ipv6 in this video but you know because
we just need ipv4 to get into the pi and then from that point you can configure it however you feel
or sometimes dot zero dot one whatever yours is you have to figure it out you have to go find out
what your router’s ip is your subnet is probably just the first three numbers because most routers
consumer routers default to a 24 block which just basically means the first 24 bits have to stay
fixed and the last eight bits can change for an ip address to be considered in the same subnet as
some other so for me i know mine is a dot one dot something so i’m going to assign 123 to my pi’s
ethernet adapter because that’s just what I want. You have to choose a number that’s available on
your network. If you don’t really know then it probably won’t matter too much because if you
fix a number that’s already in use the other computer will probably get kicked off the network
and then try to rejoin and then it’ll end up using a different number. Most DHCP servers that I’ve
seen on consumer routers will kind of stop at high numbers like they’ll go from 2 to 99 or something
So if you want to be like a little bit on the safer side, you could choose a higher number.
But it’s fine.
So right after root weight, IP equals, and then the IP address that you’ve chosen.
So that’s it for the boot partition.
Let’s go into the root partition now.
So the root partition is just like the root of the file system.
It’s got the actual root folder.
So that’s the home directory for the root account.
We could go in there and modify that if we wanted to.
every PI by default with these OS installs,
it comes with an account called PI
and it’s also an admin.
So it’s home folder is gonna be
the root of the file system slash home slash PI.
But for this particular mount, you know,
it starts at root.
So we have to go CD into home and then CD into PI.
So from your PI’s perspective,
it’s just gonna be this folder right here,
slash home slash PI.
I’ve mounted it so I see a different path.
If I list it, you can see some starter files for the PI.
for the pi. So I’m going to create a directory. I can do make directory and call it dot SSH,
a special folder where all your SSH configuration is. Again, if you don’t understand SSH or keys or
anything like that, see my other videos. I’ll talk about how to make SSH keys and connect from
Windows and connect from Linux and all that stuff. But it’s not too bad. You can just kind of follow
along with me. If you don’t have a key, by the way, on your host machine. So let’s let me go up
So let me go up here on the host machine.
You can do something like ssh-keygen type ed25519 and then just hit enter a bunch of times.
And you should be able to get your ssh key created.
You probably want to eventually learn how to put a password on it, you know, but that’s okay for now.
So I’m going to go into the ssh folder.
And I want to create a special file called authorized keys.
some SSH keys that will be allowed to connect into the Pi. So for my host machine, I’m going to
print out my public key, at least for this.
Oh, ID, right? I got to do IDED.hub. So this is just like a useless key. I mean,
the public keys are always okay to share on the internet. It’s fine. But like,
I feel better about this because it’s just my VM for videos. It doesn’t actually run most of the
Okay, something happened
Okay, so basically you just take this key the whole entire public key get the pub not the one that doesn’t have pub and just paste it into
Authorized keys file
So then we have to set permissions
The authorized key file we’re gonna go to mod. I think it’s supposed to be like six or seven oh
But basically the system probably doesn’t want any other user to have permission. So that’s why we do
we do something zero, zero, either six or seven. I think six might be it, but I’m just going to
stick with seven just to help this video go along a little bit faster. Make sure it’s owned by the
same user as the pi. In this case, the pi user is just sort of like the first user that was created.
So it’ll end up having the same user as you if on your host machine, you are also the first user.
user owner or maybe just do the root account instead maybe I’ll show you that real fast
so then we go up one level and the system probably also does not want the SSH key to be you know or
SSH folder to be browsable by other users it’s also kind of a bad idea so I’m just going to go
Chamod we’ll do like another 700 SSH it definitely has to be 700 instead of 600 if you don’t know
by the way then just see my other videos otherwise trust me but long story short
not a good idea to be able to let other users into your SSH folder so that’s why
I’m doing that at this point we’re probably done authenticating we can
probably jump into the pie but let me just show you real fast if we go into
the root folder permission denied okay sudo su root and then go into the root
tempPyRoot, that’s the root partition.
So really from the Pys perspective,
we’re trying to edit a file called slash root
because that’s the home folder for the root account
on the Pi.
It’s basically the same thing.
There’s like an SSH folder in there
and you can add an authorized keys file
if you wanna be able to log into the root account
on your Pi.
Otherwise it doesn’t really matter.
And I think we’re probably done.
Let me just double check my notes real fast here.
Oh no, I forgot to look at my notes.
I forgot to look at my notes first connection.
Did I forget anything?
I probably forgot a bunch of stuff.
Authorized keys.
All right, let’s see if it actually works.
So I’m going to now unmount.
Got to do that.
Don’t forget to unmount.
So I’m going to go sudo umount boot, sudo umount root.
If either of those say the device is busy, you probably are still in that directory
directory in like a different terminal tab or account or something.
You know, one of the mistakes I always make is I go sudo su root.
And then I forget that the regular user is actually still in that same folder,
even if I navigate to somewhere else in the root account.
So just make sure everything’s okay. Uh, and then you can,
if you want to double check, you can say mount, mount points, um,
boots and mount points roots.
And it’ll tell you that they’re not mount points. So at this point,
probably okay to remove the card from the card reader, remove the micro SD card, stick it into the Pi
and then I’m going to plug the Pi into ethernet because that’s the IP address that I just set up
so I’m plugging it into the ethernet real fast. You can’t see it’s off camera, I have a short cable
and then I’m going to plug it into its power. So now my Pi is totally on and I’m going to start
And I’m going to start trying to ping that IP address as fast as I can.
I should have started pinging before anything happened.
Because it’s more fun to see when the pings begin.
Would you agree?
No?
Okay.
Let’s see what’s happening.
I see some flashing on the Ethernet cable and the power lights.
I always get nervous that I’ve done something wrong when I’m being recorded.
Because, you know, in regular life, I do stuff wrong all the time.
And it’s fine.
And it’s fine. Nobody remembers.
I just have to, like, quickly catch myself and correct my mistakes.
Awkward.
This small amount of time has turned into a huge amount of time.
In my mind.
Wait, what am I doing? What am I doing?
Oh, that’s what happened! Oh, a huge mistake!
I forgot to put an extra number there.
For some reason, it filled in the zero.
For some reason it filled in the zero.
I was too rushed.
Okay, so the Pi probably came on a long time ago.
You’re welcome for the laugh.
So now that the Pi is online,
I can try to SSH into it and just hope
that my authentication works.
So I’m gonna do Pi at,
because I didn’t make a user account that matched Mike.
I just made a Pi user account.
So I’m gonna do that.
And host verification has failed.
So that just is because I’ve been using that same IP address
using that same IP address for different videos today. So I have to remove that from the memory
of my SSH client. So I’m going to go SSH keygen R. This is a good security feature. Basically,
it’s saying that your system remembers connecting to a totally different machine at that same IP.
So it thinks somebody is being hacked. So I’m just going to remove the record and then try to
connect again. Now it’s going to say, all right, do you want to connect? Do you trust this? I guess
And here we are, we’re inside of a Raspberry Pi now.
This is basically the end of the video because you can kind of do whatever you want now.
Notice how I never plugged in HDMI.
I didn’t have to look at a desktop.
I didn’t have to do anything except just connect to the Pi over the network.
For me, this is really convenient.
You just write the SD card, modify a couple of things, plug into Ethernet, and then boom,
you can configure it.
So you can go into, you know, Network Manager and like look at the connections and modify them,
and modify them, set the IP addresses however you want, set any other
configuration any way you want, harden the security. So the point of this video
is just how to get in without really plugging into a monitor. So thank you so
much for watching I hope you learned a little bit of stuff and had a little bit
of fun. I suppose I will see you in the next video.
Hey everybody, thanks for watching this video again from the bottom of my heart.
I really appreciate it.
I do hope you did learn something and have some fun.
If you could do me a please, a small little favor, could you please subscribe and follow
this channel or these videos or whatever it is you do on the current social media website
that you’re looking at right now.
It would really mean the world to me and it’ll help make more videos and grow this community.
So we’ll be able to do more videos, longer videos, better videos, or just I’ll be able
or just I’ll be able to keep making videos in general.
So please do me a kindness and subscribe.
You know, sometimes I’m sleeping in the middle of the night
and I just wake up because I know somebody subscribed or followed.
It just wakes me up and I get filled with joy.
That’s exactly what happens every single time.
So you could do it as a nice favor to me
or you could troll me if you want to just wake me up in the middle of the night.
Just subscribe and then I’ll just wake up.
I promise that’s what will happen.
Also, if you look at the middle of the screen right now,
the middle of the screen right now you should see a qr code which you can scan in order to go to the
website which i think is also named somewhere at the bottom of this video and it’ll take you to my
main website where you can just kind of like see all the videos i published and the services and
tutorials and things that i offer and all that good stuff and uh if you have a suggestion for uh
clarifications or errata or just future videos that you want to see please leave a comment or if you
hey what’s up what’s going on you know just send me a comment whatever i also wake up for those in
the middle of the night i get i wake up in a cold sweat and i’m like it would really it really mean
the world to me i would really appreciate it so again thank you so much for watching this video
and um enjoy the cool music as as i fade into the darkness which is coming for us all
Thank you.
Okay.
Hey there, let’s talk about how to boot your Raspberry Pi or part on yourself.