Using Ubuntu Server as a Mediaserver

What are peoples opinions and thoughts on using Ubuntu Server 22.04 as a MediaServer as opposed to unraid or Truenas? I have been using unraid for several years and it works well but recently I have been working on Linux more in my day job and have been thinking that setting all of this up on Ubuntu Server would work. I have been playing around with Portainer on Ubuntu and deploying containers as most of the use I get out of unraid is based around containers. I feel that the other advantage of using Ubuntu would be learning more about Linux, I understand that unraid is also linux based but it seems quite different to a standard linux install. I think the main challenge I would have at this time is related to storage as my unraid box has 7 HDD’s and two SSD’s and these are all of various capacities.

2 Likes

linux (in any flavor) makes a great server. be aware of the difference in network design when using CIFS or NFS. do not be afraid to use CIFS even if the complete path is all linux based.

also, KVM is a great design for a linux server. you could use one or both KVM and portainer, especially in a somewhat ‘lab’ environment.

the more things you build and break, the more things you will be able to fix. i did a guide on here about a SAMBA4 Domain Controller, that might even be useful for you, as it could be your authentication mechanism.

Mediaserver or NAS? Theoretically, they are one and the same, but slightly different.

If you want to install and configure everything yourself, any linux distribution will do.

Will you gain something more from ubuntu than a ready-made dedicated solution? No, except for experience.

You can also look towards OpenMediaVault which is based on Debian.

1 Like

All those appliance distros like unRAID and TrueNAS come setup more fit for purpose than general purpose distro

Basic NAS stuff, SMART monitoring and alerting and some performance monitoring isn’t something you get from Ubuntu out of the box, but you can set it up… and then once you do, you’ve created a config that you’ll want to back up, … and how do you restore.

I can take a look at OpenMediaVault but that sounds like another mediaserver like TrueNas or unraid.

How would one typically restore from a backup of a config they have already created?

Open media vault, and Proxmox, can both be installed on debian as packages.does it really gain you anything? Only the experience.

You could also build out a samba server from the command line with only a text editor. Is it practical? Not really.

There’s no “typically” / “one size fits all” for backups and restores.

Backups … and restores to get your custom setup working are one of the reasons why sysadmins are drawn to “automation solutions” to help them restore by rebuilding.

By that I mean Puppet/Chef and more Ansible and docker or kubernetes, … and also VMs about a decade ago. All these things that people collectively call “gitops” now are basically just deployment automation.

Those annoying buzzwordy things, push admins into a pattern where a stack is built and rebuilt, from recipes/playbooks and from small distribution agnostic pieces, rather than being a thing that’s traditionally backed up. And, because this is complicated :slight_smile: they end up pushing you to split the use cases into containers, or to decouple code from data from config/scripts.

If you’re serious about not using an appliance distro which usually does some of this for you, I’d recommend you get a private GitHub repo, learn Ansible and docker-compose (before Ansible), and use your own Ansible playbooks or small scripts with notes to manage the Ubuntu/Alma/… host. On the host you’l probably want ssh, tailscale, zfs, some macvlan interfaces to pass to docker-compose… and no “local users” in a traditional Linux sense.

All your services, incl Samba or DNS/DHCP, https, routing and firewalling and other stuff, you can move into containers that access small or large directories of your data off of mounted paths…

One of these services will inevitably, sooner or later also end up being your own “container registry” where you store various versions of your container images that you build from your Dockerfile “scripts”, modern equivalent of old timers’ gentoo overlays or their own arch or debian package repos.


The alternative is to “yolo it” and declare “I’m am lucky my hardware will never have issues and I’ll never upgrade or have a fire/flood/lightning/house move in the middle of a busy period at work or have any kind of unfortunate event or emergency” and maybe you are lucky or maybe you “suck it up buttercup”.

It all just depends on how serious this would be for you, or how you end up thinking about this particular project.

1 Like

I’d go straight to Proxmox. There you can experiment with OMV or Unraid or TrueNAS with HDDs passed through. Pick the one you like and leave it as a virtual appliance (set a backup schedule).

Then for learning, I’d setup one or more Ubuntu Server VMs. You can install Docker, Portainer, try Swarm mode etc. If you need containers to access data stored by your NAS VM, create a CIFS docker volume in Portainer.

I’ve distro hopped between Unraid, Ubuntu, TrueNAS and even Windows… Proxmox ended that wasteful loop and now I just run all of them.

I’ve been contemplating moving from Unraid to Ubuntu/Debian for a while as well. Check out MergerFs in combination with SnapRAID for your storage array. MergerFS allows you to pool multiple drives together under a single directory like Unraid, and SnapRAID allows you to dedicate 1 or many drives to parity, although it isn’t real-time. Alex Kreschmar has great write ups on perfectmediaserver.com about both, but the gist is, you can use as many drives as you want, and they can all be different capacities, speeds, and file systems. You can install MergerFS on your new Ubuntu install, mount your existing Unraid drives, and pool them together without having to format a single drive.

MergerFS

SnapRAID

3 Likes

I used to only use Ubuntu for my home servers and media hub.

Now I use TrueNAS Scale because it’s still Linux and the docker applications available with TrueCharts is amazing.

Now my media hub has around 12 media services installed, and everything was done through the web gui with minimal tinkering.

I just retired my Ubuntu 20.04 server. It was built from reclaimed parts, stuff thrown away at work, etc. I based my storage on ZFS stripe+mirror which provided great performance. It functioned as a fileserver, Plex media server (docker), and whatever else I needed to run. I used Cockpit as the web interface for VMs running atop KVM/libvirt. It worked great for years. The retirement is because a) the hardware is out of date and b) my SAS controller died so it pushed me over the mental hurdle to replace the box. I replaced it with a Truenas Mini XL+, because I’ve wanted one for years and decided to finally spend the cash.

What did I miss with the Ubuntu box? Really the only thing is the lack of dedicated NAS hardware like instrumented drive bays. Otherwise it did a fantastic job, for years, for super cheap, and I cannot complain. If you can and are willing to afford some dedicated rig like Truenas Mini that’s awesome, but don’t underestimate the lowly Ubuntu Server on dumpster hardware, it can do a lot. I recommend keeping a copy of your data on an external drive so if you make a tragic mistake while learning you haven’t lost everything. Be careful with what’s important and then have fun learning and building.

1 Like

Thanks for all the info, I will check it out.

In my opinion there is nothing wrong with choosing a generic Linux Distribution which is not “designed” to be a NAS as a NAS operating System.

You will get a lot of experience building everything by your own and it also makes a lot of fun. But the downside is that you then also have to do it by your own.

For example if you would to have different sized disks and want to upgrade in future easily you could go with unraid because it’s array functionality supports different size disks with parity protection. But you can achieve the same scenario with snap raid if you like on ubuntu. I am not sure but would bet that this is the mechanism that unraid is using.

When it comes to container the only benefit in my opinion of unraid is that they make container networking easy in a sense that you can assign IP addresses to containers. (That’s not how you should do it but if you don’t use a reverse proxy like traefik it’s a good choice to map domains to lokal IP addresses for your services).

Hardware passthrough of GPUs and other devices is also easier with a GUI frontend like you have it on unraid and proxmox but can also be done on ubuntu.

So in my opinion you can do that but only do it for the sake of “the learning journey that comes with it” if you just want to have a system that runs with a fancy gui go for trueNAS (if you need ZFS) or Unraid (if you plan to have different size disks) or Proxmox (if that is your flavor).

1 Like

biggest downside in zfs compared to linux with lvm, is downsizing filesystems. ive looked up before i decided which way i go. im running debian with lvm with 2 hdd with different sizes. its very easy to shrink or grow it with ext4 and lvm. i think ext is the only fs that allows shrinking with the least headaches compared to zfs/lvm+btrfs.

on linux compared to unraid, u use the cli more. unraid got his gui for it. and gpu passthrow in docker container somehow works, but dunno why it works on my setup. on the host guc/huc submissions seems disabled but it works within the container. maybe a linux thing on new hardware.

After reading through the http://perfectmediaserver.com/ that was posted the author has already completed this activity on Ubuntu Server and provides detailed documentation for the reader to do the same. There is even useful automation guidance using Ansible.

I’m going to recomment FreeBSD with it’s excellent documentation and ports/package system. ZFS works out of the box and it’s very consistent which is a nice change. :slight_smile: