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
- Log in to your Synology NAS management page.
- Go to the Package Center.
- 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.
- Open the Docker app and go to the Network tab.
- Click the Add button to create a new network.
- Enter a network name, select bridge, and click Apply.
3. Set Up the MySQL Container
- Open the Docker app and go to the Registry tab.
- Search for mysql and download the latest official image.
- Go to the Image tab, select the downloaded MySQL image, and click Launch.
- Configure the settings as follows:
- General Settings:
- Container Name:
ghost-mysql
- Container Name:
- Advanced Settings:
- Enable automatic restart
- Port Settings:
- Local Port:
3306
- Container Port:
3306
- Local Port:
- Environment:
MYSQL_ROOT_PASSWORD
:your_password
MYSQL_DATABASE
:ghost
- General Settings:
4. Set Up the Ghost Container
- In the Docker app, go to the Registry tab.
- Search for ghost and download the latest official image.
- Go to the Image tab, select the downloaded Ghost image, and click Launch.
- Configure the settings as follows:
- General Settings:
- Container Name:
ghost
- Container Name:
- Advanced Settings:
- Enable automatic restart
- Port Settings:
- Local Port:
2368
- Container Port:
2368
- Local Port:
- 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
- General Settings:
5. Configure Volumes for Data Persistence
To ensure data persistence for Ghost and MySQL, configure volumes.
- In the Docker app, go to the Volume tab.
- Add new volumes and create directories for storing data.
- During the container setup, map these directories in the Volume tab.
- Ghost container:
/var/lib/ghost/content
→docker/ghost/content
- MySQL container:
/var/lib/mysql
→docker/mysql
- Ghost container:
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!