NGINX Proxy Manager Tutorial- DuckDNS Configuration – Episode 7

31, Jan 2021 | Raspberry Pi Series | 2 comments

Difficulty = Medium

Today in our NGINX Proxy Manager Tutorial which is Episode 7 in our Raspberry Pi Series. We will be looking at how to set up a fully qualified domain name (FQDN) that will point to our Raspberry Pi and will work with our Docker container applications.

To Achieve this we will be using a free online Dynamic DNS service called DuckDNS and a Linuxserver.io DuckDNS Docker container compatible with the Raspberry Pi.

With most home internet services providers (ISP), they allocate to their customers a dynamic IP addresses. What this means is the public IP address assigned to your home internet connection will change in line with a lease period.

Without Dynamic DDNS

What can also cause an IP change is if your Internet Router or Modem has to be restarted. A fresh Public IP address will then be assigned.

This becomes a problem for a home server environment because the IP address that has changed will need to be updated with the domain registrar in the form of an A entry.

If this update does not occur then your domain visitors will be unable to make a connection with your network/service and the only way to reestablish this would be to manually update the A Entry with the new IP address at the domain registrar.

To do this manually every time the IP changes would be impractical so we will need to automate the process. This is where DuckDNS comes in.

There are exceptions and times that a DDNS service would not be required and this mostly occurs in the business world. Your ISP can issue your network with a static public IP address which means your IP address will never change.

This service is usually a paid-for extra. However, if your IP doesn’t change you should check with your ISP to confirm your IP is static before setting up any direct public-facing server or service.

Duckdns does not require the use of a private domain name. It uses subdomains to forward its DDNS service. If you are looking to use your own private domain then I would recommend using Cloudflare rather than DuckDNS.

How Duckdns/Dynamic DNS) works:

We will require an additional Docker container that will monitor your Public IP address locally for any changes. If it notices that your Public IP has changed it will automatically update the IP A record on the online DuckDNS service website.

DUCKDNS Installation Guide

The First thing to do will be to set up a DuckDNS account which is easy.

Just navigate to their homepage and log in using one of the many sign in options they offer. In our example we use Google.

https://www.duckdns.org

Once logged in we are going to create a subdomain by entering into the white box a name you would like to use for your service.

Note: You will need to create a new subdomain for each docker container service you host.

In our example, we just put in “a2t“. Then click on the green “add domain” button.

This now gives us a domain name to use. In our case it is a2t.duckdns.org.

The DuckDNS service will automatically take the public IP address you are currently on and add this to the IP field. If you are using a VPN, proxy or are using any other network that is different from the one you want to host your service on you will need to update this IP manually to start with to ensure the correct IP address is used. (This will be auto-updated later by our DuckDNS container either way).

Now we have our subdomain we are going to login our Portainer instance on our Raspberry Pi and navigate to the Stacks page:

http://192.168.2.5:9000/#!/1/docker/stacks

From there we are going click on the “Add stack” button. #

This will open up a new Stack creation window. We will then name our stack “duckdns

Then in the Web editor we will paste the following Docker compose data into the empty field.

Docker Compose Stack:

---
version: "2.1"
services:
  duckdns:
    image: ghcr.io/linuxserver/duckdns
    container_name: duckdns
    environment:
      - PUID=1000 #optional
      - PGID=1000 #optional
      - TZ=Europe/London
      - SUBDOMAINS=subdomain1,subdomain2
      - TOKEN=token
      - LOG_FILE=false #optional
    volumes:
      - /path/to/appdata/config:/config #optional
    restart: unless-stopped

You will then need to change the fields to match your installation. If you would like to use a specific user account then you will need to find the PUID and GUID of that user account. We have shown how to do this in our Youtube Video so please watch that. If you would like to go with the defaults just remove both these fields as they are optional.

Set your timezone to your current location.

Add your subdomain name to the “SUBDOMAIN” field. If you have more than one you will need to add an entry for each subdomain you wish to use and separate them with a comma.

Note you do not need to add the full domain name only the subdomain part. In our example, we would only put “a2t” into the “SUBDOMAIN” field. not a2t.duckdns.org.

Add your Token to the TOKEN field, which can be found on the Duckdns subdomain creation page at the top right. This is unique to every user and only needs to be put in once regardless of how many subdomains you use.

If you would like to use logs then you can change the field to “true” this is optional.

Under Volumes add the location of where you install all your Docker data.

Now you have set them fields your Docker compose Stack should look something like this:

Now you have confirmed all is set up correctly you can press the “Deploy the stack” button.

You can now check the Portainer containers page to confirm the “duckdns” container has been created correctly.

Press the Logs button to check all is as expected. It should look like this:

To confirm your domain is working correctly you can open a browser window and enter your domain name into the address field.

http://a2t.duckdns.org

You should now see this:

This concludes today’s Tutorial.

In our next episode, we will be installing and configuring Nginx Proxy Manager to use Cloudflare’s DDNS service and setting a custom Domain. Don’t miss out! Subscribe to your Youtube channel and click the notification bell to be notified when new content goes live.

If you have benefited from our free content please support us by sharing our content, commenting below or using our affiliate links. We thank every one of you for your support and we will see you in the next one!..

2 Comments

  1. Bob

    Thank You for your wonderful sessions

    I am getting the following error message

    [s6-init] making user provided files available at /var/run/s6/etc…exited 0.

    [s6-init] ensuring user provided files have correct perms…exited 0.

    [fix-attrs.d] applying ownership & permissions fixes…

    [fix-attrs.d] done.

    [cont-init.d] executing container initialization scripts…

    [cont-init.d] 01-envfile: executing…

    [cont-init.d] 01-envfile: exited 0.

    [cont-init.d] 10-adduser: executing…

    ————————————-

    _ ()

    | | ___ _ __

    | | / __| | | / \

    | | \__ \ | | | () |

    |_| |___/ |_| \__/

    Brought to you by linuxserver.io

    ————————————-

    To support the app dev(s) visit:

    DuckDNS: https://www.patreon.com/user?u=3209735

    To support LSIO projects visit:

    https://www.linuxserver.io/donate/

    ————————————-

    GID/UID

    ————————————-

    User uid: 1002

    User gid: 100

    ————————————-

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    Your DockerHost is running an outdated version of libseccomp

    To fix this, please visit https://docs.linuxserver.io/faq#libseccomp

    Apps will not behave correctly without this

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    I am a noob

    Reply
    • Addicted2Tech

      If you have problems try the following:

      If you are running Raspberry Pi OS (Legacy) based on Buster you may need to apply the following in the terminal.

      This will enable the backported version of libseccomp2 which will allow the Radarr container to work correctly.

      sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 04EE7237B7D453EC 648ACFD622F3D138
      echo “deb http://deb.debian.org/debian buster-backports main” | sudo tee -a /etc/apt/sources.list.d/buster-backports.list

      sudo apt update

      sudo apt install -t buster-backports libseccomp2

      Source: https://docs.linuxserver.io/faq

      Reply

Submit a Comment

Your email address will not be published.

<a href="https://www.addictedtotech.net/author/attadmin/" target="_self">Addicted2Tech</a>

Addicted2Tech

We love technology and enjoy sharing helpful FREE content for others to enjoy. We believe in community. If you like what we do please support us by sharing and liking our tutorials & Subscribing to our YouTube channel. You can also follow us on social media.

Support Our Work!

Donate Via Patreon

Raspberry Pi 4 Model B [8GB] RAM Single Board Computer

Last update on 2022-05-16 / Affiliate links / Images from Amazon Product Advertising API

CanaKit Raspberry Pi 4 Extreme Kit – 128GB Edition (4GB RAM)

Last update on 2022-05-16 / Affiliate links / Images from Amazon Product Advertising API

We Are An Affiliate!

Just so you know, we may collect a share of sales or other compensation from the links on this page. As an Amazon Associate I earn from qualifying purchases.

The Affiliate link recommendations come at no extra cost to you.

We hope you love the products we recommend!

Thank you if you use our links, we really appreciate it!

Related Posts