Install Plex using Docker – Media Server to Share and Stream Media

Write for Us: Familiar with Smart Home Automation, Media Streaming, HTPC, and Home Server topics? Write for us and get paid. Writing experience not required. APPLY HERE.

Plex Media Server is a service made specifically for a server or HTPC that allows you to stream your media anywhere and on any Plex compatible device. Besides streaming, this service processes your media and organizes it in beautiful libraries ready for consumption. We recently showed you how to install Plex server on Windows and Ubuntu Server. Today I will show you how you can install Plex using docker in just a couple minutes. [Read: Ultimate Smart Home Media Server 2018 in minutes with Docker and Ubuntu – Basic]

If you do not know what Docker is, be sure to read our What is Docker guide and comparison to VirtualBox in advance and get familiarized with the terms used.

Install Plex using Docker

Before starting the Docker Plex installation guide, make sure to follow our previous guides where you can learn to Install Docker on Ubuntu, Windows 10 Pro/Ent, and Windows 7 and 8.

Install Plex Using Docker
Docker Commandline Prompt

You can install Plex in a new Docker container from scratch. But, ready-made containers are already available for several apps on Docker Hub. So all you need to do is pull those containers and install. If you are ready, open Docker command prompt and get ready to setup Plex in Docker.

Recommended HTPC / Home Server Builds:

1. Docker Pull Command

To install Plex using Docker, you will first need to grab the latest version of Plex container from the linuxserver Docker Hub. LinuxServer is a Docker repository with several HTPC and home server app containers.

sudo docker pull linuxserver/plex

Pull the ready-made Plex docker container using the above command.

2. Set Plex Configuration Parameters in Docker

After pulling the container with the latest version of Plex, we need to configure the usage parameters such as download folders, port number, etc. for the service. Copy all lines in the code block below (it is one single command) and paste it into docker prompt.

sudo docker create \
--name=plex \
--net=host \
--restart=always \
-e VERSION=latest \
-e PUID=1001 -e PGID=1001 \
-e TZ=Europe/London \
-v /home/docker/plex/config:/config \
-v /home/docker/plex/tvshows:/data/tvshows \
-v /home/docker/plex/movies:/data/movies \
-v /home/docker/plex/transcode:/transcode \
linuxserver/plex

While you can just copy and paste the settings mentioned above, I recommend that you understand each parameter using the description below and customize it to your liking. Therefore, before issuing the above docker command, change certain parameters (eg. port number, folders, etc.) to fit your situation.

  • sudo docker create --name=plex \ - Creates a new docker container with the name "plex"
  • --net=host \ - Shares host networking with the plex container
  • --restart=always \ - Starts the Plex container automatically during boot.  If you don't want the container to be started automatically, you can skip this command.
  • -e VERSION=latest \ - Installs the latest version for Plex
  • -e PGID=1001 -e PUID=1001 \ - Specifies the user id in order to minimize permission issues that can arise between the host OS (Ubuntu) and the container.
  • -e TZ=Europe/London \ - Specifies the timezone information. You can check your timezone by following this link.
  • -v /home/docker/plex/config:/config \ - Specifies the location of the Plex library. In this case, the config folder is located in /home/docker/plex/ directory. Please note that this can grow very large (more than 50GB) if you have a large collection.
  • -v /home/docker/plex/tvshows:/data/tvshows \ - Specifies the location of the tvshows folder. In this case, the tvshows folder is located in /home/docker/plex/ directory.
  • -v /home/docker/plex/movies:/data/movies \ - Specifies the location of the movies folder. In this case, the movies folder is located in /home/docker/plex/ directory.
  • -v /home/docker/plex/transcode:/transcode \ - Specifies the location for the transcoding folder. In this case, the movies folder is located in /home/docker/plex/ directory.

3. Start and Stop Plex Container in Docker

If you used the correct parameters, you can go ahead and start the Plex container you have just created, using the following command.

sudo docker start plex

After starting the Plex Docker container, you will be able to open the web interface on port 32400/web. In my case the ip is 192.168.0.109:32400/web.

Plex Homepage Running In Docker
Plex Homepage Running In Docker

4. Updating Plex in Docker

Plex is now running in Docker and probably you are wondering how can you keep up to date with the latest bugfixes and features the Plex developers do. All you need to do is check for updates regularly.

In order to do that, we need to click on the Settings icon, then click on the Server tab. On this page, we can see the currently installed Plex version and the available updates. By clicking on the Download Update button, we can trigger the download the update for the latest version of Plex.  After downloading, click on the Install Update button and wait for the update to finish. 

Plex Update Steps
Plex Update Steps

If the update has been completed successfully you will be greeted by the Up to date message.

Plex is now installed in Docker. What to do next?

Congratulations! You managed to setup Plex in Docker successfully. Once Docker is setup, it is extremely simple to create and destroy containers with apps. If you want to be able to access Plex outside your home network, be sure to setup port forwarding on your router. You will have to forward the Plex port to the local/internal IP address of the system with Docker Plex installation.

In order to automate your downloads and populate your media library for Plex you can also install SickRage using docker or setup Sonarr using docker. Check back soon to learn more about Docker and how you can install various other services in Docker containers.

Did this post help you?
SmartHomeBeginner brings in-depth tutorials easy enough to understand even for beginners. This takes a considerable amount of work. If this post helps you, please consider supporting us as a token of appreciation:
  • Feeling generous? Become a Sponsor (discounted options) or a Patron. You will receive privileges on our Discord Server.
  • Just want to thank us? Buy us a Coffee or a Ko-Fi.
  • May be another day? Shop on Amazon using our links. Your prices won't change but we get a small commission.
  • Don't feel like spending? You can still show your support by sharing this post, linking to it in forums, or even commenting below.

Ciprian

Ciprian is an enthusiast, always up to date with the latest and greatest in the IT field. Passionate about computers, mobile devices and gadgets. In his spare time, he is a gamer.