Here is a complete step-by-step guide to setting up a Raspberry Pi Zero W as a private offline streaming server that you can access via Wi-Fi and manage via SSH.
- Raspberry Pi Zero W (with Wi-Fi)
- MicroSD Card (16GB or larger)
- External Storage Device (USB flash drive or hard drive)
- Power Supply (5V)
- USB OTG Cable (to connect external storage)
- MicroSD Card Reader (for initial setup)
- Raspberry Pi OS Lite
- Jellyfin Media Server
- Hostapd and Dnsmasq (for Wi-Fi access point)
- SSH Client (e.g., PuTTY for Windows, Terminal for macOS/Linux)
Download Raspberry Pi OS Lite:
- Visit the Raspberry Pi website.
- Download Raspberry Pi OS Lite.
Flash the OS to the SD Card:
- Use the Raspberry Pi Imager or Balena Etcher to flash the OS onto the SD card.
Enable SSH and Configure Wi-Fi:
- After flashing, create an empty file named
ssh
(no extension) in theboot
partition of the SD card to enable SSH. - Create a file named
wpa_supplicant.conf
in theboot
partition with the following content to configure Wi-Fi (replaceYour_SSID
andYour_PASSWORD
with your Wi-Fi credentials):country=US ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="Your_SSID" psk="Your_PASSWORD" key_mgmt=WPA-PSK }
Boot the Raspberry Pi:
- Insert the SD card into the Raspberry Pi and power it on.
Connect via SSH:
- Use an SSH client like PuTTY (Windows) or Terminal (macOS/Linux) to connect to the Pi:
Default username:
ssh pi@raspberrypi.local
pi
Default password:raspberry
Update the System:
- Update and upgrade the system:
sudo apt-get update sudo apt-get upgrade -y
Install Hostapd and Dnsmasq:
- Install the necessary packages:
sudo apt-get install hostapd dnsmasq -y
Configure Hostapd:
-
Edit the Hostapd configuration file:
sudo nano /etc/hostapd/hostapd.conf
Add the following content:
interface=wlan0 driver=nl80211 ssid=YourNetworkName hw_mode=g channel=6 wmm_enabled=0 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=YourPassword wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
-
Edit the default Hostapd file to point to the configuration file:
sudo nano /etc/default/hostapd
Set:
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Configure Dnsmasq:
- Backup the original configuration and create a new one:
Add the following:
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig sudo nano /etc/dnsmasq.conf
interface=wlan0 dhcp-range=192.168.50.2,192.168.50.20,255.255.255.0,24h
Configure Network Interfaces:
-
Edit the DHCP configuration:
sudo nano /etc/dhcpcd.conf
Add:
interface wlan0 static ip_address=192.168.50.1/24 nohook wpa_supplicant
-
Ensure the network interfaces are correctly configured:
sudo nano /etc/network/interfaces
Add or modify:
allow-hotplug wlan0 iface wlan0 inet static address 192.168.50.1 netmask 255.255.255.0
Start and Enable Services:
- Start and enable Hostapd and Dnsmasq:
sudo systemctl start hostapd sudo systemctl start dnsmasq sudo systemctl enable hostapd sudo systemctl enable dnsmasq
Install Jellyfin:
- Install Jellyfin:
sudo apt install apt-transport-https -y sudo apt update sudo apt install jellyfin -y
Configure Jellyfin:
- Access Jellyfin’s web interface at
http://192.168.50.1:8096
from a browser connected to the Pi's Wi-Fi network. - Follow the setup wizard to configure your media library, pointing it to the folder on your external storage where you have your media files.
Connect to the Pi’s Wi-Fi Network:
- Use your device (laptop, smartphone, etc.) to connect to the Pi’s Wi-Fi network using the SSID and password you configured.
SSH into the Pi:
- Use an SSH client to connect to the Pi using its static IP address:
ssh pi@192.168.50.1
Access Jellyfin Interface:
- Open a browser and navigate to
http://192.168.50.1:8096
.
Stream Movies:
- Use the Jellyfin interface to browse and stream your movies.
By following these steps, you will have a Raspberry Pi Zero W set up as a private offline streaming server, accessible via its own Wi-Fi network and manageable via SSH.