How do I host a website on my Synology NAS?

How do I host a website on my Synology NAS?

Purpose

This article shows you how to host a website on a Synology NAS and set up administrator portals for third-party web service packages, which we take Joomla, WordPress, and phpMyAdmin as examples.

Resolution

Before you start

  1. Download and install the following packages from DSM Package Center:
    • Web Station
    • PHP (such as PHP 7.3)
  2. Make sure the default group http has sufficient permissions to your website's document root (refer to this article).
  3. Set up firewall rules to safeguard your web server (refer to this article).
  4. Set up port forwarding rules to allow external access to the ports1 used for your web service:
    • DSM 7.0 and above: Configure router settings at Control Panel > External Access > Router Configuration (refer to this article).
    • DSM 6.2: Launch EZ-Internet and follow the onscreen instructions (refer to this article).

Host a website using Web Station

  1. Put your web page files to the web shared folder on your Synology NAS. You can access this shared folder via DSM File Station, SMB, etc.
  2. Configure the back-end settings for your website:
    • DSM 7.2 or above
      1. Go to Web Station > Web Service. Select Default Service and click Edit.
      2. Select your HTTP back-end server and PHP profile. Click Save.
      3. Go to Script Language Settings PHP. Under the Customized Profile section, select the default profile of your PHP and click Edit.
      4. Go to the Extensions tab. Select all the checkboxes and save the settings. For more information on script language settings, refer to this article.
    • DSM 7.0 to 7.1
      1. Go to Web Station > Web Service Portal. Select Default server and click Edit.
      2. Select your HTTP back-end server and PHP profile.
      3. Go to Script Language Settings PHP. Under the Customized Profile section, select the default profile of your PHP and click Edit.
      4. Go to the Extensions tab. Select all the checkboxes and save the settings. For more information on script language settings, refer to this article.
    • DSM 6.2
      1. Go to Web Station > General Settings. Select your HTTP back-end server and PHP profile.
      2. Go to the PHP Settings page. Select the default profile of your PHP and click Edit.
      3. Go to the Default Server Settings tab. Select all the checkboxes under Extensions and save the settings. For more information on PHP settings, refer to this article.
  3. Now you can share your website with the following URLs:2
    URL Example
    HTTP http://IP address of NAS:port number http://xxx.1.1.1:80
    http://domain name of NAS:port number http://synorocky.com:80
    HTTPS3 https://IP address of NAS:port number https://xxx.1.1.1:443
    https://domain name of NAS:port number https://synorocky.com:443

Set up admin portals for third-party web services

Install packages and configure back-end settings

  1. Download and install the following packages from Package Center:
    • Your web service package (such as Joomla)
    • MariaDB 10
    • Apache HTTP Server 2.2, 2.4, or above
  2. Configure the back-end settings for your website:
    • DSM 7.0 or above
      1. Go to Web Station > Script Language Settings > PHP. Under the Package-Based Profile section, select the PHP profile of your web service package (e.g., Joomla) and click Edit.
      2. Go to the Extensions tab. Select all the checkboxes and save the settings. For more information on script language settings, refer to this article.
    • DSM 6.2
      1. Go to Web Station > General Settings. Select your HTTP back-end server and PHP profile.
      2. Switch to the PHP Settings page. Select the default profile of your PHP and click Edit.
  3. Set up the administrator portal by the instructions in the following sections:
  4. Now you can share your website with the following URLs:2
    URL Example
    HTTP http://IP address of NAS/package:port number http://xxx.1.1.1/joomla:80
    http://domain name of NAS/package:port number http://synorocky.com/joomla:80
    HTTPS3 https://IP address of NAS/package:port number https://xxx.1.1.1/joomla:443
    https://domain name of NAS/package:port number https://synorocky.com/joomla:443

Set up the admin portal of Joomla

  1. Launch the Joomla package on your DSM. You will be prompted to enter basic information to set up your Joomla service.
  2. Follow the onscreen instructions in the wizard. On the Database Configuration page, you will be asked to delete the file named "_Joomia[…].txt" to confirm your identity. Locate and delete the file according to the following:
    • DSM 7.0 and above: Go to File Station. Delete the "_Joomia[…].txt" file under /web_packages/joomla/installation.
    • DSM 6.2: Go to File Station. Delete the "_Joomia[…].txt" file under /web/joomla/installation.
      1.png
  3. Continue the wizard and click Install.
  4. When Joomla has been installed, click Remove "installation" folder.
    2.png
  5. You are now ready to manage the admin portal of Joomla. The URL is "http://IP address of NAS/joomla/administrator/", e.g., "http://192.168.1.5/joomla/adminiatrator/".

Set up the admin portal of WordPress

  1. Launch the WordPress package on your DSM. You will be prompted to enter basic information to set up your WordPress service.
  2. Follow the onscreen instructions in the wizard and click Install WordPress.
    3.png
  3. You are now ready to manage the admin portal of WordPress. The URL is "http://IP address of NAS/wordpress/wp-admin/", e.g., "http://192.168.1.5/wordpress/wp-admin/".

Set up phpMyAdmin to manage MySQL database

  1. Launch the phpMyAdmin package on your DSM.
  2. Enter the admin credentials of your MariaDB 10.
    4.png
  3. You are now ready to manage your MySQL database via phpMyAdmin. The URL is "http://IP address of NAS/phpMyAdmin/", e.g., "http://192.168.1.5/phpMyAdmin/".

Notes:

  1. To learn more about network ports used by DSM services, please refer to this article.
  2. If your Synology NAS is running DSM 7, the URLs can be also found at Web Station > Web Service Portal.
  3. To have your website secured with HTTPS and possess a trusted certificate, please refer to this article.
  4. There are two default shared folders provided by Web Station:
    • web: Files for hosting websites can be stored in this shared folder. If your Synology NAS is running DSM 6.2 or earlier, files of installed third-party web service packages (e.g., WordPress) are also stored here.
    • web_packages (for DSM 7 only): Files of installed third-party web service packages (e.g., WordPress) are stored in this shared folder.
Purpose
Contents
Resolution
Before you start
Host a website using Web Station
Set up admin portals for third-party web services