Simple way to install plex on your raspberry pi and mount connected USB drive. You can also set up samba server and install transmission for download torrents. Or set up pi as file storage by installing only usb and samba. If you have two pi you can separate torrents and plex server.
- Ubuntu (or Windows with bash ubuntu)
- Raspberry Pi Imager
- Ansible
- Raspberry pi 3/4 with SD card
- USB drive
- Download Raspberry Pi OS Lite
- In Raspberry Pi Imager choose use cusstom and select downloaded image. Choose your SD card and click write.
- Go to the boot volume on SD card and create ssh file
touch ssh
- Generete private and public key with
cd ~/.ssh && ssh-gen
and set name for keypair as raspberry for example. - Go to the rootfs volume on SD card and create .ssh folder
mkdir home/pi/.ssh
. - Put your public ssh key into authorized_keys file
cp ~/.ssh/raspberry.pub home/pi/.ssh/authorized_keys
- Format USB drive to NTFS and set label
usb_750g
for example, we will be use it later. - Connect Ethernet, USB drive to your PI an power up.
- Connect via ssh to pi
ssh -i cp ~/.ssh/raspberry pi@your_ip
and set up static IP on your pi read this article or set up permanent IP by MAC address on your DHCP server. Run on picat /sys/class/net/eth0/address
to get MAC address.
- In
hosts.ini
file replace IP with your static IP. - In
group_vars/all.yml
file replaceansible_user
,ansible_ssh_private_key_file
,host_name
variables with yours values. Replaceusb_volume_label
with value from step 7 of preparation. - Run
ansible-playbook plex.yml
to install plex media server. Your pi will be rebooted in the end. - Run
ansible-playbook usb-volume.yml
to mount your USB drive. - Is everything was OK open
your_ip:32400/web
and setup plex. At first access it can take longer. Try access again if it shows some errors.
Run ansible-playbook samba.yml
to install and set up. It will share your USB drive. In Windows access by \\your_ip
.
- In
group_vars/all.yml
file replacetransmission_username
,transmission_password
with what you want and replace home network intransmission_white_list
. - Run
ansible-playbook transmission.yml
to install and set up. It will create download folder in your USB drive and set up as default for downloads. - Access to transmission web
your_ip:9091/transmission
.