How-To: Pianobar, a command line Pandora player

There are many different sources for free, and paid, music. I’ve not come close to trying all of them, but out of what I have tried Pandora seems to work the best for me. Plus once I found out about Pianobar I was hooked.

Pianobar is a Pandora client that runs on the command line, and for that reason it is unobtrusive and uses far fewer system resources than having another tab open in your web browser.

You can go about installing it in many different ways. Most linux distros have pre-built packages in their default repos, so you depending on what distro you are running you can run sudo apt-get install pianobar or sudo yum install pianobar, or use whatever package manager your distro is using. I use a Mac with Homebrew installed, so I just ran brew install pianobar. There is also a Windows port you can find HERE, but I have never used this and because of the differences between a *nix OS and Windows the configuration may be significantly different.

Once you have it installed you can just run pianobar from the terminal, or CMD in Windows. It will ask you for your Pandora login info, and then display your stations in a numbered list for your to select from. This works fine and you can get a full list of keystrokes by running man pianobar, or probably pianobar /? in Windows, but I like to have things setup ahead of time so I don’t have to login and select a station every time.

This next section is strictly for Linux and Mac users, as I said I have not used the Windows port of Pianobar and don’t know where it looks for its config file.

What you will want to do is create a folder ~/.config/pianobar/, in this folder you will create a file namedconfig” , you can use whatever text editor you like for this. The contents of the config file should look like the following:

user = [your pandora user name]
password = [your pandora password]
volume = -23   (This is the volume that Pianobar will set when it starts, you can adjust the number to suite your needs.)
autostart_station = [pandora station ID number] (This is the number from the station you would like to start playing. You can find this number in the URL of the Pandora website while the station is playing. So for example everything past the last / in this URL is the station number: ‘’)

Just make sure you don’t put the notes in orange above into your config file, those are just there for clarification.

Now when you run Pianobar it will automatically login and start playing the station you set at the volume you set. You aren’t stuck with these settings, it is just what is uses at startup. So you can press “s” and get a list of stations and select a different one, or use “(” and “)” to adjust volume, etc.

Tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *