For a long time I wanted to check out Nextcloud, but my setup was running fine and I didn't want to mess with a running system. As my most faithful Synology DS213+ started to slow down due to too many services running on it I finally had an excuse to start looking up new hardware. Additionally I already stacked up three Raspberry Pis and each of them were running a couple of additional services, which were not available for the NAS, e.g. Syncthing, Domoticz etc. Keeping the distributed devices up to date was becoming tedious, so I was up for some centralisation.
Although I was tempted to get a newer Synology NAS, they are great machines and are truly LTS devices, I always wanted to have something running pure Debian GNU Linux on it. Why? Because of the stability and flexibility, that's why. I had a look at buying a complete home server, but this was too expensive for my taste. Building one was also an option, but I didn't find anything compact enough and easy to build. Searching around I came a cross Intel NUC and figured out, that maybe a NUC, as a home server, plus my old reliable Synology NAS, as a RAID enabled network share, was a winning combination.
With this plan in my mind I picked up a NUC7PJYH because it was affordable and it got good reviews. I paired it up with 16GB (yes, it is supported) RAM and 512GB SSD. Then I started installing and configuring.
Installing Debian and other services
As usual I will not write down how every installation step was done. There are simply too many great tutorials around the net. I will just point you in the right direction and write about things that gave me a headache :)!
NUC7PJYH is well supported. You can install Debian from a USB stick running net-install and use your internet connection to get the needed packages. Installing base system and SSH server is enough. I didn't choose the Web server installation, because then Apache get's installed. I want to use nginx and installed that later.
There were a couple of things that made me search around:
- Although I used Wifi to install all the packages, this connection didn't stay set up when I first booted the installed system. I have no idea what is the reasoning behind this decision of Debian Team. But my home server is running with a wired connection, so this was not a big problem. If you want to run the system with Wifi, you will find a nice tutorial here.
- Even a wired connection needs some setup to run on boot. Put this in your /etc/network/interfaces to get the interface running.
auto eno1 iface eno1 inet dhcp
- I recommend installing and setting up sudo. Otherwise you have to run
su -to get the root rights.
Because I am a Nextcloud newbee I followed this tutorial to the letter and it worked (and still does) like a charm.
- I used all the packages from the Debian stable repositories. Only Nextcloud was installed from their own website.
- To setup a mail server I had to install exim4, after that all E-Mails are forwarded to a normal user.
- I setup my NAS as external storage. The users have their data, calenders etc. on the SSD of the NUC. The pictures, because they take a lot of space and are important for my family, are saved directly to the external storage.
I installed Domoticz in /opt using
curl -sSL install.domoticz.com | sudo bash under a newly created domoticz user. It worked like a charm. In order to get the log in the right place I used this tutorial.
TVheadend and Kodi
In order to get the multimedia packages installed we need a separate repo. In this repo I found current versions of both Tvheadend and Kodi.
I already wrote about configuring Tvheadend, it is the same here.
Kodi was a little bit more complicated. Here is the installation for Ubuntu. You basically install Kodi under X-Server without running a desktop enviroment. I took me sometime to wrap my head around that.
- After installing kodi-standalone package you need to setup running kodi over systemd after boot.
- Audio only works using ALSA, so we need to redirect the sound:
- Move kodi-standalone binary in kodi-standalone.orig and then create a small script called kodi-standalone with this content.
#!/bin/bash # force KODI to use ALSA for proper passthrough support AE_SINK=ALSA kodi-standalone.orig
- Kodi is packaged a little bit different in Debian. To get the Tvheadend client you have to install the package kodi-pvr-hts.
To get the sound out to my Denon Amp I got a Oelbach DAC and connected it to the NUC using a Mini TOS Link cable. Debian and Kodi work with it without any additional configuration.To control Kodi using a remote I bought a Harmony 350 and set it up using this tutorial. To program the Harmony under Linux you can install concordance and congruity packages, they work very well. After installation use the GUI application MHGUI to configure your remote.
That's it. It took me some time to set it all up but now I have an almost perfect setup. The NUC running Debian is a complete smarthome server and media server.
Although I thought that maybe NUC will have problems running all the services, there are absolutely no lags or such. The NUC is almost idling during watching TV, making backups, syncing client etc. If you have higher loads you can just pick up a NUC with a more powerful CPU. For me the Intel Pentium in NUC7PJYH is just right.