How to setup Ghost docker on Synology NAS and host website

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

  1. Docker should be installed
  2. Create a folder named ghost_app and ghost_db
  3. 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

Tech Savvy Explorer
Navigating the Digital World with Confidence
Get The offer Now!

Add the following Environment variables:

  1. MYSQL_ROOT_PASSWORD = mysqlrootpassword
  2. MYSQL_DATABASE = ghost
  3. MYSQL_USER = ghostuser
  4. 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.

  1. go to MySQL Container and go to Logs tab
  2. 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:

  1. database__client = mysql
  2. database__connection__host = ghost-db
  3. database__connection__port = 3306
  4. database__connection__user = ghostuser
  5. database__connection__password = ghostpass
  6. database__connection__database = ghost
  7. 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.

  1. mail__transport = SMTP
  2. mail__option__host = smpt.gmail.com
  3. mail__option__port = 587
  4. mail__option__auth__user = you email address
  5. mail__option__auth__pass = generate you app specific password from google security
  6. mail__option__service = SMTP
  7. 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.

https://blog.jainclouds.com

You will be shown a working in progress screen.
Once that is completed, go to url/ghost to begin the setup.

Read more