Written January 7th, 2023
I wrote this so I won't forget the steps to make our media server in case I have to format my SD card. A lot of the resources to do this were scattered around the internet, so I thought I would compile them into my own post.
Materials:
>- Raspberry Pi 3
>- 16GB MicroSD
>- TV
>- HDMI Cable
>- Keyboard
>- 2 USB Cables
>- 1TB External Drive
Get the Raspberry Pi image installer
Write Raspberry PI OS Lite to the 16GB MicroSD.
Plug in Raspberry Pi with the SD card, keyboard, and TV hooked up
Login
raspberrypi login: pi
Password: raspberry
sudo raspi-config
Localization Options
WLAN Country Set...
Pick country
You may also want to localize your keyboard while in this menu.
Finish and Reboot
Finish setup in terminal
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
# add wifi name and password
network={
ssid="YOURWIFI"
psk="YOURPASSWORD"
}
click Ctrl X
, Y
, Enter
reboot
>- (optional but makes copy pasting commands from the web much easier)
>- With SSH enabled you can login to your raspberry pi from other computers
sudo raspi-config
Go to interface options
Enable SSH
Open the terminal on another computer and enter
arp -a
This should show you the pi@raspberry on your network. Mine is raspberrypi.attlocal.net
.
Which means to ssh into this computer I can run this command:
ssh pi@raspberrypi.attlocal.net
Now you can run commands from another computer.
Format your external hard drive to ExFAT
Add your movies from your computer to it that you have obtained legally
sudo apt-get update
sudo apt-get install kodi
sudo apt-get install exfat-fuse exfat-utils
reboot
sudo apt-get install autofs
sudo nano /etc/auto.master
Add this to the file
/media /etc/auto.usb --timeout=60 --ghost
click Ctrl X
, Y
, Enter
sudo blkid
Copy the UUID of your drive
sudo nano /etc/auto.usb
add this line
movies -fstype=auto,uid-pi,gid=pi,rw UUID=YOUR-UUID
click Ctrl X
, Y
, Enter
Restart autofs
sudo systemctl restart autofs.service
sudo crontab -e
Pick nano, or whichever editor you like.
add this line:
@reboot kodi --standalone
If you are using nano
, you know the drill: Ctrl X
, Y
, Enter
reboot
Go to movies, Click Enter files section
Click + Add videos
and then Browse
into folder where your movies are
Set the directory contains type to movies
for scraping data
Click options in the lower left corner to Update library
under Actions
When you go back to the movies screen you should see all of the metadata for the movies on your drive.
Go to Settings
via the gear icon, then => Service Settings
=> Control
Toggle Allow remote control via HTTP
and Toggle remote control from applications on other systems
Download the Kodi app on the Apple or Android store.
Click Find Kodi
on the mobile app and enter your username and password: pi
and raspberry
if you still haven't reset the password. You can and should change the password for your raspberry pi user via the raspi-config
command.
🍿 Congrats! You are now running your own media server on a raspberry pi! 🍿