Build a Raspberry Pi Media Server

For this mini project, we will use a Raspberry Pi and install Plex Media Server.

Required Hardware 📦

  • Raspberry Pi with at least 2GB of RAM
  • Micro SD Card (8GB or larger recommended)
  • Power supply for Raspberry Pi
  • WiFi network to connect to

With the hardware ready, let’s get started! 🚀

Installing Raspberry Pi OS Lite

  1. Download the latest Raspberry Pi Imager from https://www.raspberrypi.com/software/
  2. Insert a blank microSD card into your Mac
  3. Open Raspberry Pi Imager and select « Raspberry Pi OS Lite (32-bit) »
  4. Choose the microSD card as the storage destination
  5. Check the « Set username and password » box and enter your desired username and password
  6. Check the « Enable SSH » box to allow remote connections
  7. Click « WRITE » to flash the microSD card

Headless WiFi Setup

  1. Once the write is done, re-insert the microSD card
  2. In the mounted « boot » volume, create an empty file named « ssh » (no extension) to enable SSH
  3. Create a « wpa_supplicant.conf » file with the following content, replacing « networkname » and « password »:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="networkname"
    psk="password"
}
  1. Eject the microSD card and insert it into your Raspberry Pi Zero W.

SSH Connection

  1. Power on your Raspberry Pi Zero W, it should connect to WiFi
  2. Open the Terminal utility
  3. Type ssh pi@raspberrypi.local and press Enter (default password is « raspberry »)
  4. You’re now connected to your Raspberry Pi Zero W via SSH! 🥳

Installing Plex Media Server

  1. Update packages: sudo apt update && sudo apt upgrade -y
  2. Install dependencies: sudo apt install gnupg2 -y
  3. Add Plex public key:
wget -qO- https://downloads.plex.tv/plex-keys/PlexSign.key | sudo tee /etc/apt/trusted.gpg.d/plex.gpg > /dev/null
  1. Add Plex repo:
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
  1. Install Plex Media Server: sudo apt update && sudo apt install plexmediaserver -y
  2. Start the server: sudo service plexmediaserver start
  3. You can now access http://raspberrypi.local:32400/web to set up Plex! 🎥

And there you have it, you’ve successfully installed a Plex media server on your Raspberry Pi Zero W by remote programming from macOS! 🎉 The steps are similar for installing other media servers like Emby.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *