Install pivpn:
curl -L https://install.pivpn.io | bash
Follow prompts (wireguard, port 51820, use pi-hole, ddns)
Create VPN profile for each end device you intend to connect with
pivpn add
ignore the client ip (just press enter)
name the profile after the device
Install wireguard on the end device you wish to connect with (windows app, app store, etc.)
Copy profile from /home/$USER/configs to end device
Create tunnel from config file in wireguard
Connect
Install pi-hole
curl -sSL https://install.pi-hole.net | bash
Follow prompts (static IP, wlan0, OpenDNS, StevenBlack's Unified Hosts List, web interface, enable query logging - anonymous/full)
When complete, copy the admin password and IP address
Change the password
sudo pihole setpassword
Set the pi-hole IP address as the DNS provider in the router settings from the web UI (typically 192.168.1.1)
Reserve pi-hole IP address in router (LAN Setup)
OPTIONAL, Enable iCloud Private Relay:
sudo nano /etc/pihole/pihole.toml
find the line that says BLOCK_ICLOUD_PR=true and change it to BLOCK_ICLOUD_PR=false
Install Samba
sudo apt-get install samba samba-common-bin
Create a directory to share
sudo mkdir -m 1777 /share
Edit the config file
sudo nano /etc/samba/smb.conf
Append the following lines to the end of the file
[Share]
Comment = Pi shared folder
Path = /share
Browseable = yes
Writeable = yes
create mask = 0777
write mask = 0777
public = yes
guest ok = yes
Create a user
sudo smbpasswd -a pi
(change "pi" to a username of your choice)
Restart the service
sudo samba restart
Connect on end device
For windows:
Open file explorer, go to "This PC", right click and select "Show more options", "Add a network location"
\\xxx.xxx.xxx.xxx\share where xxx is the ip address of the raspberry pi
Or, in cmd:
net use * \\xxx.xxx.xxx.xxx\share /p:yes
Download the .deb Armv7 file from PlexTV via the web browser on the target device
Navigate to the directory and unpack the file
sudo cd /home/$USER/Downloads
sudo dpkg -i filename.deb where filename.deb is the filename as shown in /home/$USER/Downloads
(16 June 2025) currently: sudo dpkg -i plexmediaserver_1.41.9.9961-46083195d_armhf.deb
Access the web interface
http://127.0.0.1:32400/web/
Create an account if needed
Before adding libraries, if using an external drive, follow the instructions for mounting an external drive below
Plu-in the external drive
Create a directory to mount the drive
sudo mkdir /mnt/External
Change ownership of the drive
sudo chown $USER:$USER /mnt/External
Get UUID
sudo blkid
find the device that matches the external drive and copy the UUID
Edit the /etc/fstab entry to add the external drive
sudo nano /etc/fstab
go to the bottom of the file and add the following
#External Drive
UUID=yourexternaldriveuuid /mnt/External ntfs-3g uid=1000,gid=1000,dmask=022,fmask=133,nofail 0 0
Mount the device first usingÂ
systemctl daemon-reload
then
sudo mount -a
Now add the libraries from the external device (Movies, /mnt/External/Movies, etc.)
Scan library
Download plex on end device and login using account created in step 4
This assumes you have a shared folder in windows, for this example it is called "C:\shared".
Install cifs
sudo apt install cifs-utils
Create a mount point
sudo mkdir /mnt/shared
Mount the shared folder with persistent credentials
sudo nano /etc/fstab
and add the following at the end of the file
//xxx.xxx.xxx.xxx/C/shared /mnt/shared cifs credentials=/home/$USER/.smbcredentials,uid=pi,gid=pi 0 0 where xxx is the ip address of the windows computer, and C is the drive letter of the shared folder
Create a credentials file
sudo nano /home/$USER/.smbcredentials
Add the following lines
username=user
password=pass
where user is the username (sometimes an email address) of a valid windows user that can access the shared folder, and pass is the password for that user
Save and exit
ctrl+o, enter
ctrl+x
Modify the file permissions
sudo chmod 600 /home/$USER/.smbcredentials
Mount the folder
systemctl daemon-reload
sudo mount -a
sudo reboot