JavaScript is required to view this page.
Skip to content
Click here for the BFCM Deals of the Week!
Click here for the BFCM Deals of the Week!
Install Plex Guide

Install Plex Guide

Guide by Greg Rodriguez.

How to Install Plex Media Server in Docker on ODROID H4+/H4 Ultra with

OpenMediaVault (OMV)

In this guide, we’ll cover how to install Plex Media Server in a Docker container using OpenMediaVault (OMV) on the ODROID H4+/H4 Ultra. Plex is powerful software that turns your computer into a media server enabling you to organize and stream your personal media over your home network to devices such as smart TVs, computers, and phones. Plex also enables you to stream your personal media from home to anywhere with an internet connection, and can even convert your personal media on-the-fly using the H4’s iGPU to a format compatible with the device you’re playing from. Note that in order to enable hardware accelerated transcoding on the H4, a Plex Pass is required.

Prerequisites:

This guide is a continuation of the "Install OMV Guide" and assumes you have followed that guide and have OMV installed and your hard drive(s) formatted. If you have not, please refer back to that guide for instructions.

1. Creating Folders

Following the guide linked above, you should already have OMV installed and a formatted hard drive ready to begin installing Plex Media Server. We’ll start by creating the folders necessary for Docker and Plex. Navigate to Storage → Shared Folders and click the plus sign. Click under Name and type docker. Click under File system and select /dev/sda1. Click under Permissions and change it to Administrator: read/write, Users: read/write, Others: no access. Click Save and then click the check mark in the yellow box to apply pending configuration changes. Repeat these steps 2 more times creating folders named plexdata and media.

2. Adding OMV-Extras

Next, we need to add the OMV-Extras repository so we can install Docker. In order to do this, we need to run a script from the command line. This can be done from our computer using a protocol called SSH to access OMV’s command line interface. If you’re using Windows, click the Start button, and type “Windows PowerShell” and open it. If using a Mac, press the Command key and the Spacebar together on your keyboard to bring up Spotlight, type “terminal” and open it. In the new window type the command:

ssh root@omv.local

and press Enter. If this is the first time you’re connecting to OMV over SSH, you will be asked if you’re sure you want to connect. Type yes and press Enter. Lastly, you’ll be asked to type the password for root. This is the password set up while installing OMV. Type the password and press Enter, but note that you will not see any characters on the screen as you type the password, so just take your time typing.

After logging in via SSH you should now be sitting at a prompt like this:

root@omv:~#

Copy and paste the following command into the window and press Enter:

wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash

It may take a few minutes, but when finished will come back to the root@omv:~# prompt. It’s okay to leave this window open for now as we’ll need it for one more step later in the guide.

Go back to the OMV web interface. Navigate to System → omv-extras and check the box next to Docker repo and click Save. After that click the apt clean button at the bottom of the page and wait for it to finish. Next, navigate to System → Plugins and there should be a list of plugins for OMV. Scroll through the list and find openmediavault-compose. Click on it once to select the plugin, then click the install button above that looks like a downward-facing arrow. When finished installing, the web interface may reload.

With the OMV compose plugin now installed, we can use it to fully install Docker. Navigate to Services → Compose → Settings. Under the Compose Files section click and change Shared folder to docker on /dev/sda1. Under Permissions of directories and files set it to Administrator - read/write, Users - read/write, Others - no access. Scroll to the bottom of the page and save. Under the Docker section of that page, the Status should say that Docker is not installed. Click the Reinstall Docker button to the left of the save button and let it install Docker. When it’s finished, refresh the web page and the status should now say Installed and running.

3. Creating A New User And Sharing Media Folder

With Docker successfully installed, there are only a few steps remaining before we can begin building our Plex container. The first one is to create a new, non-admin user that will be used to run Plex and to access the media folder we’re going to share over the network. Begin by navigating to Users → Users and clicking the blue plus sign, then clicking Create. For the name type appuser. Set the password to something secure, but different from the root or admin passwords created earlier. Click on Groups and check docker and users. Click the Save button and apply pending changes.

Next, we’ll share the media folder that we created in Section 1 of this guide so it can be accessed over the network to add media files. To do this, navigate to Services → SMB/CIFS → Settings, check the Enabled box at the top of the window, then save and apply pending changes. Next, navigate to Services → SMB/CIFS → Shares and click the blue plus button. Under Shared folder select media on /dev/sda1. All other settings should be left default. Scroll to the bottom, save, and apply pending changes.

The media folder should now be shared on the network, but we need to verify this and add some media files. To access the shared folder from Windows, open File Explorer and type:

\\omv.local\media

in the address bar then press Enter. It may take a while, but eventually, you should be prompted to enter a username and password. Type appuser for the username and whatever you set the password for appuser to. If done correctly, you should now be in the empty media folder.

If using a Mac, open Finder, then press the Command and K keys on your keyboard together. This should open the Connect to Server dialog window. In the address bar type:

smb://omv.local/media

and click Connect. You should be notified that you’re trying to connect to the server omv.local, click Connect again. On the next window make sure Registered User is ticked, then type appuser for the name and the password you set for appuser. If done correctly, you should now be in the empty media folder.

Now that we’ve accessed the shared media folder, create the following 3 folders from within Finder on Mac or File Explorer on Windows: Movies, Music, TV. Once you’ve created the folders, you can begin copying your media files to them. Movie files go in the Movies folder, music files go in the Music folder, etc. For the best results, consider following Plex’s naming conventions for media files and folders. Doing so now will make it easier for Plex to properly detect your media and download the correct metadata for it.

4. Creating Plex Container

With everything else set up, we can finally create our Plex container. While we could build our own Plex image from scratch, the team at linuxserver.io maintains a prebuilt image that is ready to go and updated very regularly. In order to use this image, we’ll be using a modified version of their Docker Compose file. The compose file simply contains the info needed for Docker to download their image and run it on OMV. Begin by copying the code below and pasting it either in Notepad on Windows, or TextEdit on Mac.

---
services:
  plex:
    image: lscr.io/linuxserver/plex:latest
    container_name: plex
    network_mode: host
    environment:
      - PUID=1000
      - PGID=100
      - TZ=America/Los_Angeles
      - VERSION=docker
      - PLEX_CLAIM= #optional
    devices:
      - /dev/dri/:/dev/dri/
    volumes:
      - ABSOLUTE_PATH_TO_PLEXDATA_FOLDER:/config
      - ABSOLUTE_PATH_TO_MEDIA_FOLDER:/plexmedia
    restart: unless-stopped

We will need to edit some of the parameters of this file to match our install of OMV. Note that whenever we edit anything in this file it’s very important not to remove any of the dashes or change the indentation/spacing of any of the text as that will cause this configuration not to work.

The first thing we need to check under environment is the PUID and PGID. Normally, the first user you create in OMV gets assigned the User ID of 1000 and Group ID of 100, but we need to verify this is correct on your system. This is how we run the Plex container as appuser, so it’s important to get it right. To do this, we’ll go back to the window where we have our SSH session open from Section 2. If the session has timed out, close the window and follow the steps in Section 2 again to reconnect and log in to OMV over SSH. Once logged in, we only need to type the command:

id appuser

and press Enter. The output of that command should look something like this:

uid=1000(appuser) gid=100(users) groups=100(users),990(docker)

We only care about the first 2, uid and gid. If yours are 1000 and 100 respectively, then you don’t need to change them in the text file. If they’re different, then change PUID and PGID in the text file to match.

Next, find and change the TZ=America/Los_Angeles line to match your local time zone.

You can find a list of time zones here. There isn’t an entry for every city in the world, so just pick one in your time zone.

The final edit we need to make is to the volumes section. This section is used to map folders from the host (OMV) into virtual folders in the Plex container. The first entry ABSOLUTE_PATH_TO_PLEXDATA_FOLDER:/config will map the plexdata folder we created in OMV to the virtual folder config inside the Plex container. This is going to be the folder where Plex stores its library database. We need to replace ABSOLUTE_PATH_TO_PLEXDATA_FOLDER with the true path to plexdata on OMV. To get this path, go back to the web interface and navigate to Storage → Shared Folders and find the plexdata folder in the list. In the Absolute Path column, it should list the true path to the plexdata folder, and there should be a button at the end of that path to copy it to the clipboard. Click the button and move back to the text file. In the text file, drag your cursor and highlight only the text ABSOLUTE_PATH_TO_PLEXDATA_FOLDER. Remember, we do not want to change or remove the dash and space in front of that, or the colon or anything after that, so make sure your selection is accurate. Paste the path you copied from the web interface into the text file. Follow the same procedure again, this time getting the true path for the media folder and pasting it over ABSOLUTE_PATH_TO_MEDIA_FOLDER. With our Docker Compose file complete, you may consider saving the text file to your computer in case you ever need to delete the Plex container and create it again.

Go back to the web interface and navigate to Services → Compose → Files. Click the blue plus button, then click Add. Under Name, type Plex. In the File section, copy and paste the entire contents of the text file. Scroll to the bottom and save. You should now see an entry for Plex, and the status should be Down. Click Plex once to select it, then click the check button above to check the config for syntax errors. If there are no errors, you can safely click the up button to pull the linuxserver.io image and start it. When it’s finished, the status of Plex should now say Up.

5. Claim And Configure Plex Server

The Plex server is now running, but we need to claim it with our Plex account and set up the libraries within Plex. To do this, open a new tab in your web browser and type omv.local:32400/web in the address bar, then press Enter. You may need to sign into your Plex account. After that, a window that says “how Plex works” will load. Click on Got It to proceed. Next, you’ll be asked to give the server a friendly name, which will likely default to omv. This is how the server will be identified within Plex. You do not need to use omv; you can name the server whatever you like. Click Next to begin adding your libraries. Click Add Library, select Movies, and click Next. Click Browse for Media Folder, find the plexmedia folder in the list, and click it. Select the Movies folder, click Add, then click Add Library. Repeat the process if you wish to add music and TV libraries. When you’re done adding libraries, click Next then Done. Plex should begin scanning and adding your media to the libraries.

The final thing to do is verify that the H4’s iGPU is properly detected and that Plex is set to use it for video transcoding. In the Plex web interface, click the wrench icon in the upper right corner. Then on the left, scroll down and click on Transcoder. You should be able to change Hardware transcoding device from Auto to Alder Lake-N [UHD Graphics]. Also, verify that Enable HDR tone mapping, Use hardware acceleration when available, and Use hardware-accelerated video encoding are all checked, and click Save Changes. Note once again that hardware acceleration requires a Plex Pass, and if you do not have one, these options will not be available. The server will still be able to stream media to devices, but if that media needs to be transcoded on the fly for compatibility, the server will likely struggle without hardware acceleration.

Congratulations! If you followed all the steps, you should now have a working Plex server.

Previous article Holiday Lighting with Shelly Plus RGBW PM and Firefly Script: A Creative Guide
Next article Install OMV Guide

Leave a comment

Comments must be approved before appearing

* Required fields

x