How to Host a WordPress Website on a Synology NAS!

Today we are going to look at how to host a WordPress website on a Synology NAS.

A lot of people would like to host a website, but the monthly costs associated with web hosting isn’t always ideal. While it’s a good idea to scale your website to match the daily traffic it receives, it’s sometimes easier to host the website out of your house in the beginning. This avoids monthly charges and allows you to run the site on a device that most people have running 24/7. To be clear, Synology NAS devices don’t have huge amounts of processing power, so it’s not the best idea to host a site with a lot of traffic on a Synology NAS. In future tutorials, we will look at how to use Cloudflare which can drastically reduce the traffic demands on your local NAS, speed up performance, and increase security.

As a fun fact, this site started by being hosted on a Synology NAS. As it grew, I scaled it up to match the demand and it’s now hosted in the cloud.

1. WordPress Synology NAS Package Install Instructions

1. Open Synology’s Package Center and install the WordPress package.

wordpress synology nas

2. You will be informed that WordPress will automatically install a few different packages. Select Yes. The packages will now download and install.

wordpress synology nas

3. Create a password for the MariaDB package that’s installed. After the password has been defined, select Apply to install the package.

wordpress synology nas

3. Create a password for the MariaDB package that’s installed. After the password has been defined, select Apply to install the package.

wordpress synology nas

5. WordPress will automatically configure a database user. Enter a password that will be used for the wordpress_user.

wordpress synology nas

6. Select Apply to install the WordPress package.

wordpress synology nas

7. The WordPress package is now installed!

2. Creating a DNS Record

This part isn’t difficult, but we have to do it for a somewhat tricky reason. When you install WordPress, it will automatically install using the hostname or IP address you’re currently accessing the website with. Since opening the website will use the IP address of your Synology NAS, we need to create a DNS record or a host record on your local system before installing WordPress. Either will work, we just need to ensure that we’re accessing our WordPress site using the domain name we will be using in later steps.

For example, my site’s name will be dev.wundertech.net, so I will create a host or DNS record for dev.wundertech.net to point to the local IP address of my Synology NAS. This is only temporary, and we will remove this in a later step.

Hosts File

If you’re not using a DNS Server, follow the instructions below to modify your hosts file.

Windows 10 Instructions

Mac OSX Instructions

Ubuntu Instructions

DNS Record

Creating a DNS record will be different depending on the DNS server that you have configured. I use Pi-Hole, so I will create a Local DNS Record for my dev.wundertech.net domain and point it to my Synology NAS’s IP address.

3. Installing WordPress - Synology NAS

1. Select Open to access WordPress.

wordpress synology nas2. You will be brought to the IP address of your Synology NAS in the URL window. Change the IP address to be the domain name we created in our last step.

3. Select your language and press Continue.

wordpress synology nas

4. Create a Site Title, Username, Password, then enter your email address and search engine visibility. When everything has been entered, select Install WordPress.

wordpress synology nas

5. When it’s finished installing, you will be able to Log In using the password you created.

wordpress synology nas

6. WordPress is now installed!

4. Virtual Host Creation

The WordPress package is now installed, a DNS record has been created, and we will now update our virtual host.

1. Install the Web Station package from Synology’s Package Center.

2. Open the Web Station package and select Virtual Host. Then select Create.

3. Enter the hostname, select the web/wordpress document root, and select Apache HTTP Server 2.2 and Default Profile for PHP. Enable HSTS/HTTP/2 if you’d like. Select OK.

 

4. If you receive a message asking if you’d like to automatically update permissions, select Yes.

5. The final setting that we need to change allows PHP to access MySQL. Select PHP Settings and on the default profile, select Edit.

6. Select the checkbox next to mysqli and select OK.

5. File Changes

Technically, you will be able to get to WordPress now, but if you try and access any specific posts, you will receive an error. The reason is that our Site Address has /wordpress in the URL. We can quickly change this from the WordPress admin settings.

1. Navigate to your domain and add /wp-admin to the end.

http://[DOMAIN_NAME]/wp-admin

2. Select Settings, then General. Remove /wordpress from the end of your URL and save.

 

6. Website Exposing & Setting up an SSL Certificate

The website will now be set up and configured. Keep in mind, this is a blank website so you’ll probably want to go ahead and customize it before you expose the website to the outside internet. However, at this point, you’re ready to expose the website.

It’s very important to note that you need to have your purchased domain name ready at this point with a DNS record created. I will not be going through this process as there are tons of different registrars where you can purchase domain names, but ensure that you created a CNAME DNS record pointing to your DDNS hostname or an A record pointing to your static external IP address.

1. Ensure that you port forward ports 80 and 443 on your router to the IP Address of your Synology NAS. Make sure you create two allow firewall rules for ports 80 and 443. If you aren’t using Synology’s Firewall, I highly suggest you set it up before opening ports 80 and 443. I created a tutorial on how you can set up Synology’s Firewall if you’re interested in learning how to use it.

2. After the firewall rules have been created and you’ve port forwarded 80/443, open the Control Panel, select Security, then Certificate.

3. Select Add, then Add a new certificate, and Get a certificate from Let’s Encrypt.

4. In the Domain Name section, type your domain name and then select Apply. It will take a few minutes to validate.

5. The final step is to select Configure and select the correct certificate next to your domain name.

6. Your website is now configured with an SSL certificate and is ready for external traffic!

7. Conclusion - WordPress Synology NAS

This tutorial was meant to guide you through the entire process of setting up and configuring a WordPress website on a Synology NAS. In future tutorials, we will look at utilizing Cloudflare to use some of the free benefits that they provide.

As always, if you have any questions, please leave them in the comments. Thank you for reading the tutorial!

This Post Has 19 Comments

  1. Have you thought about updating this document for DSM 7 beta? Second do you advocate manually updating pkgs above what is in Synology as of now?

    1. I certainly will once DSM 7 is out of Beta. I will probably be redoing a lot of these tutorials!

      I normally don’t upgrade the packages, but it’s up to you. You would have to look at the individual package and see if the update is stable, so handling it on a case by case basis is best!

  2. Thanks for the tutorial! I’m attempting to migrate a WordPress website from BlueHost to my Synology. Any tips for migrating?

    1. Do you know what tool you want to use to migrate the server? I’ve migrated before using the free plugin “UpdraftPlus” and I’ve had success. There are various ways to do it though, so I don’t want to say that’s the only way.

      Let me know if I can assist at all!

      1. Hello again, I’m getting stuck on my migration. I wonder, would you be willing to chat with me and give me some help sometime?

        1. Hello – yes, feel free to email me (you can use the “tutorial request” form at the top). I will do my best to assist through email!

  3. Hello, does such a tutorial exist for DSM 7? That would be of my interest. Can not launch for several days 🙁

    1. Unfortunately, Synology takes a long time updating the packages for new DSM versions (especially beta’s), so you might have to wait until it’s updated. Another option is to run WordPress in Docker, since you won’t run into that problem (and I think the Docker package was recently updated, but I could be wrong).

  4. I just tried to migrate my WP web site from my NAS to a hosting service. And I learned that this is impossible for my site as their share and affordable plans, I am not a business, have ridiculously low database and space limits. Like disk space is still an expensive entity.
    It looks like I will stay on my NAS or a new one if I can figure out what would be the best NAS hardware for such a project. It would still be cheaper than the dedicated plans offered to accommodate my HD space requirements.
    And, of course, there is also the security issue when mixing web and local access. I am not sure whether it is save to have both on the same server hardware although on different HDs.
    Any suggestions are welcome!

    1. It’s hard to say what you should and shouldn’t do as there are various things to take into consideration. First would be uptime. If your site must be up 100% of the time, hosting it from home can be a challenge. If you are fine with the occasional downtime from a power outage or internet outage, hosting it from home is fine.

      As far as which NAS is best, I wouldn’t worry too much about the processor. Under my “recommendations” tab, I have a few listed that I personally recommend and any of them will be fine. It’s more important to have a good caching plugin and a CDN (like Cloudflare), which will drastically increase security and performance.

      So overall, if website uptime is important but not 100% uptime important, hosting a site from home is a great option. I know this was a lot so let me know if you have any specific questions!

  5. I’m trying to set up WordPress on a DS220+ On an XFINITY modem with a IP that is DHCP. I’m using Google for my domain host and I’m doing the set up using an IPad (which is another story).

    I’ve followed several tutorials before I found yours which are the best by far, and have gotten myself tied into a knot too many variables being changed at the same time. Plus Google likes to do their own thing that weren’t covered in most tutorials.

    I am now at a point where http and www take me to different sites one the Web Station welcome screen the the other to my sites welcome page and I don’t think the SSL is working. Please look at my mess and give some pointers

    1. How do your host records look? Do you have an “@” and “www” A/CNAME record that point to your external IP address? Does web station point directly to the WordPress folder, or are you pointing it to the top level folder?

      Let me know and we can continue troubleshooting!

  6. Great post tnx & keep going with these wonderfull howto’s 🙂

    You only missing one thing. You must enable OpenSSL (webstation > php settings > edit profile > openssl).
    Otherwise you get a download error when you try to update the wordpress plugins.

    The error I’ll get was: Update Failed: Download failed. No working transports found

    1. Thanks a lot for sharing your findings!

  7. Thanks for the reply! I’ll give that a shot!

  8. I’m having challenges after the first few steps… I’ve installed WordPress without any issues, I’ve added the entry to the host file

    xxxxx.com

    I then load WordPress and change the IP address to my domain and I get a 500 internal server error.

    1. Can you confirm that it’s properly using the internal IP address? You can confirm that by running command “nslookup [your domain]”.

      Let me know and we can continue troubleshooting!

  9. Thank for the tutorial. I am able to get all of my ddns to work on the internet and web pages to work thru dream weaver, my problem is that my wife uses Word Press, I was able to install word press on my 1621xs+ and I am able to create web page however when I hit publish it finishes and when I go to the URL it give me an error that is 403 and processing error. When I look at the sub-directory there is no files there. I have gone to the setting and pointed to that sub directory. Even on web station I point the root directory to all the different sub directories and just can’t find the files. I hope this is not to confusing. Much appreciate any help

    1. Have you tried appending “/wordpress” to the end of the URL to see if it works? It sounds like it can’t find any of the files. If that is the case, you might have to move the files one level up.

Leave a Reply

Close Menu