Creating a Ghost Blog with Docker on Synology NAS

Creating a Ghost Blog with Docker on Synology NAS

Hello everyone! In this post, I will guide you through the process of setting up a Ghost blog using Docker on a Synology NAS. Ghost is a fast, powerful open-source blogging platform that can be easily installed and managed with Docker.

Requirements

  • Synology NAS
  • Synology DSM 6.0 or higher
  • Docker package installed

1. Install Docker

  1. Log in to your Synology NAS management page.
  2. Go to the Package Center.
  3. Type Docker in the search bar and install the Docker package.

2. Create a Custom Bridge Network (Optional)

Creating a custom network can facilitate communication between containers.

  1. Open the Docker app and go to the Network tab.
  2. Click the Add button to create a new network.
  3. Enter a network name, select bridge, and click Apply.

3. Set Up the MySQL Container

  1. Open the Docker app and go to the Registry tab.
  2. Search for mysql and download the latest official image.
  3. Go to the Image tab, select the downloaded MySQL image, and click Launch.
  4. Configure the settings as follows:
    • General Settings:
      • Container Name: ghost-mysql
    • Advanced Settings:
      • Enable automatic restart
    • Port Settings:
      • Local Port: 3306
      • Container Port: 3306
    • Environment:
      • MYSQL_ROOT_PASSWORD: your_password
      • MYSQL_DATABASE: ghost

4. Set Up the Ghost Container

  1. In the Docker app, go to the Registry tab.
  2. Search for ghost and download the latest official image.
  3. Go to the Image tab, select the downloaded Ghost image, and click Launch.
  4. Configure the settings as follows:
    • General Settings:
      • Container Name: ghost
    • Advanced Settings:
      • Enable automatic restart
    • Port Settings:
      • Local Port: 2368
      • Container Port: 2368
    • Link Settings: Link with the MySQL container
      • ghost-mysql:mysql
    • Environment:
      • database__client: mysql
      • database__connection__host: mysql
      • database__connection__user: root
      • database__connection__password: your_password
      • database__connection__database: ghost

5. Configure Volumes for Data Persistence

To ensure data persistence for Ghost and MySQL, configure volumes.

  1. In the Docker app, go to the Volume tab.
  2. Add new volumes and create directories for storing data.
  3. During the container setup, map these directories in the Volume tab.
    • Ghost container:
      • /var/lib/ghost/contentdocker/ghost/content
    • MySQL container:
      • /var/lib/mysqldocker/mysql

6. Access the Ghost Blog

Once the setup is complete, open your web browser and go to http://<NAS_IP>:2368 to initialize your Ghost blog.

By following these steps, you can successfully set up a Ghost blog using Docker on your Synology NAS. Make sure to verify each configuration step and modify environment variables as needed.

If you have any questions or need further assistance, please leave a comment. Happy blogging!


I hope this guide helps you set up your Ghost blog on Synology NAS!

Read more