# Installing Plex Media Server on Raspberry Pi

## Install Plex Media Server

1. Log into the Raspberry Pi device
2. Run the following commands in terminal
   # update software repositories
   sudo apt update
   # install software updates
   sudo apt upgrade -y
   # install some prerequisites
   sudo apt install apt-transport-https ca-certificates
   # get the latest .deb download URL
   regex='"build":"linux-armv7neon","distro":"debian","url":"(https:\/\/downloads\.plex\.tv\/plex-media-server-new\/[^/]*\/debian\/[^/]*_armhf\.deb)",' && response=$(curl -s https://plex.tv/api/downloads/5.json) && [[ $response =~ $regex ]] && downloadURL="${BASH_REMATCH[1]}"
   # download latest plex version
   wget -O ./plexmediaserver.deb $downloadURL
   # install plex media server
   sudo dpkg -i ./plexmediaserver.deb
   # run plexmediaserver service on system boot
   sudo systemctl enable plexmediaserver.service

## Configuring Plex Account

1. Open a web browser and navigate to http://DNSorIP:32400/web
2. Log in with one of the available options or click sign up with email
3. Give the Plex server a name > Click Next
4. Click the Add Library button > Select the media type
5. Select Add folders from the left navigation > Click Browse for media folder > Select the folder to add to the media > Click Add Library
6. Click Next
7. Click Done to complete the server setup
8. Welcome to Plex Media Server