How do I host a website on my Synology NAS?
Last updated:Sep 19, 2023
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
- Download and install the following packages from DSM Package Center:
- Web Station
- PHP (such as PHP 7.3)
- Make sure the default group http has sufficient permissions to your website's document root (refer to this article).
- Set up firewall rules to safeguard your web server (refer to this article).
- 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
- 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.
- Configure the back-end settings for your website:
- DSM 7.2 or above
- Go to Web Station > Web Service. Select Default Service and click Edit.
- Select your HTTP back-end server and PHP profile. Click Save.
- Go to Script Language Settings PHP. Under the Customized Profile section, select the default profile of your PHP and click Edit.
- 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
- Go to Web Station > Web Service Portal. Select Default server and click Edit.
- Select your HTTP back-end server and PHP profile.
- Go to Script Language Settings PHP. Under the Customized Profile section, select the default profile of your PHP and click Edit.
- 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
- Go to Web Station > General Settings. Select your HTTP back-end server and PHP profile.
- Go to the PHP Settings page. Select the default profile of your PHP and click Edit.
- 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.
- DSM 7.2 or above
- 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
- 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
- Configure the back-end settings for your website:
- DSM 7.0 or above
- 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.
- 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
- Go to Web Station > General Settings. Select your HTTP back-end server and PHP profile.
- Switch to the PHP Settings page. Select the default profile of your PHP and click Edit.
- DSM 7.0 or above
- Set up the administrator portal by the instructions in the following sections:
- 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
- Launch the Joomla package on your DSM. You will be prompted to enter basic information to set up your Joomla service.
- 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.
- Continue the wizard and click Install.
- When Joomla has been installed, click Remove "installation" folder.
- 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
- Launch the WordPress package on your DSM. You will be prompted to enter basic information to set up your WordPress service.
- Follow the onscreen instructions in the wizard and click Install WordPress.
- 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
- Launch the phpMyAdmin package on your DSM.
- Enter the admin credentials of your MariaDB 10.
- 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:
- To learn more about network ports used by DSM services, please refer to this article.
- If your Synology NAS is running DSM 7, the URLs can be also found at Web Station > Web Service Portal.
- To have your website secured with HTTPS and possess a trusted certificate, please refer to this article.
- 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.