There are variables to be replaced in the following guide. These variables are enclosed between < and > like <username>. Do not replace the bash variables enclosed between ${ and } like ${USER} as they are essential for the command.
-
Install Ubuntu Server on Beelink S12 Pro
- Make bootable USB drive with the Ubuntu Server ISO
- Ensure Beelink S12 Pro is powered off
- Insert bootable USB drive into Beelink S12 Pro
- Power on Beelink S12 Pro
- Press to select the USB drive as the boot device
- Follow on-screen instructions to install Ubuntu Server
- Ensure Docker is not selected for installation
- Enable SSH access
-
Ensure Docker is not selected at install time
-
Setting the correct timezone
sudo dpkg-reconfigure tzdata
-
Install required packages
sudo apt install cifs-utils -
Create
.smbcredentialsfile for account to access network sharenano ~\.smbcredentialsContent of
.smbcredentialsuser=<username> password=<password>Setting permission that only owner can edit
chmod 600 ~\.smbcredentials -
Creating mount point folder
sudo mkdir -p /media/plex -
Test mounting the network share
sudo mount -o credentials=/home/<username>/.smbcredentials //<IP address of NAS>/<share> /media/plex # Test if the mounting works by listing it ls -lah /media/plex # unmounting it sudo umount /media/plex -
Create
/etc/fstabentry to auto-mount during boot after network is readysudo nano /etc/fstabEntry to be added
//<IP address of NAS>/<share> /media/plex cifs credentials=/home/<username>/smbcredentials,_netdev,x-systemd.automount 0 0Reloading the
/etc/fstabsudo systemctl daemon-reload -
(Optional) Test if the auto-mounting works by rebooting the system
sudo reboot # after it comes up, login in to the system and check if the share has been mounted ls -lah /media/plex
-
Removing docker snap (if installed)
sudo snap services | grep docker sudo snap stop docker sudo snap remove docker -
Install Docker CE from repo
# Install pre-requisites sudo apt install apt-transport-https ca-certificates curl software-properties-common # Downloading keys sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc # Adding docker repository for Ubuntu echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null # Installing Docker apt-cache policy docker-ce sudo apt install docker-ce # Enable docker as service sudo systemctl enable docker # Checking if docker is running sudo systemctl status docker -
Running docker command without root
sudo usermod -aG docker ${USER} -
Creating separate docker user and group for containers
sudo useradd -m plex sudo groupadd dockercontainers sudo usermod -aG dockercontainers plex sudo usermod -aG dockercontainers ${USER} # remember the following for PUID and PGID for compose.yaml later id plex -u id plex -g # Assume that the UID is 1001 and GID is 1001. You will use this value in PLEX_UID and PLEX_GID later on in the compose.yaml -
Creating local folder for mapping into containers
mkdir -p ~/dockercontainers sudo chgrp -R dockercontainers ~/dockercontainers/ sudo chmod -R g+rwX ~/dockercontainers/
-
Creating config folder
mkdir -p ~/dockercontainers/plex/config -
Creating
compose.yamlto define Plex containernano ~/dockercontainers/plex/compose.yamlContent of
compose.yamlservices: plex: image: plexinc/pms-docker:latest container_name: plex network_mode: host environment: - PLEX_UID=1001 # replace with value of id plex -u - PLEX_GID=1001 # replace with value of id plex -g - TZ=Asia/Singapore - VERSION=docker - PLEX_CLAIM=<server claim code> devices: - /dev/dri:/dev/dri volumes: - /media/plex/Movies:/Content/Movies - /media/plex/Animes:/Content/Animes - /media/plex/Serials:/Content/Serials - /home/<username>/dockercontainers/plex/config:/config tmpfs: - /transcode:size=6G restart: unless-stopped -
Starting plex container
cd ~/dockercontainers/plex docker compose up -d -
Checking plex container
docker logs plex -
Navigate to
http://<IP address>:32400/web/to access Plex webgui
docker compose pull && docker compose up -d
Force recreation of docker container to reinitialise all settings and contents not in mapped folders
docker compose up -d --force-recreate