Apostrophe CMS
Node.js CMS with in-context editing and rich media management.
Overview
Apostrophe CMS is a modern Node.js content management system built with in-context editing at its core, allowing content creators to edit pages directly on the front-end without switching between admin panels and preview modes. Originally developed by P'unk Avenue and now maintained as an open-source project, Apostrophe distinguishes itself from traditional CMSes by treating content as composable widgets within flexible page areas, enabling non-technical users to build sophisticated layouts while maintaining developer control over functionality and design. This Docker stack combines Apostrophe with MongoDB 7, leveraging MongoDB's flexible document structure to store Apostrophe's widget-based content architecture, page trees, and media assets efficiently. The pairing is particularly powerful because Apostrophe's schema-driven approach to content types maps naturally to MongoDB's document collections, while MongoDB's aggregation framework supports Apostrophe's advanced querying needs for content relationships and site navigation. This configuration is ideal for agencies, marketing teams, and organizations that need a CMS where content creators can build complex pages visually while developers maintain full control over the underlying code structure, offering a middle ground between inflexible traditional CMSes and overly complex headless solutions.
Key Features
- In-context editing with live preview - edit text, images, and widgets directly on the page without admin panel switching
- Widget-based content composition using areas and singletons for flexible page layouts
- Rich media management with automatic image resizing, cropping, and optimization
- Schema-driven content types with automatic admin UI generation for custom post types
- Built-in user management with role-based permissions and workflow controls
- Page tree management with drag-and-drop organization and URL routing
- MongoDB aggregation pipeline integration for complex content queries and relationships
- Express.js foundation allowing custom routes, middleware, and API endpoints
Common Use Cases
- 1Marketing websites where non-technical teams need to create landing pages with complex layouts
- 2Corporate websites requiring frequent content updates with approval workflows
- 3Event and conference sites needing dynamic speaker, session, and venue management
- 4Portfolio and agency websites showcasing projects with rich media galleries
- 5Educational institutions managing course catalogs, faculty profiles, and program information
- 6Non-profit organizations managing donor campaigns, event listings, and volunteer coordination
- 7Small to medium e-commerce sites needing custom product presentation beyond standard templates
Prerequisites
- Docker and Docker Compose installed with at least 2GB RAM available for MongoDB operations
- Port 3000 available for Apostrophe web interface access
- Basic understanding of Node.js project structure and npm package management
- Familiarity with MongoDB concepts like collections and documents for content modeling
- Knowledge of Express.js routing and middleware for custom functionality development
- Understanding of widget-based CMS concepts and area/singleton content organization
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 apostrophe: 3 image: apostrophecms/apostrophe:latest4 container_name: apostrophe5 restart: unless-stopped6 environment: 7 APOS_MONGODB_URI: mongodb://mongodb:27017/apostrophe8 volumes: 9 - ./app:/app10 - uploads_data:/app/public/uploads11 ports: 12 - "3000:3000"13 depends_on: 14 - mongodb15 networks: 16 - apostrophe-network1718 mongodb: 19 image: mongo:720 container_name: apostrophe-mongodb21 volumes: 22 - mongodb_data:/data/db23 networks: 24 - apostrophe-network2526volumes: 27 uploads_data: 28 mongodb_data: 2930networks: 31 apostrophe-network: 32 driver: bridge.env Template
.env
1# Apostrophe requires project setupUsage Notes
- 1Docs: https://docs.apostrophecms.org/
- 2Access at http://localhost:3000
- 3In-context editing: click to edit directly on page
- 4Widgets and areas for page composition
- 5Built on Express.js and MongoDB
- 6Project setup: npx create-apostrophe-app
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
apostrophe
apostrophe:
image: apostrophecms/apostrophe:latest
container_name: apostrophe
restart: unless-stopped
environment:
APOS_MONGODB_URI: mongodb://mongodb:27017/apostrophe
volumes:
- ./app:/app
- uploads_data:/app/public/uploads
ports:
- "3000:3000"
depends_on:
- mongodb
networks:
- apostrophe-network
mongodb
mongodb:
image: mongo:7
container_name: apostrophe-mongodb
volumes:
- mongodb_data:/data/db
networks:
- apostrophe-network
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 apostrophe:5 image: apostrophecms/apostrophe:latest6 container_name: apostrophe7 restart: unless-stopped8 environment:9 APOS_MONGODB_URI: mongodb://mongodb:27017/apostrophe10 volumes:11 - ./app:/app12 - uploads_data:/app/public/uploads13 ports:14 - "3000:3000"15 depends_on:16 - mongodb17 networks:18 - apostrophe-network1920 mongodb:21 image: mongo:722 container_name: apostrophe-mongodb23 volumes:24 - mongodb_data:/data/db25 networks:26 - apostrophe-network2728volumes:29 uploads_data:30 mongodb_data:3132networks:33 apostrophe-network:34 driver: bridge35EOF3637# 2. Create the .env file38cat > .env << 'EOF'39# Apostrophe requires project setup40EOF4142# 3. Start the services43docker compose up -d4445# 4. View logs46docker 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/apostrophe-cms/run | bashTroubleshooting
- Error: 'Cannot connect to MongoDB': Ensure MongoDB container is fully started before Apostrophe by adding healthcheck or increasing startup delay
- Apostrophe admin interface not loading: Check that uploads_data volume has proper permissions and disk space for media storage
- Session errors or login issues: Verify APOS_MONGODB_URI environment variable matches the exact MongoDB service name and database
- Widget rendering errors: Ensure custom widget templates are properly mounted in the app volume and restart the container
- Performance issues with large media uploads: Increase MongoDB container memory allocation beyond the 512MB minimum
- Build errors when extending Apostrophe: Verify Node.js version compatibility between your custom modules and the apostrophecms/apostrophe base image
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