Setup Unraid to pull from Docker Hub
My aunt and uncle gave me an old HP a6400f a few years ago that was just sitting in my closet collecting dust. Last year I decided I’d use it for something so I decided to set up a file server for my home. I knew I also wanted options to grow and expand its capabilities, so I ended up purchasing an Unraid license. There are options available for a home server, but Unraid seemed like it was easier to configure and get started. Another “selling point” for me was that if one drive fails I don’t lose all of my files. Meaning I can relocate the drive into another machine and can recover something rather than nothing at all.
Anyway, so I’ve been using Unraid to host a network share for about a year but lately, I’ve wanted to play around with more of its features. Over the past six months, I’ve been purchasing parts to upgrade it and finally reached a point where I had all of the parts I needed. With the new system, I can now host VMs and do more, and interesting, things with it. The first thing I wanted to do was create a MySQL container that had its own IP address.
Surprisingly, it isn’t as simple to set up as I think it should be in Unraid. A lot of the information I was looking for was scattered around the internet. I collected it all and put it here for anyone that might be wanting to do the same thing. I’m going to split this tutorial into two parts. The first will be configure Unraid to prepare it to pull images from Docker Hub and configure it to assign containers their own IP address. In the second I will setup MySQL and connect to it.
Enabling Docker Containers
You will need to first verify that you are running a newer version of Unraid. This tutorial is written for 6.5.x so the screens and workflow might change if you are using a different version.
Let’s open your Unraid server UI then go to Settings > Docker. You should see something like this:
Now, enable Docker then turn on the Advanced View (the toggle in the upper right corner). You should now see this:
We’re going to set up our own docker network by enabling the DHCP pool and setting the options we want. If you aren’t sure what to put for the other fields for DHCP pool, I’d recommend setting it to your subnet (e.g. 192.168.0.x) plus 128 then put 25 in for the drop down. Example: “192.168.0.128/25”. This will tell Unraid its allowed to assign 128 IP addresses starting at 192.168.0.128. In my case, I’m using the 10.x subnet but most routers are pre-configured to use 192.168.x.
Once you have that set up, go ahead and click Apply.
Enable fetching from Docker Hub
If you aren’t familiar with Docker Hub, it’s a repository for official Docker images from various authorities. For instance, Oracle publishes and maintains images for MySQL. I’d much rather have an official image of a program than an image someone on the internet maintains. You don’t know if they’ve done anything malicious or if they’ll just decide to stop maintaining it. Unfortunately, Unraid does not support pulling images directly from Docker Hub so, ironically, we’ll need to install a third-party plugin to do that for us.
That plug-in is called “Community Applications“. You can install it, by going to the “Plugins” tab, then selecting the “Install Plugin” subtab. In the URL input field, paste the following URL:
Then click the Install button. This will install the “Community Applications” plugin.
You may have to refresh your browser to see the new “Apps” tab.
Once you do see that tab, go ahead and click on it. You’ll see something like this:
Click on the “CA Settings” link in the upper right.
On this screen you’ll see the option for “Docker Hub Searching”, go ahead and enable it then click Apply.
This will allow you to search for images on Docker Hub through the Apps tab and create containers on your Unraid server. In the next article I’ll walk you through installing and setting up a MySQL container.