Ghost is a free and open source blogging platform like WordPress and Grav. Ghost is written in JavaScript and distributed under the MIT License, designed to simplify the process of online publishing for individual bloggers as well as online publications. Ghost CMS is actually used by millions of people. The Ghost app is a powerful app for new-media creators to publish, share, and grow a business around their content. It comes with modern tools to build a website, publish content, send newsletters & offer paid subscriptions to members. In this step by step guide I will show you how to install Ghost with MySQL as database on your Synology NAS using Docker & Portainer. Note: If you want to install Ghost without MySQL as database, follow my other Ghost Installation guide.
STEP 1
Please Support My work by Making a Donation.
STEP 2
Install Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.
STEP 3
Make sure you have a synology.me Wildcard Certificate. Follow my guide to get a Wildcard Certificate. If you already have a synology.me Wildcard certificate, skip this STEP.
STEP 4
Go to Control Panel / Network / Connectivity tab/ Check Enable HTTP/2 then click Apply. Follow the instructions in the image below.
STEP 5
Go to Control Panel / Security / Advanced tab/ Check Enable HTTP Compression then click Apply. Follow the instructions in the image below.
STEP 6
Go to Control Panel / Login Portal / Advanced Tab / click Reverse Proxy. Follow the instructions in the image below.
STEP 7
Now click the “Create” button. Follow the instructions in the image below.
STEP 8
After you click the Create button, the window below will open. Follow the instructions in the image below.
On the General area, set the Reverse Proxy Name description: type in Ghost. After that, add the following instructions:
Source:
Protocol: HTTPS
Hostname: ghost.yourname.synology.me
Port: 443
Check Enable HSTS
Destination:
Protocol: HTTP
Hostname: localhost
Port: 2368
STEP 9
On the Reverse Proxy Rules click the Custom Header tab. Click Create and then, from the drop-down menu, click WebSocket. After you click on WebSocket, two Header Names and two Values will be automatically added. Click Save. Follow the instructions in the image below.
STEP 10
Go to File Station and open the docker folder. Inside the docker folder, create two new folders and name one ghost and the other one ghostdb. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.
STEP 11
Log into Portainer using your username and password. On the left sidebar in Portainer, click on Stacks then + Add stack. Follow the instructions in the image below.
STEP 12
In the Name field type in ghost. Follow the instructions in the image below.
version: '3.9' services: ghost-db: image: mysql container_name: Ghost-DB hostname: ghost-db security_opt: - no-new-privileges:true healthcheck: test: out=$$(mysqladmin ping -h localhost -P 3306 -u root --password=superpassword 2>&1); echo $$out | grep 'mysqld is alive' || { echo $$out; exit 1; } environment: - PUID=1026 - PGID=100 - TZ=Europe/Bucharest - MYSQL_ROOT_PASSWORD=superpassword - MYSQL_DATABASE=ghost - MYSQL_USER=ghostuser - MYSQL_PASSWORD=ghostpass volumes: - /volume1/docker/ghostdb:/var/lib/mysql restart: always ghost: image: ghost:latest container_name: Ghost hostname: ghost security_opt: - no-new-privileges:true user: 1026:100 environment: database__client: mysql database__connection__host: ghost-db database__connection__user: ghostuser database__connection__password: ghostpass database__connection__database: ghost url: https://ghost.yourname.synology.me NODE_ENV: production volumes: - /volume1/docker/ghost:/var/lib/ghost/content ports: - 2368:2368 restart: always depends_on: ghost-db: condition: service_started
Note: Before you paste the code above in the Web editor area below, change the value numbers for PUID and PGID with your own values. (Follow my step by step guide on how to do this.)
Note: Before you paste the code above in the Web editor area below, change the value for TZ. (Select your current Time Zone from this list.)
Note: Before you paste the code above in the Web editor area below, change the value numbers for user with your own UID and GID values. (Follow my step by step guide on how to do this.) 1026 is my personal UID value and 100 is my personal GID value. You have to type in your own values.
Note: Before you paste the code above in the Web editor area below, change the value for url and add your own synology.me DDNS address https://ghost.yourname.synology.me that you have previously created at STEP 8.
STEP 13
Scroll down on the page until you see a button named Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.
STEP 14
If everything goes right, you will see the following message at the top right of your screen: “Success Stack successfully deployed“.
STEP 15
Go back to STEP 1 or you will deal with karma 🙂.
STEP 16
Please wait approximately 5 minutes for the installation to be completed or you will get a Synology blank page if you try to connect too soon. Now open your browser and type in https://ghost.yourname.synology.me/ghost In my case https://ghost.mariushosting.synology.me/ghost If everything goes right, you will see the Ghost installation page. Note: Don’t forget to add /ghost at the end of your DDNS to access your dashboard. Add your own Site title, your Full name, your Email address and choose a strong password. Click Create account & start publishing. Follow the instructions in the image below.
STEP 17
Start to customize your new ghost website. Click Customize your site. Follow the instructions in the image below.
STEP 18
Add your own logo, site description, icon and cover then click Save at the top right of the page. Follow the instructions in the image below.
Enjoy Ghost!
Note: Your live website will be at https://ghost.yourname.synology.me and your administrator dashboard will be at https://ghost.yourname.synology.me/ghost
Note: Can I run Docker on my Synology NAS? See the supported models.
Note: Find out how to update the Ghost container with the latest image.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: You can also use your own domain name, but in this case there are some additional STEPS needed, so it’s better to contact me.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.
This post was updated on Saturday / February 4th, 2023 at 9:58 PM