Step-by-step guide to turning a Raspberry Pi 5 into a home media server: flashing Raspberry Pi OS Lite, SSH setup, formatting an external SSD, and sharing it over Samba.
Key Takeaways
- A Raspberry Pi 5 with an external SSD and Samba can serve as a low-cost personal media server
- Use Ethernet rather than Wi-Fi for reliable streaming of video content
- Always verify commands and scripts before running them, especially downloaded install scripts
- Formatting the drive erases all data, so back up anything important first
What the video covers
- Introduces building a home server with a Raspberry Pi, using a starter kit with SD card, case, heat sink, fan and power supply
- Explains flashing Raspberry Pi OS Lite with the Raspberry Pi Imager, choosing a hostname (media-pi) and user credentials
- Covers inserting the micro SD card and enabling SSH with password authentication
- Walks through connecting to the Pi over SSH and running system updates and upgrades
- Shows how to verify time zone settings and confirm the Pi booted from the SD card
- Details wiping and repartitioning an external 1 TB SSD with GPT and creating an ext4 filesystem
- Explains mounting the drive persistently via /etc/fstab and setting ownership for the user
- Demonstrates physically assembling the Pi into its case with heat sink and fan
- Sets up Samba so the drive is accessible as a network share from Windows and Mac computers
- Recommends using an LLM to troubleshoot errors and advises caution with copy-pasted curl commands from the internet
Chapters
- 00:00Introduction and Goals
- 00:49Flashing Raspberry Pi OS with the Imager
- 05:30Preparing the Hardware and Case Assembly
- 14:06First SSH Connection and System Updates
- 28:20Configuring Time Zone and User Accounts
- 46:40Formatting and Mounting the External SSD
- 60:00Setting Up Samba File Sharing
- 80:00Connecting from Windows and macOS and Wrap-up
Full Transcript — Download SRT & Markdown
Speaker A
So, you bought a Raspberry Pi and want to set up your own home server. I'm going to teach you how to do it right now.
Speaker A
has 128 GB SD card, a nice little case to put your Pi in, a heat sink, and a fan to keep the Pi cool, and a power supply, a USB micro SD card reader, and finally, the actual Pi itself. The only
Speaker A
I'm going to be using this kit from Canit. It has everything you need.
Speaker A
SD in and plug it into your computer. Hop on your computer, go to raspberrypi.com/software.
Speaker A
It has a 128 GB SD card, a nice little case to put your Pi in, a heat sink, and a fan to keep the Pi cool, and a power supply, a USB micro SD card reader, and finally, the actual Pi itself.
Speaker A
We want to install Raspberry Pi OS light. Select your storage device. This is just the micro USB. and choose your host name. I would recommend calling it media pi like I do so the commands are similar that we're going to be using.
Speaker A
The only things you'll need that this kit doesn't include is an Ethernet cable and some kind of storage.
Speaker A
will change the commands you're using. I'll show you in the section coming up. You could enter your Wi-Fi name and password here, so your Pi will connect over Wi-Fi. Since we're using an Ethernet, this won't matter, but it is
Speaker A
I have an external Samsung SSD that I'll be using, that's 1 TB.
Speaker A
will take about 10 minutes so we can build our Pi out while we wait. Next, we're going to grab our Pi and grab our case. This breaks out into three pieces like this.
Speaker A
First things first, grab your USB micro SD card reader and pop that micro SD in and plug it into your computer.
Speaker A
And you could line it up without taking the stickies off if you want. Take the stickies off. Stick it on like so. And the next thing, this little tan tab here, you're going to pop it off with your fingernail. This is the fan port.
Speaker A
Hop on your computer, go to raspberrypi.com/software.
Speaker A
You'll know how to line it up because it has these cutouts for the ports here.
Speaker A
Scroll down here. We can see the options: Download for Windows, Mac OS, or Linux.
Speaker A
micro SD card. Now, you're going to take your USB out of your PC and slide that micro SD card into that slot nice and firm. Make sure you line it up correctly. We're almost finished with the in real life part. Grab your power
Speaker A
I'm on Windows.
Speaker A
external hard drive into our Pi here. Just a warning, this will erase everything on the drive. So, make sure before you do this, you back up anything important on here. And plug the other side of your Ethernet cable into your
Speaker A
So, once we have the imager downloaded, select the Pi model. This is Pi 5.
Speaker A
After this step, all the rest will be the same. Now, before we jump into it, I need to preface this. If any errors or weird things happen, I highly, highly recommend you use chat GPT or Claude or whatever LLM of choice. Paste the errors
Speaker A
Scroll down on the operating systems and select Other.
Speaker A
It'll bring you to this page. This is a write up and it has every single command that I'll be running in order. It has a placeholder where I write Tucker. I replaced it with username. Make sure you're replacing that with whatever you
Speaker A
We want to install Raspberry Pi OS Lite.
Speaker A
has a little bit more extra information. All right, now that we got that out of the way, let's jump into it. So, we're going to SSH into our Pi here, which basically means we're going to go inside of it. So, I'm going to write SSH tucker
Speaker A
Select your storage device. This is just the micro SD card, and choose your hostname.
Speaker A
And to know it's working, you're going to have this green and blue Tucker at media here. That's how you know it worked. The first command we're going to run is pseudoapp update double and sign pseudoapp full upgrade-y.
Speaker A
I would recommend calling it media-pi, like I do, so the commands are similar to the ones we're going to be using.
Speaker A
Once that finally finishes, we're going to do pseudo reboot. This restarts our Pi and it will kick us out of the SSH.
Speaker A
Select your time zone and country.
Speaker A
up, press enter, type your password in, and get right back in. Next, we're going to see if our time zone is set correctly. Make sure that matches up with the time zone you're currently in.
Speaker A
Next, we're going to create a username and password for our Pi. This is how we're going to connect into it.
Speaker A
We're going to run this command here. This will confirm that we booted off of the SD card. and DFH will show the amount of space we have on there. All right, the next step is we're going to reformat our external drive if you have
Speaker A
I'm going to choose the username Tucker. You could choose whatever you want here, but this will change the commands you're using. I'll show you in the section coming up.
Speaker A
We can see it has the name, the model, the size. My external drive is named SDA, so I'll be using that in all the future commands. Substitute that if yours is any different.
Speaker A
You could enter your Wi-Fi name and password here, so your Pi will connect over Wi-Fi. Since we're using Ethernet, this won't matter, but it is an option. But if you're doing any sort of video, this will not be good. So use Ethernet.
Speaker A
wipe fs- a dev sda. This erases file system and partition table signatures. So, we're basically just clean slating our drive here. Now, pseudo parted dev sda script nk label gpt. We're writing a brand new partition table to the drive
Speaker A
Make sure to enable SSH and have "Use password authentication" selected.
Speaker A
bulk dev sda1. This actually builds the ext4 file system structure inside of the partition we've just made. This command might take a couple minutes. Just let it run. And now we're going to mount that partition with pseudo blkid
Speaker A
We could skip past this screen here and we could write to the Pi. This will take about 10 minutes, so we can build our Pi out while we wait.
Speaker A
This creates an empty directory here. Now we want to do pseudo nano/etc/fab. This opens our file system table in the nano editor. Use your arrow keys to go down to the bottom of this file to the last line. And we want to add as the
Speaker A
Next, we're going to grab our Pi and grab our case. This breaks out into three pieces like this.
Speaker A
We want to make sure there's no typos in this at all. Once we did that, we want to save. So press Ctrl X Y to save and then press enter. So now we want to do pseudo mount dash A. This mounts
Speaker A
Next, we're going to grab our heat sink. This goes on the Pi. You could always line it up with this tiny little one in the top.
Speaker A
It'll just reload this. Just enter your password here to confirm this. Now to double check that worked, we want to do df-h storage. this report space on our file system that's mounted. So, I have a 1 TBTE drive here. I'm expecting to see
Speaker A
And you could line it up without taking the stickies off if you want. Take the stickies off. Stick it on like so.
Speaker A
Once we do that, we're going to run that same command again, df-h/s storage, and we're going to hope to see the same output as we saw before. This is getting a little cluttered, so I'm going to use the clear command here.
Speaker A
And the next thing, this little tan tab here, you're going to pop off with your fingernail. This is the fan port.
Speaker A
user and owning group on the directory and everything inside of it. So normally a freshly formatted drive is owned by root. So this will let our user access this. We're going to do four MK dur which basically means we're just
Speaker A
And make sure you plug this in the right way. You want the yellow wire to be towards the outside of the Pi, like this.
Speaker A
And we can run find mnt/stom max depth 3 to see everything under that path and make sure this all was created.
Speaker A
So next, you want to snap the Pi into the bottom piece of the case. You'll know how to line it up because it has these cutouts for the ports here.
Speaker A
places on the internet. Always verify what they do. So this curl command, we're just going to Docker. So you could go to this website and double check, but do not just paste random curl commands in your console. This downloads Docker's
Speaker A
Line up the middle piece and snap it back on.
Speaker A
we can go exit to get out of there. Now we can ssh back into our pi here. And we're going to verify docker ran with docker run d-rm hello world. This just downloads a tiny test image and runs it and make sure it
Speaker A
And the fan should snap into the top piece here perfectly. And then you can just snap that on. And boom, you have your Pi assembled.
Speaker A
line back slash image. This creates our image folder and brings us into it. So we're going to run a wget command here.
Speaker A
Now, on the back, if you look, it has a slot for the micro SD card. Now, you're going to take your micro SD card out of your PC and slide that micro SD card into that slot nice and firm. Make sure you line it up correctly.
Speaker A
Just copy paste these in. So we're going to edit that file we just made. Nano.ev.
Speaker A
We're almost finished with the in-real-life part. Grab your power brick. Make sure you plug this into the USB-C port marked "Power," as you can see right here.
Speaker A
Obviously if your time zone is different, change that. Same thing to get out of this. We're going to controll x y then press enter. Now that we have image installed, we can start it up. So docker compose up-d.
Speaker A
And while we're at it, plug your Ethernet cable into the Ethernet port on the other side of the Pi. Now, plug that sucker in.
Speaker A
could go into our browser and go to media.loc2283. That is the port that image will be running on. So we can create an account here. Email and password. This is entirely local and not connected to anything. You can install image from the
Speaker A
We'll also plug our external hard drive into our Pi here. Just a warning, this will erase everything on the drive. So, make sure before you do this, you back up anything important on here.
Speaker A
in this video but it's pretty self-explanatory. They also explicitly tell you about the 321 rule. If this is going to be your only backup for your photos, I would not recommend it as it says right here. So, the 321 backup rule
Speaker A
And plug the other side of your Ethernet cable into your router so you can get some internet on that thing.
Speaker A
leave it at your buddy's house. You could do a backup off of this every once in a while in case a drive failure or your house burns down or something.
Speaker A
And now, back to the computer. Now, if you're on Windows, open up the Command Prompt. And if you're on Mac OS, open up the Terminal.
Speaker A
So, let's just exit and ssh back into the pi to get into the root directory.
Speaker A
After this step, all the rest will be the same.
Speaker A
This just writes everything in here nicely so we don't have any sort of indentation or weird things happen. And we can validate that with docker compose config. One thing to double check is this user portion here. It's 1,000
Speaker A
Now, before we jump into it, I need to preface this. If any errors or weird things happen, I highly, highly recommend you use ChatGPT or Claude or whatever LLM of choice. Paste the errors in. Include all the commands you've run, and it will help you. I promise.
Speaker A
create these directories here. mkdur-p tilda back/jellifin back/config tilda jellyfin cache. This creates two bind mount folders as our user. If we don't do this in this order, we're going to get some access denied errors. I ran into an issue here that I had to change.
Speaker A
Click on the first link in the description.
Speaker A
If yours has the same thing as mine had, you go into pseudo nano back/boot back/firmware back/config.txt.
Speaker A
It'll bring you to this page. This is a write-up, and it has every single command that I'll be running, in order. It has a placeholder where I write Tucker. I replaced it with "username." Make sure you're replacing that with whatever you changed your username to. Same thing with media-pi. Change that if you didn't name it media-pi.
Speaker A
This forces the Pi to boot at the 496 page kernel instead of the Pi 5 default.
Speaker A
Please read this carefully. It has a little bit more extra information.
Speaker A
Type your password in. And we're going to run that get cof page size command again. And we're going to get 4096. And we're going to run docker ps. This should not be restarting anymore. And we should have jellyfin up and running now.
Speaker A
All right, now that we got that out of the way, let's jump into it.
Speaker A
That is the default port for Jellyfin. We're going to choose our language. We're going to create an admin user and then we're going to create our media library. So, first we're going to change the content type to movies right here
Speaker A
So, we're going to SSH into our Pi here, which basically means we're going to go inside of it. So, I'm going to write `ssh [email protected]`. If you chose a different username, you're going to have to change Tucker to whatever you chose.
Speaker A
language. We're skipping this page and we're going to leave allow remote connections checked. We're almost done with the jellyfin setup here. Just sign in with your username and password you just created. One more thing we're going to double check here. Since this is a Pi
Speaker A
Type in "yes," and now enter your password. When you type, your password will not show.
Speaker A
to none. That's because the Pi does not have a usable hardware video encoder, no graphics card. So, in this video, I'm not going to show you how to acquire content. So, I'm just going to use this fair use video off of Blender right
Speaker A
And to know it's working, you're going to have this green and blue `tucker@media-pi` here. That's how you know it worked.
Speaker A
The next thing we're going to do is set up our Samba. This basically lets us have the Pi as a location on our computer and we don't have to do any commands to get new movies or shows in.
Speaker A
The first command we're going to run is `sudo apt update` and then `sudo apt full-upgrade -y`. This basically fully updates all the software on our Pi. This will take some time. Just let it run.
Speaker A
to get to the root. We're going to do pseudoapp install-y samba samba-combin. This installs samba, which is basically a network file sharing protocol. This will take a few minutes to run as well.
Speaker A
Once that finally finishes, we're going to do `sudo reboot`. This restarts our Pi, and it will kick us out of the SSH session.
Speaker A
you've been using this whole time. We could run tail 12/cambba smb.f to make sure this all looks good. So now we want to set a samba password. So, pseudo SMB pass WD- a user. This creates a password for our
Speaker A
So, we'll need to sign back in. Quick tip: if you use your up and down arrow keys, you can scroll through your past terminal commands. So, you don't have to type in SSH each time. You could just go up, press Enter, type your password in, and get right back in.
Speaker A
So, it picks up the config change we just made and enables it to start automatically if your Pi ever reboots.
Speaker A
Next, we're going to see if our time zone is set correctly. Make sure that matches up with the time zone you're currently in.
Speaker A
We're going to enter our username and the password we just made for Samba and probably tick remember my credentials so it doesn't have to do this anymore. So now you can see we're connected. We can see the movies and TV folders, but we
Speaker A
Immich uses this to timestamp photos. If that time zone's wrong, you could use the `sudo timedatectl set-timezone` command to set it to whatever you need it to be.
Speaker A
link/media.local/media. And once you click finish, now we can see the media drive is located in our Finder permanently. For Mac OS, it's a little easier here. Go to Finder and command K. We're going to type in SMB colon/media.local
Speaker A
We're going to run this command here. This will confirm that we booted off of the SD card, and `df -h` will show the amount of space we have on there.
Speaker A
like you would any other file or folder on your computer. You can use the command line to bring in movies and shows, but this is just a way easier way if you're not comfortable with the terminal. So, back on our Windows PC
Speaker A
All right, the next step is we're going to reformat our external drive, if you have one. This command will just list all the devices that are plugged into the Pi.
Speaker A
And then you can see we got Big Buck Bunny running, baby. So, right now, your movie, shows, and photos are only accessible when you're on your home Wi-Fi, which is obviously not what we want. So we want to install
Speaker A
We can see it has the name, the model, the size. My external drive is named `sda`, so I'll be using that in all the future commands. Substitute that if yours is any different.
Speaker A
This will detect our distribution and install the right tail scale package to our pi. Once this runs we're going to run pseudo tail scale up. This will start the tail scale client and begin authentication. Tailcale is basically a
Speaker A
Now, we have a couple commands that we need to run in a chain here, and they all do different things. So, we're going to do `sudo umount /dev/sda1`. This detaches the partition from our file system tree.
Speaker A
Tailscale here. I'm just going to use my Google account for ease of access so I can log in on my phone. After the initial login, you're going to want to do one thing here. You're going to want to come in here and disable key expiry
Speaker A
Our next command, `sudo wipefs -a /dev/sda`, erases file system and partition table signatures. So, we're basically just clean-slating our drive here.
Speaker A
working? And have no idea. So just come in here and do this right now. And tail scale on the phone works similarly. Just download the Tailscale app from the App Store or Play Store, depending if you're on iOS or Android. Make sure you're
Speaker A
Now, `sudo parted /dev/sda --script mklabel gpt`. We're writing a brand new partition table to the drive here.
Speaker A
If this is your first time doing this on iOS, you're going to have to accept a VPN configuration prompt. Just accept everything. And boom, you should see a VPN come on in the top of your screen.
Speaker A
Now we're going to create a partition spanning the entire drive with `sudo parted /dev/sda --script mkpart primary ext4 0% 100%`. This is just making sure this gets 100% of the drive.
Speaker A
and media pie 2283 per image. And this should be working flawlessly now. You can see here in the command center, I'm not connected to Wi-Fi. And at the bottom, I am on the VPN. So, this should be working flawlessly now. Thank you so
Speaker A
Now we're going to do `sudo mkfs.ext4 -L bulk /dev/sda1`. This actually builds the ext4 file system structure inside of the partition we've just made. This command might take a couple minutes. Just let it run.
Topics:Raspberry Pihome serverRaspberry Pi OS LiteSSHSambaexternal SSDmedia serverLinuxself-hostingtutorial











