Assigning Static IP Addresses for your Docker Containers on UnRAID

Assigning Static IP Addresses for your Docker Containers on UnRAID

Docker Aug 10, 2019

Last year I build and configured setup my UnRAID server to act as my little home NAS. You can read more about how I set it up here: Building my UnRAID NAS Server

Up until now, I've been running all my Docker containers on different ports on my UnRAID server - I've assigned my UnRAID server the static port 192.168.X.X. Any time I wanted to set up a new Docker container, I would assign it another port on 192.168.X.X, for example, 192.168.X.X:8112 for my Deluge container and 192.168.X.X:7878 for my Sonarr server.

I've recently set up a PiHole sever for my home network (to block those pesky ads - mainly on my mobile devices). Click here to read about how I setup my UnRAID PiHole Docker container.

In setting up PiHole, the port 80 must be used, otherwise the container won't work. Unfortunately, port 80 is already reversed for my UnRAID server! So I had to figure out how to run my Docker container on another static IP address.

Luckily UnRAID has an excellent feature that does exactly that!

To use this feature, open up your Docker tab on UnRaid and then click on your container to access it's settings. In the settings and look for the Network Type variable and change it to: Custom. You should now have an additional field called: Fixed IP Address (optional). Go ahead and enter the static IP address that you want to use for the Docker container:

static-ip

Now you can assign the port 80 to the container and run it. You should now be able to access your Docker container at that new assigned IP address!

Tags

Harvey Delaney

Front End Engineer II at Amazon Web Services

Exclusive Usenet provider deals

Harvey's essential software engineering books

1

The Pragmatic Programmer: From Journeyman to Master

2

Clean Code: A Handbook of Agile Software Craftsmanship

3

Code Complete: A Practical Handbook of Software Construction

4

Design Patterns: Elements of Reusable Object-Oriented Software

Harvey is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com
Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.