Everything began when Hostinger sent me a cold email claiming their free hosting service is about to be terminated. Until then, i hosted several of my websites, enjoying their free plan ( including this blog 🙂 ).
As i didn’t want to start paying for hosting i thought of my personal Synology NAS that is apart of my home solution for years. My NAS is always on, and my bandwidth should hold couple of sites, not speaking of the minimal storage i need, so why not using it as a personal hosting server for my lightweight minimal sites?
After sometime playing around with it , here is a guide for hosing your site on Synology NAS:
Stage 1 – open router ports
You should enable external access for the relevant ports in your router:
- DNS port – 53 tcp . The NAS will also act as a DNS server for resolving your site’s address
- HTTP\S ports : 80 , 443 tcp
Each router type has its own admin panel. For some of them Synology web app can open ports by it’s own.
Stage 2 – Upload your website:
- WebStation synology app Install and configure
- Define server side configuration – php version etc’ ( notice: for wordpress you should use apache & php5 , otherwise you site wont function ).
- If needed ( WP for example ) , install a database of your flavor ( mariadb for wp )
- Upload your site’s content.
Stage 3 – install & configure DNS server:
- Install DNS server synology app
- launch app and add new master zone
- Domain type – Forward Zone
- Domain Name – the name of your site’s domain ( for example mine netwisdom.tk )
- Master DNS server – your static IP address of your synology
- After creating Master Zone – add DNS entries as you wish
- Press on Edit->Resource Record and press on Create for needed entries, for example in my case:
And that’s it. From now on your server will answer DNS queries as you configured and will respond with same server’s IP.
What’s left to do is to configure in your DNS provider admin panel to DNS query your synology NAS URL, and that’s it!
Optional Stage – In case you wish to host several sites:
In case you need to host several sites ( like myself ) – redo all phases above for each site.
Launch WebStation app and choose Virtual Host section on the left menu. Create an entry for each site, and forward each domain to the relevant site’s storage path. For example for this site:
And that’s it !! Your site should be up and running. Enjoy 🙂