Professionalize your home lab with a Raspberry PI and a NAS — Part 3

Maximilian Kilian
Mar 9 · 3 min read

Table of Content

Part 1: Modeling our network setup
Part 2: Setting up our NAS
Part 3: Setting up our Ubuntu server (that’s where you are now!)
Part 4: Putting it all together

Part 3: Setting up our Ubuntu server

TL;DR of part 2

In part 2 we have installed Open Media Vault and configured our NAS to provide us with NFS and CIFS/Samba. We extended the default OMV installation with OMV-Extras and installed the autoshutdown plugin to shutdown our NAS in case of non existent activity (electricity’s unfortunately not for free). Extending on the energy saving approach we additionally set up a cron job for OMV powering it off every day at a specific time.

Why the hell did you chose a Raspberry Pi? Doesn’t it lack the strength of handling services like Nextcloud?

Easy, the Raspberry Pi is unbelievably cheap and not using a lot of electricity. On top of that the new model 4 gives you the option of 8GB RAM, it the ideal server (if you want to know more about the electricity costs, part 1 is dealing with it!). Regarding the Pi’s power I can only say that it’s working really good for me, powering Nextcloud, GitLab, Calibre and different dockerized Apaches is not a problem at all. Of course it’s not a server with 64 cores and 128GB of RAM, but let’s be honest: If I have to wait some seconds more, it’s still fine.

Setting up Ubuntu on our Raspberry Pi

As in part 2 I won’t be covering how to install Ubuntu on our Raspberry Pi, as there are a lot of great tutorials freely available. Once again, I chose to buy a new Raspberry Pi 4b with 8 GB of Ram. This will help us to host memory consuming services like Elasticsearch (used for OCR indexing of our Nextcloud files) and GitLab.

This part will not be a lot of reading material but after the exhausting setup described in part 2 I think that’s okay! Now, let’s have a look on what we’ll be doing today.

Today’s steps of setting up Ubuntu on our Raspberry Pi

Connect your Pi to your network

The biggest pain in the a** of installing a RPI (with the exception of the headless mode) is to configure our Wifi. It doesn’t matter how often I’ve already configured and connected a Linux computer to my network, it’s still really annoying to find a “free” monitor and plug it in. On top of that you also need a preferrably wireless keyboard. Well, sorry for complaining, let’s get back to business. Check the name of your wireless interface with the following command:

ip link show

For me, the name of the wireless interface is wlan0. Keep it in mind and issue the following command:

sudo nano /etc/netplan/50-cloud-init.yaml

Your file will probably look like this:

network:
ethernets:
eth0:
dhcp4: true
optional: true
version: 2

Add the following part

network:
ethernets:
eth0:
dhcp4: true
optional: true
version: 2
# Here is where you should add your config
wifis:
[YOUR_INTERFACE]:
dhcp4: true
optional: true
access-points:
"[YOUR_SSID]":
password: "[YOUR_PASSSWORD"

That’s it! Now issue the following command and you should be provided with access to the internet.

sudo netplan apply

Configure a static ip

You have the same two possibilities as in part 2: either you configure it manually, this time through the 50-cloud-init.yaml file or you just head over to your router and check the option which is saying “always assign the same ip”. If you need help configuring a static IP, drop me a comment and I’ll add an example.

Install docker and docker-compose

We will use PiHole later on as our internal DNS server. If you would not start docker with your system rebooting, name resolution inside your network would not work out!

sudo apt install docker docker-compose

Enable docker startup on reboot

Let’s have a look at the documenation side of docker: https://docs.docker.com/engine/install/linux-postinstall/#configure-docker-to-start-on-boot

sudo systemctl enable docker.service
sudo systemctl enable containerd.service

Now is a good time to reboot your Raspberry Pi and check if all the things you have configured, are actuall working:

  • Wifi
  • Static IP
  • docker will be loaded at startup

That’s it! Quick’n’easy this time!

Part 4 is ready, check it out!

A series on how I professionalized my home infrastructure with a cheap Raspberry Pi and a self-built NAS

How to easily host your own websites and services inside your home network.

Maximilian Kilian

Written by

I love to solve problems with a technical solution and I am absolutely convinced that technology can be used to facilitate every day’s aspect of life.

A series on how I professionalized my home infrastructure with a cheap Raspberry Pi and a self-built NAS

Did you ever want to to host your own services like Apache, GitLab and Nextcloud inside your home network and be the root of your setup? After the completion of this 4 part series you’ll have an understanding of how this is possible and maybe even decide to try it out on you own.

Maximilian Kilian

Written by

I love to solve problems with a technical solution and I am absolutely convinced that technology can be used to facilitate every day’s aspect of life.

A series on how I professionalized my home infrastructure with a cheap Raspberry Pi and a self-built NAS

Did you ever want to to host your own services like Apache, GitLab and Nextcloud inside your home network and be the root of your setup? After the completion of this 4 part series you’ll have an understanding of how this is possible and maybe even decide to try it out on you own.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store