Live stream set for 2025-08-06 at 14:00:00 Eastern
Ask questions in the live chat about any programming or lifestyle topic.
This livestream will be on YouTube or you can watch below.
Setting Up Ghost CMS with MariaDB Using Podman-Compose
Introduction
Ghost is an open-source blogging and content management system (CMS) designed for simplicity, speed, and flexibility. It’s a great alternative to other CMS platforms, especially if you’re looking for a lightweight yet powerful system for blogging. In this guide, we’ll show you how to easily set up Ghost using Podman-Compose, connecting it to a MariaDB database.
Podman-Compose is a great tool for managing multi-container applications, making it easy to orchestrate Ghost and its database using containers. In this tutorial, we will guide you step by step through the process.
Prerequisites
Before we begin, ensure you have the following installed on your system:
- Podman
- Podman-Compose
- A text editor (such as VSCode or Nano)
We also recommend that you have some basic understanding of Docker, Podman, and database management systems like MariaDB. If you’re new to PHP or want to level up your programming skills, check out my book, “Learning PHP”, and my course, “Learning PHP”.
Step 1: Setting Up Podman-Compose
To begin, we need to create a directory where we will store the files for Ghost and MariaDB. Open a terminal and run the following commands:
mkdir ghost-setup cd ghost-setup
Step 2: Create podman-compose.yml
File
Inside your ghost-setup
directory, create a file called podman-compose.yml
. This file will define both the Ghost CMS container and the MariaDB container. Add the following configuration:
version: '3' services: ghost: image: ghost:latest container_name: ghost restart: always environment: database__client: mysql database__connection__host: db database__connection__user: root database__connection__password: example database__connection__database: ghost ports: - "2368:2368" depends_on: - db networks: - ghost-net db: image: mariadb:latest container_name: ghost-db restart: always environment: MYSQL_ROOT_PASSWORD: example MYSQL_DATABASE: ghost networks: - ghost-net networks: ghost-net: driver: bridge
This podman-compose.yml
file defines two services:
- Ghost: The CMS running in a container, connected to the MariaDB database.
- MariaDB: A database running in a separate container that Ghost will use to store content.
Step 3: Start the Containers with Podman-Compose
Now that your configuration file is ready, you can start the containers using Podman-Compose. In the terminal, run:
podman-compose up -d
This will pull the necessary images and start the Ghost CMS and MariaDB containers in detached mode.
Step 4: Accessing the Ghost CMS
Once the containers are running, you can access your Ghost blog by visiting:
http://localhost:2368
You should see the default Ghost welcome screen. Follow the setup process to create your admin account, and you’re ready to start blogging!
Step 5: Customize Your Ghost Installation
After setting up Ghost, you can start customizing your theme, installing plugins, and writing your blog posts. Explore the Ghost admin interface to make your blog your own.
Screenshots & Live Screencast











Need Help?
If you’re new to setting up Ghost or have specific questions, feel free to reach out! I offer one-on-one programming tutorials, including assistance with setting up or migrating your Ghost installation. Visit my contact page for more information.
Conclusion
With these simple steps, you’ve successfully set up Ghost CMS with MariaDB using Podman-Compose. Ghost is a powerful and lightweight platform for blogging, and by connecting it to MariaDB, you’re ensuring a solid database foundation for your blog.
If you’re looking to deepen your PHP skills, check out my book “Learning PHP” and course “Learning PHP”. I’m also available for personalized programming sessions and migration help if needed!