How to setup Ghost docker on Synology NAS and host website

Palash Jain -27/04/2023
Photo by Claudio Schwarz / Unsplash
This is very simple guide to host ghost blog on your synology NAS with latest version of it.
Requirement
- Docker should be installed
- Create a folder named ghost_app and ghost_db
- Download ghost and MySQL from registry tab in Docker with
latest
tag


Create a MySQL container by going into
Docker ->Container -> Create
Select Docker Image : MySQL

Network :Bridge

Container Name: Ghost_db
and go to Advance Setting


Add the following Environment variables:
- MYSQL_ROOT_PASSWORD = mysqlrootpassword
- MYSQL_DATABASE = ghost
- MYSQL_USER = ghostuser
- MYSQL_PASSWORD = ghostpass

click SAVE and NEXT,

Don't modify and port setting , leave as it is and next,
Click add folder and choose
Docker -> Ghost-db
Add the mount path as /var/lib/mysql

Click Next and Done.
Before you go on next Step,Please give 10-15 min to installation depending on your synology NAS memory. After this please verify if your Database is ready or not.
- go to MySQL Container and go to Logs tab
- Look for the line that says
/usr/sbin/mysqld: ready for connections.
Create a Ghost container by going into
Docker ->Container -> Create
Select Docker Image : Ghost

Set Network as bridge

Container name ghost_app

Then go to Advance Setting
Add Environment variables shown as below:
- database__client = mysql
- database__connection__host = ghost-db
- database__connection__port = 3306
- database__connection__user = ghostuser
- database__connection__password = ghostpass
- database__connection__database = ghost
- url =https://blog.jainclouds.com or local NAS IP with port
Please change url based on your domain as mine is https://blog.jainclouds.com
Add below variables only if you want SMTP configuration on your ghost blog to enable Sign Up/Sign In feature for other users. Below configuration is for Gmail account.
- mail__transport = SMTP
- mail__option__host = smpt.gmail.com
- mail__option__port = 587
- mail__option__auth__user = you email address
- mail__option__auth__pass = generate you app specific password from google security
- mail__option__service = SMTP
- mail__from = your email address
check below images for clarification
after adding all variables click SAVE then click NEXT


add local port same as container port then click NEXT

Click Add Folder, navigate to the Ghost_app folder
Add the mount path as /var/lib/ghost/content
click NEXT

Click DONE

The total time to deploy this after clicking done ,can take around 10-15 min.
Please go to URL specified earlier in Environment variable.something like below or go to your local ip address defined earlier in URL Section.
You will be shown a working in progress screen.
Once that is completed, go to url/ghost to begin the setup.