This mini “how to guide” came from a thread on this sub on how hard Plex is on a PI, and hopefully this can be helpful to others. Ref.: https://www.reddit.com/r/selfhosted/s/bYSdMVxqM0
Real-time transcoding is hard if you don’t have specialized hardware, but luckily most modern TVs and computers have specialized hardware, so you can host on a Pi to just push the files across the network and let the player do the heavy lifting.
Preface: if you’re hosting Plex on your powerful computer with GPU and using all cool features it got, great, be happy, there’s no one size fits all solution. But if all you got is a raspberry, you can get a pretty decent media hosting (minus the fancy UI) with a simple DLNA server and use VLC on the TV or PC to play the files.
It’s just two files: a Dockerfile to build the image on the PI and a docker-compose.yml to run it. There are some Docker images out there but I just don’t like them :) so built your own from the source code.
Dockerfile: (feel free to replace the git checkout v1_3_3
to any newer tag.
# builder
FROM debian:buster-slim AS builder
# install dependencies
RUN apt update && apt upgrade -y
RUN apt install -y build-essential git
RUN apt install -y autopoint debhelper dh-autoreconf gcc libavutil-dev libavcodec-dev libavformat-dev libjpeg-dev libsqlite3-dev libexif-dev libid3tag0-dev libogg-dev libvorbis-dev libflac-dev
# clone source
RUN git clone https://git.code.sf.net/p/minidlna/git minidlna-git
WORKDIR /minidlna-git
RUN git checkout v1_3_3
# build binaries
RUN ./autogen.sh && ./configure && make
# final image
FROM debian:buster-slim
# minidlna runtime dependencies
RUN apt update && apt upgrade -y
# Used `apt show minidlna` to find dependencies
RUN apt install -y --no-install-recommends libavformat58 libavutil56 libc6 libexif12 libflac8 libid3tag0 libjpeg62-turbo libogg0 libsqlite3-0 libvorbis0a
RUN apt clean && rm -rf /var/lib/apt/lists/* /tmp/*
COPY --from=builder /minidlna-git/minidlnad /usr/local/bin
CMD /usr/local/bin/minidlnad -d -r -L -f /minidlna.conf
And the docker-compose.yml:
version: '3.3'
services:
minidlna:
container_name: minidlna
image:
restart: unless-stopped
hostname: minidlna
volumes:
- :/media
- :/cache
- /minidlna.conf:/minidlna.conf
Replace in the compose to the name you use for the image, the media root folder, a cache folder for miniDLNA to use and a configuration file.
See examples of configuration here https://help.ubuntu.com/community/MiniDLNA and here https://manpages.ubuntu.com/manpages/xenial/man5/minidlna.conf.5.html and also here https://man.archlinux.org/man/minidlna.conf.5.en
And that’s about it, media hosting without costly realtime transcoding on the PI.
Warning: this mini tutorial was 100% typed while on holidays, drinking wine and copy-pasting on my tiny phone screen from my private GitHub repo, so errors might exist, be kind and just ask if anything and I’ll try to help.