Build Website in Synology NAS, Using DDNS and Port Forwarding

Recently I bought Synology NAS as a home network storage, and since then, I have been amazed by the possibilities of using my NAS. Other than data storage for files, media, system backups, I found services that provide the functionality to your networks like Router, DHCP, DNS., and other services for productivity like Dev tools, Web, Virtual Machines, Docker, and more. This is where it came to my mind the idea of building my personal website. Building a blogging website from a cloud provider is simple. By using a wizard next-next approach includes some costs. But making my website from ground zero and publish it using only your NAS storage and Home network is Tricky. with no charges.

Another advantage is you have the flexibility to choose and change the website engine whatever you want. As it turns out, you can run WordPress, Drupal, or only static HTML. run it in a VM or Docker or Web Station that ships with Synology NAS, In my case, I have not much knowledge of web development, so I will stay with WordPress There is only one downside: if your audience grows, it can lower your website performance depending on your NAS hardware configuration. Initially, a website without visitors will not consume resources from NAS. In my case, my NAS has only 2 GB of memory, and only 1 GB is consumed from all running services, and the website is healthy with no performance issues.

General Design:

Visitors Traffic

Website Viewers are getting website addresses from your domain DNS provider, where IP A record is maintained. In case of an IP address change of your internet provider, DDNS Service provides the new IP address to the DNS provider. After the DNS process, Viewers connected to your home router, where in return, forwards your traffic to your Synology NAS where it runs WordPress Installation on port 80/443 (HTTP/HTTPS).

Steps:

A- Buy a Domain ( I promise the only thing you will buy ).

B- WordPress Installation.

1 – Removing /wordpress from URL

2- Configure SSL Certificates

C- Configure Home Router (Port Forwarding)

D- DDNS Configuration.

What is DDNS, and Why it is required?

DNS is responsible for translating domain names into IP addresses. in case you have a static IP address from your internet provider. its Ok proceed to map your domain name with that static IP. but for most cases, our home networking public IP address is changing after every router reboot, and that is not cool if you host a website in your network, your visitors sooner or later will get 404, not found. It is like inviting a friend to your home, and after he went to your address, he couldn’t found you, simply you moved to another address !

This is where DDNS comes into play (DDNS stands for Dynamic Domain Name Services). It resolves that issue so you can access your website or server from anywhere in the world without worrying about changes to your IP address.

Execution:

A- Buy a Domain

It is easy and tricky at the same time. I spent some time looking for a proper name for my blog. As it turns out, many factors affect the cost of your domain based on the name of your choice. and domain suffix For example .com .net .org is more expensive than others .info .it .me, short words as well, you need some time to get the right price and domain search engine will suggest different prices to pick.

Godday.com was my Domain provider of choice to pick a domain. I like the dynamic interface, and they are professionals in that field from long ago. BUT I didn’t pay much attention to the fact that they didn’t offer a DDNS required at Step (C). I figured out that after purchasing my domain. So the following explanation is only needed if you have the same issue.

Problem: I own a Domain in Godaddy.com, but they didn’t support DDNS

Solution: Transfer your Domain DNS provider (Godaddy in this case) to another provider where Supporting DDNS

Dynu.com is a free DNS provider that supports DDNS, in order for Dynu DNS take control of your DNS, you have to update NS records from Godaddy to dynu as follows

Update dynu.com NS record in Godaddy

In GoDaddy domain configuration change nameservers ns record to dynu.com ns records, you can get dynu ns records from the following page.

View of NameServers NS Records in GoDaddy

After this step, you will not be able to manage your DNS records in Godday anymore, it is controlled by Dynu DNS after the previous configuration.

please follow at the end of this article, I will preset DDNS configuration in Section D.

B- WordPress Installation

WordPress Installation In this configuration, There is a couple of options you choose from:

1- Install WordPress from Synology Package Center

OR

2- Install WordPress from wordpress.org

Comparison PointsFrom Synology Package CenterFrom WordPress.com
Process Time10-15 mintues2-4 Hours
WordPress UpdatesEvery 6 monthEvery 3 month
HTTPS SSLHard to Implement if not imposibleEasy to implement
visitors accessfor Local LAN Home Network+ Internet
Access Method /wordpress/wordpressCan be removed
DifficultyEasy To Setup Hard To Setup
Final Result⭐⭐⭐⭐⭐⭐⭐
WordPress Comparision

Steps of Installing WordPress from wordpress.com in Synology NAS:

Paul Steunebrink from his blog The Storage Alchimist has written a detailed explanation about installing WordPress on Synology NAS. I have followed his guide and it works.

Install the following prerequisites from Synology Package Center

  • Web Station
  • HTTP Server 2.4
  • PHP 7.3 and 7.4
  • phpMyAdmin
  • MariaDB 10
    • It prompts you to enter the password. Remember the entered password as you will use it later.

1- Removing /wordpress from URL

By default, your website viewers will be able to view your website after typing the “/wordpress” page at the end of your domain name. We will change that by removing “wordpress” from the URL. from the WordPress admin portal in this optional configuration. Navigate to WordPress admin portal http://<IP>/wp-admin Settings – General

remove /wordpress from “WordPress Address (URL)” and “Site Address (URL)

Please note this option is dimmed out if you contining with WordPress that is installed from Synology Package store. only avaiable in custom wordpress installation

2- Configure SSL Certificates

This step will cover how to configure an HTTPS certificate so your visitors can connect securely to your website. It is a MUST as you will publish your website over the internet, and it gives trust to your viewers that the data retrieved from your website is encrypted.

Synology NAS gives you a big hand here. You can request a certificate from the Synology NAS Certificate service and assign it to your domain. Navigate to “Control Panel” – “Security” – “Certificate” – “Add”

  • provide your domain details
  • Go back to your WordPress Settings and make sure that you are using https in the domain name URL

C- Configure Home Router (Port Forwarding)

The home router is your local network is gateway to the internet. Your internet service provider assigns a dynamic IP Public/External to your router to perform NATing for the internet traffic. In this step, we want to make sure that your web visitors connected to your router public IP using HTTP or HTTPS are forwarded to your NAS WordPress. Assuming you have completed WordPress installation and configuration. And able to access your WordPress using HTTPS securely.

Most routers has this option under “Security” —> ” Port Forwarding”

  • Create new two rules to forwarding HTTP and HTTPS Traffic to your NAS as below

please note that after configuring port forwarding on your router, you will not be able to connect to your website from your local network as it is meant to serve a public internet network. As a workaround, you can use a free VPN solution so you will be able to view and manage your website.

D- DDNS Configuration

To set up a DDNS hostname:

  1. Go to Control Panel > External Access > DDNS.
  2. Click Add.
  3. A dialog box appears prompting you to edit the following settings:
    • Service provider: Select a service provider. To register for a free hostname provided by Synology, choose Synology from the drop-down menu.
    NOTE: in our case, Create a new Custom Provider
    • Hostname: Enter a registered DDNS hostname, such as . john.synology.me
    • Username/Email: Enter the username/email for your DDNS provider.
    • Password/Key: Enter the password/key for your DDNS provider.
    • External address: Enter the external IP address of the Synology NAS which will use the hostname.
  4. Click Test Connection to see if settings are correct.
  5. If you select Synology as the service provider, you can configure the following settings:
    • Get a certificate from Let’s Encrypt and set it as default: Tick the checkbox to apply a Let’s Encrypt SSL certificate for your Synology DDNS and set it as the default certificate for DSM. However, if an SSL certificate is already matched for your DDNS hostname, the checkbox will be disabled. For more information on the SSL certificate, please refer to this article.
    • Enable Heartbeat: Tick the checkbox to receive alerts regarding the status of the mapped hostname.
  6. Click OK to save and finish.

Creation of Custom provider dynu.com

Provider name: dynu.com

Provider URL:

<http://api.dynu.com/nic/update?myip=__MYIP__&username=__USERNAME__&password=__PASSWORD__>

After apply DDNS configuration, any new IP changes will reflect in your DNS Provider without any interruption.

Share