Categories: Docker

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

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

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.

 

 

Alessandro Oppo

Alessandro è un milanese che vorrebbe scappare da Milano, è appassionato di informatica ma vorrebbe vivere senza telefono, è un artigiano eppure vorrebbe robotizzare tutto, impara una cosa e già vorrebbe studiare dell’altro. Autodidatta da sempre, gli piace sbattere la testa finché tutto non funziona come vuole lui, spesso ci riesce anche! Visita il suo blog personale alexoppo.com Il motto che si ripete dentro la testa è: “Se ci sono riusciti gli altri ci posso riuscire anche io”.

Share
Published by
Alessandro Oppo

Recent Posts

Ponti sospesi: cosa abbiamo sbagliato? cosa si potrebbe fare?

Poco prima di Natale ho avuto la fortuna di poter partecipare a un evento chiamato…

4 mesi ago

Siamo quel che facciamo? – racconto breve

Armando quel giorno era particolarmente stanco. Tutto, per quanto andasse bene, sembrava metterlo sotto pressione.…

9 mesi ago

Il limite è sempre la mente – Racconto breve

Armando guardò l’orologio e vide il proprio riflesso sul quadrante bianco. Il riflesso però non…

10 mesi ago

L’ultimo giorno del carcere – Racconto breve

I muri sono muri, lo sono sempre, anche quando le porte sono aperte. Era la…

10 mesi ago

Riflessioni sul carcere

Pochi di noi riflettono sull’esistenza nella nostra società del carcere. Il carcere è la concretizzazione…

12 mesi ago

Come dovremmo dialogare secondo me

Spesso intraprendiamo delle conversazioni e delle chiacchierate piuttosto inconsapevolmente. Voglio dire che non siamo molto…

12 mesi ago