Ghost Blog
Modern publishing platform for blogs and newsletters.
Overview
Ghost is a modern, open-source publishing platform designed specifically for creators, bloggers, and businesses who want professional publishing capabilities without WordPress complexity. Born from a Kickstarter campaign in 2013, Ghost focuses exclusively on content creation, offering a clean writing experience with built-in membership systems, newsletter functionality, and monetization tools. Unlike traditional CMS platforms that try to do everything, Ghost excels at one thing: helping creators build sustainable publishing businesses.
This Ghost and MySQL stack creates a powerful publishing environment where Ghost handles content creation, membership management, and newsletter distribution while MySQL provides reliable, high-performance data storage. MySQL's proven track record with content management systems makes it ideal for Ghost's post storage, member databases, and subscription tracking. The combination offers professional publishing features typically found in expensive SaaS platforms while maintaining complete control over your content and subscriber data.
Content creators, newsletter publishers, membership site operators, and businesses building thought leadership platforms will find this stack particularly valuable. Ghost's built-in Stripe integration enables immediate monetization through paid memberships, while its headless API allows custom front-end development. This setup provides the perfect balance between powerful publishing features and technical flexibility, making it suitable for everything from personal blogs to enterprise content marketing platforms.
Key Features
- Built-in membership system with subscription tiers and payment processing via Stripe
- Native email newsletter functionality with subscriber management and analytics
- SEO-optimized publishing with automatic meta tags, structured data, and sitemap generation
- Modern Ghost Editor with Markdown support and rich media embedding
- Content API for headless CMS functionality and custom front-end development
- MySQL 8.0 InnoDB storage with ACID compliance for data integrity
- Professional theme system with customizable designs and responsive layouts
- Advanced analytics and member engagement tracking
Common Use Cases
- 1Professional bloggers monetizing content through paid memberships and newsletters
- 2Small businesses building thought leadership and customer engagement platforms
- 3Newsletter publishers migrating from services like Substack or ConvertKit for more control
- 4Content creators needing both public blog and private member-only content areas
- 5Marketing teams managing company blogs with multiple authors and editorial workflows
- 6Developers building custom publishing platforms using Ghost's Content API
- 7Membership sites offering premium content and community features
Prerequisites
- Minimum 1GB RAM recommended for Ghost and MySQL combined operation
- Docker and Docker Compose installed with support for multi-container networking
- Port 2368 available for Ghost web interface access
- Valid domain name and SSL certificate for production newsletter and membership features
- SMTP service configured for Ghost email functionality (newsletters, member invitations)
- Basic understanding of Ghost admin interface and MySQL database concepts
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 ghost: 3 image: ghost:5-alpine4 container_name: ghost5 restart: unless-stopped6 environment: 7 url: ${GHOST_URL}8 database__client: mysql9 database__connection__host: mysql10 database__connection__user: ${MYSQL_USER}11 database__connection__password: ${MYSQL_PASSWORD}12 database__connection__database: ${MYSQL_DATABASE}13 volumes: 14 - ghost_content:/var/lib/ghost/content15 ports: 16 - "2368:2368"17 depends_on: 18 - mysql19 networks: 20 - ghost-network2122 mysql: 23 image: mysql:8.024 container_name: ghost-mysql25 environment: 26 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}27 MYSQL_DATABASE: ${MYSQL_DATABASE}28 MYSQL_USER: ${MYSQL_USER}29 MYSQL_PASSWORD: ${MYSQL_PASSWORD}30 volumes: 31 - mysql_data:/var/lib/mysql32 networks: 33 - ghost-network3435volumes: 36 ghost_content: 37 mysql_data: 3839networks: 40 ghost-network: 41 driver: bridge.env Template
.env
1GHOST_URL=http://localhost:23682MYSQL_ROOT_PASSWORD=rootpassword3MYSQL_DATABASE=ghost4MYSQL_USER=ghost5MYSQL_PASSWORD=changemeUsage Notes
- 1Docs: https://ghost.org/docs/
- 2Access at http://localhost:2368, admin at http://localhost:2368/ghost
- 3Set GHOST_URL to your domain for production links
- 4Built-in newsletter, membership, and Stripe payments
- 5Themes in /var/lib/ghost/content/themes
- 6Ghost(Pro) alternative with self-hosted control
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
ghost
ghost:
image: ghost:5-alpine
container_name: ghost
restart: unless-stopped
environment:
url: ${GHOST_URL}
database__client: mysql
database__connection__host: mysql
database__connection__user: ${MYSQL_USER}
database__connection__password: ${MYSQL_PASSWORD}
database__connection__database: ${MYSQL_DATABASE}
volumes:
- ghost_content:/var/lib/ghost/content
ports:
- "2368:2368"
depends_on:
- mysql
networks:
- ghost-network
mysql
mysql:
image: mysql:8.0
container_name: ghost-mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
networks:
- ghost-network
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 ghost:5 image: ghost:5-alpine6 container_name: ghost7 restart: unless-stopped8 environment:9 url: ${GHOST_URL}10 database__client: mysql11 database__connection__host: mysql12 database__connection__user: ${MYSQL_USER}13 database__connection__password: ${MYSQL_PASSWORD}14 database__connection__database: ${MYSQL_DATABASE}15 volumes:16 - ghost_content:/var/lib/ghost/content17 ports:18 - "2368:2368"19 depends_on:20 - mysql21 networks:22 - ghost-network2324 mysql:25 image: mysql:8.026 container_name: ghost-mysql27 environment:28 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}29 MYSQL_DATABASE: ${MYSQL_DATABASE}30 MYSQL_USER: ${MYSQL_USER}31 MYSQL_PASSWORD: ${MYSQL_PASSWORD}32 volumes:33 - mysql_data:/var/lib/mysql34 networks:35 - ghost-network3637volumes:38 ghost_content:39 mysql_data:4041networks:42 ghost-network:43 driver: bridge44EOF4546# 2. Create the .env file47cat > .env << 'EOF'48GHOST_URL=http://localhost:236849MYSQL_ROOT_PASSWORD=rootpassword50MYSQL_DATABASE=ghost51MYSQL_USER=ghost52MYSQL_PASSWORD=changeme53EOF5455# 3. Start the services56docker compose up -d5758# 4. View logs59docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/ghost-blog/run | bashTroubleshooting
- Ghost shows database connection errors: Verify MYSQL_USER and MYSQL_PASSWORD environment variables match between services and that MySQL container is fully initialized before Ghost starts
- Newsletter emails not sending: Configure proper SMTP settings in Ghost admin panel under Settings > Labs > Email, as Ghost requires external SMTP service for email delivery
- Ghost admin redirects to wrong URL: Set GHOST_URL environment variable to match your actual domain, including protocol (http/https) and port if non-standard
- Membership signup failures: Ensure GHOST_URL is set correctly and Stripe webhooks are configured if using paid memberships, as Ghost validates URLs during payment processing
- MySQL container fails to start with permission errors: Check that the mysql_data volume has proper permissions and isn't conflicting with existing MySQL installations on the host
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Ad Space
Shortcuts: C CopyF FavoriteD Download