Translate

Saturday, November 19, 2022

Server chronicles - Plex on ProLiant


 One of the goals I want to achieve rebuilding the server is to reinstall services in a better way.

One of the services is my Plex server

The Plex server allows to stream my multimedia content.

On the old server was just installed as normal service, this time I wanted to install it in a docker container, to keep separate as much as possible the service.

I did find a great tutorial to do so, however I ended up mixing up the operations with other tutorials.
The installation is relatively clear, however the configuration and setting up was not really clear.

Plan

This is what I would like to obtain :

  • latest version of Plex server running in docker
  • server accessible only on my local network (no outside access allowed)
  • streaming of my local content
  • streaming from Plex subscriptions

Let start (original instructions followed here and here)

Installation

It is implicit to have docker and docker-compose already installed on the server (see Fixing the server - Docker).

The Plex itself runs in a docker container, however the data must remains somewhere in the server outside docker.

As suggested, as first thing  I did create the Plex data area in the designed docker Persistent storage area

sudo mkdir /dockerPS/plex sudo mkdir /dockerPS/plex/{database,transcode,media}

Because sudo is used, the directories are basically assigned to root !

Then I choose to install Plex using docker compose.

I so created this YML file (using different sources/examples).
The chosen  way to set up and run Plex under docker is in Bridge mode (the default).
Honestly no time/resources/willing to experiment much :)

I did obtain a claim key from my Plex account and used in the yml file (to attach the instance of the server to my account).

The docker compose file

Here the yml file used (of course the Claim key is not posted here :) )
I did call the file plex-docker-compose.yml, so is necessary to use the -f switch when running docker-compose.

cat plex-docker-compose.yml 

version: '2'
services:
  plex:
    container_name: plex
    image: lscr.io/linuxserver/plex:latest
    restart: unless-stopped
    ports:
      - 32400:32400/tcp
      - 3005:3005/tcp
      - 8324:8324/tcp
      - 32469:32469/tcp
      - 1900:1900/udp
      - 32410:32410/udp
      - 32412:32412/udp
      - 32413:32413/udp
      - 32414:32414/udp
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=USA/Chicago
      - PLEX_CLAIM=claim-xxxxxxx_xxxxxxxxx
      - ADVERTISE_IP=http://192.168.2.61:32400/
    hostname: plexserver.thefwguy.com
    volumes:
      - /dockerPS/plex/database:/config
      - /dockerPS/plex/transcode:/transcode
      - /dockerPS/plex/media:/data

At that point I just executed docker compose and created the plex docker entity on my server.

So for example, assuming to be in the directory where the yml file is, to start the server simply issue this command :

docker-compose -f plex-docker-compose.yml up -d

It did work without problems (look here for more detailed instruction)

Of course I did set up the system to run plex docker automatically when the system starts.

Since the goal is to don't have the server be reachable outside my network I didn't open any port on my router for this.

Populating the server

Ok, now the server is up and running, time to add content.

In my case of course was just matter to copy under the directory /dockerPS/plex/media my material (saved in backup) of movies and music and pictures.

Configuring Plex for local media

The trick is at this point  to let the content to be seen by Plex, a part not well covered by the instructions found.

So, having Plex working and the content copied in the directory, the fastest way to configure Plex is to open a browser and go to the address of the installed Plex.
The address is defined in the docker compose yml file :

 ADVERTISE_IP=http://<your_local_IP>:32400/
 

So the browser will point to : <your-local_IP>:32400/manage

If Plex is not configured, this will allow to enter the configuration mode, later will be enough to go in Settings.

Resources

No comments:

Post a Comment