Jump to content


Photo

How to: Plex Media Server on Ubuntu


  • Please log in to reply
137 replies to this topic

#1 agentbikes

agentbikes

    Member

  • Members
  • PipPip
  • 51 posts

Posted 15 May 2011 - 08:34 PM

Hi,

I thought I could write a quick HOW TO for installing PMS (Plex Media Server) on Ubuntu, because many other linux guides on the internet helped me very much previously.

 

NOTE: If you use the Ubuntu Desktop version consider using this guide. 


I used Ubuntu Server 12.04 LTS, but it should work on older Ubuntu versions, too.

First, you have to open a terminal window or ssh into your computer.

Step 1: Install Avahi

Avahi is needed for advertising Plex services. It's like Apple's Bonjour.
It is enough to copy&paste this line to install Avahi:
 

sudo apt-get install avahi-daemon


However you can do much more with Avahi. For example advertising AFP-Shares. This guide covers it.

Step 2: Install Plex
 

sudo nano /etc/apt/sources.list


Then add "deb http://www.plexapp.com/repo lucid main" to the file.
Or add "deb http://www.plexapp.com/repo beta main" for the BETA versions.
You can put it wherever you like.
Use something like ctrl+x (mac-keyboard) or Strg+x (Windows-keyboard) to close and safe the file.

Update apt-get:

sudo apt-get update


Install:

sudo apt-get install plexmediaserver


Access Plex through a browser on the computer running PMS

http://localhost:32400/manage/index.html

or any other computer (connected via LAN)

http://IP-ADDRESS:32400/manage/index.html


To initially add media to your library, you can click on one of those icons on your PMS website. For example Movies:

Plex1.png

Then you can choose a name and directory:

Plex2.png

The scanning will take a while, depending on how many movies or tv-shows you have.
You should see the progress on the web client wink.gif

 


(optional) Read this if Plex doesn't play any files:

If Plex doesn't play any files, make sure your permissions are right. Because Plex is a new User it may not have the permissions to play your media.
You can try it the easy way: Add the Plex-User to your Group:

gpasswd -a plex myuser


Or if you want to change the permissions properly (more work):

cd into your media directory, for example:


cd /home/user/media


Then look up the permissions with
 

ls -l


Here you can see if your directory has read/write/execute for every user. Its like this: (NO COLOURS in real life)

drwxrwxr-x 365 USER GROUP ---somemorestuff-- FOLDERNAME

rwx indicates read/write/execute for the USER.
rwx indicates read/write/execute for the GROUP
r-x indicates that every other user has read/-/execute access.

I would assume the User Plex only has as much access as the last three letters/hyphens (every other user).
It works for me like this so the blue bit should look different in your setup.
The easyiest thing you can do here is put the plex user in the group:
 

sudo chown YOURUSER:plex -R /home/user/MEDIADIRECTORY

This way plex will be the group and have the groups' permissions (green rwx). BUT if there is no rwx, you will have to give it read/write/execute permissions:
 

sudo chmod 770 -R /home/user/MEDIADIRECTORY


The first 7 gives the user read/write/execute permissions. The second 7 is for the group. The 0 in this case gives every other user no permissions at all.
The -R will change the permissions of all files in the folder.

Now it should look like this: (check with ls -l again!)

rwxrwx--- 365 USER plex ---somemorestuff-- FOLDERNAME


Please note: This is just an option!
A complete Linux permissions guide would be too long for this How To. But you can find plenty good Youtube videos on this topic wink.gif
This might also be helpful: https://help.ubuntu....FilePermissions
 

Update Plex: (You should do that every now and then)

Plex updates just like most of the other Linux programs. With aptitude:
(Every other programm will update too)
 

sudo aptitude update && sudo aptitude safe-upgrade

All programs mentioned here will be updated.
Then you have to type in Y to continue.
Wait...
That's it.

 

(optional) Migrate library from 0.9.2.x

Just follow this guide: http://forums.plexap...he-new-package/


If you find any mistakes please tell me and if you know how something is done better please tell me, too. wink.gif


Edited by agentbikes, 16 May 2013 - 09:17 PM.


#2 thomashw

thomashw

    Dedicated Member

  • Members
  • PipPipPip
  • 139 posts

Posted 15 May 2011 - 11:13 PM

With 64-bit Ubuntu 11.04, I didn't need to change/install anything to run the media server.

Follow me on Twitter! @thomashw


#3 Alan Morgan

Alan Morgan

    Rock Star

  • Castle Keeper
  • PipPipPipPipPip
  • 770 posts

Posted 15 May 2011 - 11:50 PM

You can also streamline the bunzip2/tar line to just "tar jxvf <downloaded_package>.tar.bz2"... no need to call bunzip2 when it's built into tar :)
Former member of the Plex for Roku development team

Units Owned: Roku 1 XD, Roku 2 XS

Posted Image

#4 mighty.boosh

mighty.boosh

    Member

  • Members
  • PipPip
  • 25 posts

Posted 16 May 2011 - 05:40 AM

This process does not work on 64 bit Karmic. Something else is missing.

#5 Alan Morgan

Alan Morgan

    Rock Star

  • Castle Keeper
  • PipPipPipPipPip
  • 770 posts

Posted 16 May 2011 - 06:40 AM

This process does not work on 64 bit Karmic. Something else is missing.


Care to elaborate on the problem you're having, maybe we can help if you provide a bit more detail?
Former member of the Plex for Roku development team

Units Owned: Roku 1 XD, Roku 2 XS

Posted Image

#6 jedi

jedi

    Dedicated Member

  • Members
  • PipPipPip
  • 159 posts

Posted 16 May 2011 - 11:31 AM

it didn't work on my ubuntu 11.04 server i386 install until i did this (as i noticed the error in the logs):

mkdir -p "/home/user/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Linux/i386/Frameworks/"

notice that you need to use quotes - as the spaces in the directory name were preventing the directory being created.

what is it with all the mixed-case filenames and directories with spaces - is it a direct port from the mac that hasn't been fixed for linux?

other than that it seems to work fine, now to import the 4.4gb database from the mac mini over nfs.....

#7 mighty.boosh

mighty.boosh

    Member

  • Members
  • PipPip
  • 25 posts

Posted 20 May 2011 - 07:04 PM

Care to elaborate on the problem you're having, maybe we can help if you provide a bit more detail?


Sorry for the late reply.
When trying to run PMS on my 64-bit Karmic i get the following error:


Plex Media Server: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by /PlexMediaServer/libcurl.so.4)

I tried this on a VM with a clean installation of Ubuntu. I am using Karmic because that is what my home server is running.

#8 puithove

puithove

    Dedicated Member

  • Members
  • PipPipPip
  • 407 posts

Posted 21 May 2011 - 04:01 PM

When trying to run PMS on my 64-bit Karmic i get the following error:


The release notes say that the Ubuntu build targets 10.01 - so perhaps you should try upgrading and see what you get. Since you've built out a VM, you have a perfect opportunity to test the upgrade of your real server on the VM so hopefully you'll be able to spot any issues prior doing it for real.

#9 Alan Morgan

Alan Morgan

    Rock Star

  • Castle Keeper
  • PipPipPipPipPip
  • 770 posts

Posted 21 May 2011 - 09:29 PM

Sorry for the late reply.
When trying to run PMS on my 64-bit Karmic i get the following error:


Plex Media Server: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by /PlexMediaServer/libcurl.so.4)

I tried this on a VM with a clean installation of Ubuntu. I am using Karmic because that is what my home server is running.


Yeah, you need lucid, maverick, or natty to run this. Karmic is too old.
Former member of the Plex for Roku development team

Units Owned: Roku 1 XD, Roku 2 XS

Posted Image

#10 mighty.boosh

mighty.boosh

    Member

  • Members
  • PipPip
  • 25 posts

Posted 24 May 2011 - 11:46 AM

Yeah, you need lucid, maverick, or natty to run this. Karmic is too old.


I upgraded to Maverick and PMS seems to work. Thanks :)

#11 snown

snown

    Member

  • Members
  • PipPip
  • 34 posts
  • Location: Oregon

Posted 25 May 2011 - 12:13 AM

When I try to run the PMS ./start.sh script on Ubuntu 11.04, I get the following

./start.sh: 7: ./Plex Media Server: not found

any ideas?

#12 Alan Morgan

Alan Morgan

    Rock Star

  • Castle Keeper
  • PipPipPipPipPip
  • 770 posts

Posted 25 May 2011 - 02:41 AM

Other people got that if they didn't have ia32-libs installed when running on 64-bit, but I didn't have to do anything under Natty to get it to run myself. Maybe see if that's installed, and if not, try installing it and see if the problem goes away? It's possible I already had ia32-libs before upgrading to Natty...
Former member of the Plex for Roku development team

Units Owned: Roku 1 XD, Roku 2 XS

Posted Image

#13 snown

snown

    Member

  • Members
  • PipPip
  • 34 posts
  • Location: Oregon

Posted 25 May 2011 - 03:10 PM

Other people got that if they didn't have ia32-libs installed when running on 64-bit, but I didn't have to do anything under Natty to get it to run myself. Maybe see if that's installed, and if not, try installing it and see if the problem goes away? It's possible I already had ia32-libs before upgrading to Natty...



Thanks Alan. I tried installing ia32-libs when I had Ubuntu 10.04, but that just seemed to make things worse there. However on 11.04 ia32-libs works great.

Thanks again.

#14 jaymelis

jaymelis

    Member

  • Members
  • PipPip
  • 26 posts

Posted 30 May 2011 - 09:51 AM

It works great.

Thanks! That linux server here cost me less then a drobo and is way more suited for my needs.

Thanks thanks thanks thanks thanks!!

#15 luka_numaios

luka_numaios

    Member

  • Members
  • PipPip
  • 12 posts

Posted 06 June 2011 - 08:51 PM

Hello All!

I up this post because I have a probleme to install plex on my ubuntu 11.04 64bit.
When I try to run it with ./start.sh, it s send me back a segmentation fault.

When I do sudo bash start.sh, it send me this :

Traceback (most recent call last):
  File "/var/PlexMediaServer/Resources/Python/lib/python2.7/logging/handlers.py", line 77, in emit
    if self.shouldRollover(record):
  File "/var/PlexMediaServer/Resources/Python/lib/python2.7/logging/handlers.py", line 155, in shouldRollover
    msg = "%s\n" % self.format(record)
  File "/var/PlexMediaServer/Resources/Python/lib/python2.7/logging/__init__.py", line 719, in format
    return fmt.format(record)
  File "/home/sam/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/core.py", line 43, in format
    return logging.Formatter.format(self, record)
  File "/var/PlexMediaServer/Resources/Python/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/var/PlexMediaServer/Resources/Python/lib/python2.7/logging/__init__.py", line 324, in getMessage
    msg = str(self.msg)
  File "/home/sam/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 144, in __str__
    self.load()
  File "/home/sam/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 99, in load
    f = self._opener.open(self._request, timeout=self._timeout)
  File "/home/sam/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 438, in open
    response = self._open(req, data)
  File "/home/sam/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 456, in _open
    '_open', req)
  File "/home/sam/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 416, in _call_chain
    result = func(*args)
  File "/home/sam/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 1217, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/home/sam/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 1192, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno -2] Name or service not known>
Logged from file peerservice.py, line 102

Do someone have a solution for that?

Thanks a lot!!!!

#16 limpan

limpan

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 17 June 2011 - 12:42 PM

Thanks for a great guide. Unfortunately it doesn't seem to work for me. I have a ubuntu server as server/router and I want to have this as my plex media server for my LG 60pz750 plasma tv( the tv has a built in plex media player). Both avahi and plex media server seems to be running when I "ps uax". But my tv doesn't find my server. I followed the guide exactly( I have ubuntu server 11.04) with these steps:

Installed avahi following the avahi guide. I suppose it is enough to follow step 4 in that guide or? Do I need to change or add something in the avahi config files?

Installed ia32-libs since I'm running ubuntu server 11.04 64bit. Downloaded latest PMS and unpacked it and changed the folder name. I start the PMS with the "nohup ./start.sh &" and I can connect "http://<localhost or ip_address>:32400/manage" and add my files. But when I try to start plex media player on my LG tv it doesn't find the PMS.

Could someone that have PMS working publish their avahi-daemon.conf, hosts and afpd.service?

What could be wrong? PMS seems to be working fine since I can add and manage my files. What do you think is wrong? Please advise.

#17 puithove

puithove

    Dedicated Member

  • Members
  • PipPipPip
  • 407 posts

Posted 17 June 2011 - 07:32 PM

But my tv doesn't find my server.


Perhaps it is the same "library doesn't show up" issue that is happening on other clients mentioned here with a solution provided in the UnRAID wiki: http://forums.plexap...ear-on-clients/

Edit: The UnRAID wiki does also specifically mention the same issue on LG clients - so yes, this may be for you.

#18 limpan

limpan

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 21 June 2011 - 05:46 PM

Thanks for the tip regarding the fix for lg clients and ios. Unfortunately it still doesn't work for me. It works great when I use plex on my iphone but my lg 60pz750 doesn't find my PMS. Any suggestions?

#19 docksteaderluke

docksteaderluke

    Member

  • Members
  • PipPip
  • 24 posts

Posted 07 July 2011 - 03:56 AM

I've got PMS up and running under Natty and everything seems to be working good except my LG TV (55LW6500) won't play movies through Media Link. It will play tv shows but not movies. It seems like it'll play small movies (~1GB or less) but any 1080p movies I have on my drive just won't play (TV is stuck at spinning circle thing). HELP!

Oh, and FYI: I've applied the unRAID fix already...

#20 docksteaderluke

docksteaderluke

    Member

  • Members
  • PipPip
  • 24 posts

Posted 14 July 2011 - 04:55 PM

Just found out that this is a known bug and should be fixed in the next release...




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users