In the last post we give a easy-to-follow, step-by-step instruction on how to install Centos 8 on Raspberry Pi 4.
A common usage of Raspberry Pi is to make it a media server. There are plenty of articles on how to install Plex on the native Raspberry Pi OS, or a debian based linux distribution. Here we give a short step by step instruction on how to install the popular Plex media server on Raspberry Pi 4, in Centos 8.
It is not easy, if not impossible to install native Plex Media Server package on the arm v8 architecture that Raspberry Pi 4 runs. Fortunately containerization technology provide a easy and clean way to run Plex on it. First we need to install docker:
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo dnf install -y docker-ce docker-ce-cli systemctl enable docker systemctl start docker
Install Plex Media Server
We will use the image at this git repo. Run the following command.
docker pull ghcr.io/linuxserver/plex firewall-cmd --zone=public --permanent --add-port=32400/tcp firewall-cmd --reload
The last 2 commands above assumes that you have firewalld running. If you don’t have firewall services running on your Raspberry Pi, no need to run them.
Prepare Plex Media Server Environment
You want to create several folders for your plex config and media to locate at.
mkdir -p /path/to/plex/database /path/to/plex/tv /path/to/plex/movies
Then put the following in a script on your Raspberry Pi.
#!/bin/bash docker run \ -d \ --name plex \ --net=host \ -e PUID=1000 \ -e PGID=1000 \ -e VERSION=docker \ -e UMASK_SET=022 \ -e TZ="UTC" \ -v /path/to/plex/database:/config \ -v /path/to/plex/tv:/tv \ -v /path/to/plex/movies:/movies \ --restart unless-stopped \ ghcr.io/linuxserver/plex
Run the above script and you will have Plex Media Server running. Run
docker ps to check the status.
http://<your Raspberry Pi IP>:32400/web for further configuration. There are plenty of instructions online for how to use Plex Media Server, and Plex client, etc., which is out of the scope of this article.
Now you can be a happy couch potato.