DDNS-updater with Docker and Raspberry (No-IP)

DDNS-updater with Docker and Raspberry (No-IP)
docker DDNS updater cover 1024

Do you have a dynamic public IP address and you’d like to host a website at your house?

If you are using a Linux server or a Raspberry Pi this is the right tutorial for you.

I suppose that you already know No-ip and that you are tired of the No-IP DUC and that you want to install it on docker.

If you don’t know what is No-ip I’ll tell you quickly. It’s a service that allows you to simulate a static IP address for free.

To keep updated the public IP you have to install a software called No-IP DUC on your server.

I recently discovered that there is also a docker image that does it, and not just for No-IP but also for other services (Cloudflare, DDNSS.de, DNSPod, Dreamhost, DuckDNS, GoDaddy, Google, Infomaniak, Namecheap and NoIP).

It’s made by Quentin McGaw and this is the official GitHub page of the project.

This tutorial is partially copied from the original one on docker.com. Since some stuff was not totally clear to me I decided to write it with all commands, so someone else could benefit from my experience.

Execute all these commands (each one singularly, the # means that is a comment, so you don’t have to execute it)

cd
mkdir data
touch data/config.json
# Owned by user ID of Docker container (1000)
chown -R 1000 data
# all access (for creating json database file data/updates.json)
chmod 700 data
# read access only
chmod 400 data/config.json

Now we need to modify the config.json file. I’m using the nano text editor.

sudo nano data/config.json

Copy and paste this JSON file into the editor. Modify your data, then press  CTRL+X and save the file.

{
     "settings": [
         {
             "provider": "noip",
             "domain": "HOST.ddns.net",
             "host": "@",
             "username": "MAIL",
             "password": "PASSWORD"
         }
     ]
 }

Now execute  cd so you are in the main directory. This step is very important.

Finally, we can install the ddns-updater.

sudo  docker run -d -p 8000:8000/tcp -v "$(pwd)"/data:/updater/data qmcgaw/ddns-updater

Now your docker container should run and you can check the web interface going on http://yourServerIP:8000

If you see this image it means that everything is working fine.

noip docker web interface
noip docker web interface

If you want to use another port because you already used the 8000, you can change it using PORT:8000.

Let’s say I want the 8040 I have to execute

sudo docker run -d -p 8040:8000/tcp -v "$(pwd)"/data:/updater/data qmcgaw/ddns-updater

If you want that the container auto starts when you turn on the server, remember to go on Portainer and change the Restart Policies to Always.

I hope everything is clear, please leave a message if you have a problem or if the tutorial was helpful.

 

 

Start the discussion at discourse.9minuti.com