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.
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:
- Best Home Theater PC Build 2017 to do it all (Plex, Kodi, NAS, Gaming)
- Best Emby Server builds 2018 – Pre-built and DIY options
- Medium Budget 4K HTPC Build 2017 for Kodi, Plex and Gaming
- Cheap 4K HTPC Build for Kodi, OpenELEC, and LibreELEC 2017
- Low Power Home Server Build 2017 for Network File and Media Storage
- Best HTPC for Kodi with 4K on a Medium Budget 2017 (~$400)
- Energy efficient budget HTPC-NAS combo build 2016
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
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.
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.