Intro
A guide for those who want to make their very own Plexamp music streamer out of a Raspberry Pi and fill your soul with that sweet Plexamp music goodness. For those who are more comfortable in a desktop environment, and don’t mind running Plexamp with a head. This guide is geared towards music fanatics who want the best out of their Plex music collection but are beginners or have little to no experience with Raspberry Pi OS, Linux or command lines. By the end of this guide you will have a fully functioning Raspberry Pi with Plexamp running on it.
VERY IMPORTANT: Headless Plexamp Pi is configured to User=Pi. Keep that in mind as you progress. Also before you can install Plexamp you first need to install Raspberry Pi OS. The easiest method to install Raspberry Pi OS is to use the official installer. The official installer can be found on the official Raspberry Pi webpage. If you haven’t installed that yet please go do that first and then come back to this guide. Note: Might be a good idea when installing Raspberry Pi OS to use a unique user name. If you try to use Pi as the user name, you might get an error from the installer saying that this name should not be used or can’t be used, you might not.
I am going to assume you have a working compatible Raspberry Pi with Raspberry Pi OS 64Bit installed and you are staring at a screen that looks something like the image below for Debian Bookworm:
Or something like this for Debian Bullseye
Plexamp works on both Bullseye and Bookworm.
Background Info
Node V20
As of Plexamp 4.10.0 Node V20 is needed by Plexamp. So depending on what OS you are using it is a good idea to start with a quick check to see what node.js is installed if any. And if this is your first time using a terminal this is also a good way to ease into it with a simple command.
Open up a terminal and check to see what version if any are installed. The terminal app icon is in the top desktop menu bar . Open the terminal program and type in the following code exactly as you see it below:
node -v
You should get “not found” on a fresh install. But you may not. It depends. I got nothing because this was a fresh install.
This is a good sign that node.js has not been installed. So we are starting from scratch on this. You can install node.js 20 and Plexamp by using a bash script that was written and is maintained by a Plex community member.
Using a Script to Install
Forum member @odinb1 has written a script to automate the process of installing Headless Plexamp (many thanks).
The script is for use on a headless system. This means a Raspberry Pi without a keyboard, mouse and monitor. But lucky for us, the script can still be used on a Raspberry Pi with a desktop environment, mouse and keyboard setup. The script speeds up the process and takes care of everything for you. The difference between the headless and desktop environment is that the headless version you have to SSH into the Pi from another computer to set it up. Some might find the SSH part a bit intimidating or confusing and a major hurdle and stop there. This guide you don’t need to SSH into the pi. Different approach same end result.
For more details on the script. The script and instructions can be found here: Bash Plexamp Installer. Go check that out and read through the github to have an idea.
Using The Script
First thing in the terminal we need to change to root. To do this we input the following line of code.
sudo -i
Now that we are root we can run the script. Just copy and paste the line of code below into the terminal, hit enter and the script will do its thing:
bash <(wget -qO- https://raw.githubusercontent.com/odinb/bash-plexamp-installer/main/install_Plexamp_pi.sh)
And when its loaded up, it should look like this in the terminal.
The script is a question and answer and is pretty straightforward. Just follow along with each prompt and answer the questions. But for those who are unsure or have never done this before see below:
Script Questions:
-
Do you want to change the hostname?
What this is asking you is what do you want the device to be named so you can find it on your network. The default is raspberrypi. -
By default, installation will progress as user Pi, unless you choose to create/change to a different user. Do you want to create or change to a new or different user for the install (currently Pi)?
If you want to change names type Y and hit enter otherwise type N and hit enter. -
Do you want to change timezone? Just above this question the system will show you the current settings if correct type N and then hit enter.
-
Do you want to install and set vim as your default editor?
If you don’t know what vim is then select N. -
Do you want to disable IPv6?
If you don’t know what that means then select N. -
Do you want to configure your hifiberry hat (or clone)?
This question is to setup any audio hats you installed on your pi. If you don’t have a hat than say No. In my case I have a Digi+v1.0. Excellent and cheap hat. So I am selecting y.
If you say yes here you will be given a list of hat models to choose from, pick the one that is yours and hit enter. Mine is 5. The script will then say continue with 9 or choose again. Type 9 then hit enter. -
Do you want to configure your allo HAT (or clone)? Same as above. If you have allo Yes if you don’t No.
-
Do you want to configure your JustBoom HAT (or clone)? If you have a JustBoom hat then select yes if not then n.
-
Do you want to configure your audiophonics Hat (or clone)? Sames as above. If you have audiophonics Yes if yo don’t No.
-
Do you want to configure HDMI as default audio-output?
The script will give you some warnings here. Read them and follow instructions. If you don’t have a hat you should say yes to this as the 3.5mm output is pretty rough to listen to. (side note: With a hdmi audio extractor you can convert the hdmi signal to rca audio or optical and feed your amp/dac that way.). -
Do you want to prep for upgrade to new version of Plexamp-Linux-headless-v4.x.x, only run if you are upgrading.
This question is for when you want to update/upgrade Plexamp. You can select No here because this is a fresh install. If you are updating/upgrading then select Y. -
Do you want to install/upgrade and configure Node.v20? Needed if you are upgrading from older versions of Plexamp that are older than 4.5.3. We checked for node.js at the beginning of this guide. If your version is a smaller number than 4.5.3 or node.js was not installed at all, then the answer here is yes. Type Y and hit enter. The script is going to do alot of things here and you will see text moving down the page. Don’t touch anything just let it do its thing till the next question pops up.
-
Do you want to install and configure Plexamp-Linux-headless-v4.x.x?
This is asking if you want to install Plexamp and you should say Yes here. Unless your having second thoughts about listening to music or using the worlds greatest music app? -
Do you want to run full OS update?
If you just installed the OS there shouldn’t be any updates, or very few. Say, Yes to play it safe, it shouldn’t take that long if you are coming from a fresh install. Might be several minutes if you didn’t update during the Raspberry Pi OS installation process.
A bunch of code will go by, once it stops, you will see a message in text that says:
–= End of Post-Plexamp-script, please reboot for all changes to take effect==–.
Keep in mind you are still in root which means you can reboot the system by simply typing reboot in the terminal and hitting enter:
or you can go to the raspberry pi icon in the top left and then select logout then select reboot. Once you are back at the desktop, some minor configuration is needed. Open the terminal again.
In a fresh terminal you should see your username@hostname.
Plexamp should be installed now but it is not signed in, not running and it hasn’t been claimed yet. So Now you need to get Plexamp running as a service and claimed. We can get it running by typing in the following line of code:
node /home/USERNAME/plexamp/js/index.js
Note: USERNAME is your username.
You may or may not see some errors here. If you see the words “Starting Plexamp 4.x.x” and then some weird errors its ok to ignore the errors. Plexamp is running. If you see something that says cannot find module then you may have copied and pasted wrong, or typed something by mistake or forgot to replace USERNAME with your username.
Claim the Token
In the terminal you should see something like this;
Open the web browser on the Raspberry Pi and go to the website, it will prompt you to sign in. Sign In, and then copy and paste the claim code it gives you into the terminal and hit enter. It will ask you to give the player a name. There should be some more random errors you can ignore these and then it should end with a message that Plexamp is now signed in and ready!.
Starting up Plexamp
Plexamp may be signed in and ready but it is not started up yet. To start up the plexamp services we need to input the following line again:
node /home/USERNAME/plexamp/js/index.js
This should result in the terminal displaying the sentence Starting Plexamp 4.x.x with a random error and then a small white block. This means Plexamp is running and we can access it from a web browser now.
Using Web Browser to Get to Plexamp UI
We can now safely reach Plexamp from a web browser per Elan’s instructions item 4. Open a web browser on a different device than the Raspberry Pi, so from your PC or Mac and enter http://<ip.of.pi>:32500 or http://<Hostname-of-pi.local> and you should be greeted with a nice welcome splash screen and then another authentication sign in screen. Authenticate and you should now be seeing Plexamp. It should work like normal at this point. If you don’t know what your IP address is don’t worry. You can simply type your hostname.local and it should work just fine. The welcome screen looks like this.
Setting up Plexamp to start as a background service on startup
Plexamp runs in the background as a service so you won’t see it. But you do need to go to the terminal again and type in a few more lines of code to set this up. You only have to do this once. Since we are using plexamp with a desktop and a head, we need to do this extra step.
Go to the terminal and type or copy and paste the following; Be sure that you are in the plexamp directory.. You will know if you are in the correct directory if you see ~/plexamp $. If you don’t see this after your username@hostname than simply type cd plexamp. This means change directory to plexamp. Once you are in the plexamp directory than copy/paste or type the following.
$ sudo cp plexamp.service /lib/systemd/system/
$ sudo systemctl daemon-reload
$ sudo systemctl enable plexamp
$ sudo systemctl start plexamp
No Sleep Till Brooklyn
Last thing, since we are running with a desktop the screen is set to go blank by default. Before you place the Pi out of site. We need to disable screen blanking in the raspberry pi settings. Go to preferences > raspberry pi configuration and tick the box to disable screen blanking. This is essential for anyone using HDMI out for their audio.
Conclusion
Thank you for reading through and I hope this guide helps those who are not as experienced with the raspberry pi or scripts or linux. Setting up and running a headless unit is a bit daunting I hope this guide has made it less intimidating and more familiar by staying in a desktop environment.
Updating Plexamp Pi to Newer Versions Using The Script
Updating Plexamp Pi is very easy with the script, just run the script again from the terminal just like you did for install and it should take care of the rest. That’s it done. Move on. Super thanks to odinb1 for the script.
--------------------------------------------------------------
Updating Plexamp Pi to Newer Versions Using the Desktop
If you don’t want to run the script you can also install an update by downloading the headless version and copy and paste the files in the plexamp folder. Go to the official download page and grab the latest version Plexamp.com Downloads
After Downloading you should have the following file in your downloads folder. File name in picture below is cut off but this is 4.6.2.. It doesn’t matter what version here. These are older pics but the process is the same.
Right click the compressed file and choose Extract Here a folder named plexamp should appear.
Before we do anything with this new version of Plexamp. Its a good idea to make a backup of your current plexamp folder. Simply copy the current plexamp folder and paste it into the documents folder and name the file folder Plexamp 4.6.1 or whatever the version is at the time. Ignore the version in the picture below:
Now with a safe backup open the plexamp folder that you just extracted in the downloads folder and copy everything EXCEPT the plexamp.service file. The reason we are not copying the plexamp.service file from the update is because the plexamp.service file uses Pi as the default username. If you have a different username then Pi, Plexamp won’t work. If your username is Pi then you can safely copy.
With the 6 out of 7 files copied simply paste and overwrite these files into your plexamp folder that is already in your home directory and restart your Pi. Plexamp should be running with the version you downloaded in this case Plexamp 4.6.2. Unless something has gone horribly wrong. If it has gone wrong just copy your backup into the folder, restart and try again.