I have a fairly big library of photos, videos and music. Most of it I am now hosting on this server. However, I’ve been facing two big issues:

  1. The Nextcloud gallery is terrible at displaying photos. Load times can be unbearably long, thumbnail generation can take forever and I’ve had countless issues with the styling of the gallery menu just not rendering properly.
  2. All of my videos are stored in H.265-encoded Matroska Multimedia Container (.mkv)  files. Only a few browsers can currently handle these files without a hitch, but for web browsers like Safari or Firefox, you’d have to download each file and open it in VLC player just to play it. I’m not down for that.
  3. To play music, Nextcloud requires another plugin. However, all of the available issues are just simply hideous.

Enter Plex. Plex fixes these two issues out of the box, because

  1. Plex has a beautiful gallery feature that can render thumbnails almost instantly
  2. Plex can transcode videos in the background (as long as your hardware can handle it)
  3. Plex is literally made for viewing all kinds of media, so playing music is no problem at all.

So, how did I make these two interoperate?

First of all, I should mention that I run all of my applications inside of Docker containers with defined volumes, so that every application can only access what it’s required to. Currently, every application just had its own folder on a 1TB hard drive, but this required another folder entirely to share content. Therefore, the “shared” folder was born. However, there were more things I wanted to get right:

  1. I want my movies and music inside of one folder, so that everyone who I might give access to my Nextcloud can extend the library effortlessly.
  2. I want my home videos and images inside of another folder. I don’t want anyone but me to be able to access photos and videos of me partying.

Thanks to the Nextcloud External Storage plugin, this was accomplished rather easily. I just created two separate folders (private and public), which I then restricted so that only I could access the private folder and everyone could access the public folder. I also made the “shared” directory available to Plex, so that both applications could access the same stack of media.

├── nextcloud
│   └── ...
├── plex
│   └── ...
└── shared
    ├── private
    │   └── bastian
    └── public

From there on out, it was basically plain sailing. Just point Plex to the libraries as you normally would and make sure that you don’t accidentally give any future users of Plex access to your private libraries.


Update 2024: I moved on from Plex onto Jellyfin, partially because of Plex’s licensing and paywalling of features. The rest of what I wrote here still applies, just wanted to point that out.