Getting started with Docker and easily create a Dashboard/Portal for your Homelab

 

docker-logo

“What the Hell is Docker or containers?”. “Why is everyone telling me to “just run it in Docker”?”.

If you work in system administration, obsessed with your homelab, or you’ve seen the inevitable “Or you can just run it in Docker” comment on almost every “How to install _______” post on Reddit, then you’ve at least heard of Docker. Those that use it, love it, but those that are new to Linux are probably asking themselves the same questions as above or think it’s too complicated to try it out. While I’m by no means a Docker expert, I thought I’d write a noob-friendly post on two things people have been asking me to write: Getting started with Docker and creating a dashboard for your homelab or HTPC.

So what are Docker containers? Docker.com says this:

“Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.”

Basically, Docker allows you to use software (within minutes) and without having to go through any tedious install process since everything needed to run is already “wrapped” in the container. Since Docker.com already has a great Docker basics tutorial, I’ll just go over the very basics you need to know to complete everything in this post. This post is meant to show Linux & Docker newbies just how easy it is to install and get started with Docker, deploy your first “Hello World” container, and finally deploying a dashboard (Muximux) for your homelab with an easy-to-use tabbed interface. This will allow you to put all of your internal/external URLs that you normally have to go to but on one page. Remembering every URL and port number can be a pain in the ass, so a dashboard can be extremely convenient.

This slideshow requires JavaScript.

Make sure you’ve got your OS ready (I used Ubuntu Server 16.04 for this tutorial) and let’s get Docker installed first.

Installing Docker on Ubuntu Linux

1. I always make sure I’m fully updated before installing anything.

sudo apt-get update –y
sudo apt-get upgrade –y

2. We’re going to use curl to install Docker via the official script. Check to see if you’ve got it installed:

which curl

If you don’t, install it:

sudo apt-get install curl –y

3. Let’s install Docker! Your screen should look like mine below when it’s finished.

curl -fsSL https://get.docker.com/ | sh

1

4. Notice the message saying you should add your non-root user account to the “docker” group? Do it then log out.

sudo usermod -aG docker yourusername
logout

5. You’ve now got Docker installed! If you want to verify that it’s working correctly, let’s log back in and run your first container. As is tradition, let’s run “Hello World!”.

docker run hello-world

2

Run the command below to see all of your containers (it’ll probably just be the same single one as mine below).

docker ps –a

3

That’s it! You’ll notice that when you first told Docker to run “hello-world”, it tried finding it locally. Since nothing was found, it automatically pulled hello-world from the Docker Hub and ran the image. The message that appears when you ran hello-world gives you a good rundown of everything Docker did.

UPDATE: Thanks to Reddit user /u/Badabinski, I’d like to mention that it is much better to be safe than sorry when it comes to your security (just ask the lovely and I’m sure reputable company that this happened to). With that said, it’s always best to download a script first, inspect it, then run it if everything looks good. So if you’d prefer to do that with the official Docker script, do /u/Badabinski’s following advice:

curl -fsSL -o docker.sh https://get.docker.com/
# Now inspect the file
nano docker.sh
# Once you're happy that it's good, run the script
sh docker.sh

From here on, you can either start on this official tutorial that is a lot more informative on starting with Docker, or you can experiment more by creating a quick dashboard for your homelab.

Deploying a Dashboard container for your homelab or HTPC

The dashboard/portal we’ll deploy is called Muximux. More specifically, we’ll be deploying Linuxserver.io’s Muximux Docker container (and you should definitely check out their amazing list of Docker containers). This will give us a webserver and a dashboard portal with a beautiful, easy-to-use, tabbed interface that will allow us to view all of our pages we usually go to but on one single portal (it even has a mobile interface!). Let’s get started.

1. To keep things organized, let’s create a path for Docker containers leading up to Muximux’s config (in case you want to deploy any more) and then set the permissions. Use your own username, of course.

sudo mkdir -p /docker/containers/muximux/config
sudo chown -R yourusername:yourusername /docker

2. Since there can be permission issues that happen between the OS and the container, we need to take note of your user (PUID) and group (PGID) identifiers. Type the command below to find yours.

id yourusername

In my example, you’ll see my PUID is 1000 (uid=1000) and my GUID is 1000 (gid=1000).

4

3. It’s time to deploy the Muximux container. Replace the <gid> and <uid> with the numbers you took note of above. The “–restart=always” argument makes sure that the container always automatically starts up at boot up. My screenshot shows what my commands looked like before running it.

docker run \
 --name=muximux \
 --restart=always \
 -v /docker/containers/muximux/config:/config \
 -e PGID=<gid> -e PUID=<uid> \
 -p 80:80 \
 -p 443:443 \
linuxserver/muximux

5

NOTE: For some reason my container got stuck on syslog-ng starting up (shown below).

6

If yours does too, hit ctrl+c to cancel and then the following to start it.

docker start muximux

7

4. Your dashboard portal should now be running! Go to http://IP_of_Docker_host/ to make sure it is.

8

5. Click on the menu button on the top right to start adding your own URLs to the tabs, re-arrange them (it has a drag-and-drop interface), and a whole lot more. Below, I changed Sonarr out with the (clearly fake) URL to my Guacamole VM, then saved and reloaded at the bottom.

This slideshow requires JavaScript.

You’ve now not only installed Docker but also deployed a dashboard portal for your homelab! What normally would’ve taken a LOT longer was done in just a few minutes. I highly suggest playing around with Docker more and reading the documentation found on their site.

NOTE: If you want to use this in production, I’d definitely suggest changing it over to HTTPS (but read the note shown on Settings -> Show Instructions) and either securing Muximux with Basic Auth or putting it behind a password protected reverse proxy.

Getting started with Docker and easily create a Dashboard/Portal for your Homelab