Deploying Roadiz
Introduction
Roadiz is a modern, polymorphic content management system built on the Symfony framework. Unlike traditional CMS platforms with rigid content structures, Roadiz allows you to define custom node types with flexible fields, making it ideal for complex websites and headless API-driven applications.
Key highlights of Roadiz:
- Polymorphic Nodes: Define custom content types with flexible field configurations
- Symfony Foundation: Built on robust Symfony components for reliability
- Headless Ready: REST and GraphQL APIs for decoupled front-ends
- Multi-Language: Full internationalization support
- Document Management: Advanced media handling with image processing
- Theme System: Flexible theming with Twig templates
- SEO Friendly: Built-in SEO tools and structured data support
- User Roles: Fine-grained permission system
- Webhooks: Event-driven integrations
- Cache System: Advanced caching for performance
- Open Source: MIT-licensed with active development
This guide walks through deploying Roadiz on Klutch.sh using Docker and setting up your content structure.
Why Deploy Roadiz on Klutch.sh
Deploying Roadiz on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh automatically builds and deploys Roadiz without complex Symfony configuration.
Persistent Storage: Attach persistent volumes for media files and configuration that survive container restarts.
HTTPS by Default: Klutch.sh provides automatic SSL for secure content management.
Environment Variable Management: Securely store database credentials and secrets through Klutch.sh.
Custom Domains: Assign a custom domain for your CMS or headless API.
Prerequisites
Before deploying Roadiz on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Roadiz configuration
- An external database (MySQL/MariaDB or PostgreSQL)
- Basic familiarity with Docker and Symfony
Preparing Your Repository
Create a GitHub repository containing your Dockerfile for Roadiz deployment.
Repository Structure
roadiz-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM roadiz/roadiz:latest
# Set environment variablesENV APP_ENV=prodENV APP_SECRET=${APP_SECRET}ENV DATABASE_URL=${DATABASE_URL}ENV MAILER_DSN=${MAILER_DSN}
# Create necessary directoriesRUN mkdir -p /var/www/html/public/files \ && mkdir -p /var/www/html/var \ && chown -R www-data:www-data /var/www/html
# Expose the web interface portEXPOSE 80
# The base image includes the default entrypointEnvironment Variables Reference
| Variable | Required | Description |
|---|---|---|
APP_SECRET | Yes | Symfony application secret (generate with openssl rand -hex 32) |
DATABASE_URL | Yes | Database connection URL (e.g., mysql://user:pass@host/roadiz) |
MAILER_DSN | No | SMTP configuration for notifications |
APP_ENV | No | Environment (default: prod) |
Deploying Roadiz on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 80
Generate Application Secret
Create a secure application secret:
openssl rand -hex 32Push Your Repository to GitHub
Commit and push your Dockerfile to GitHub.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project with a descriptive name like “roadiz” or “cms”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select the repository containing your Roadiz Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
APP_SECRET | Your generated secret |
DATABASE_URL | mysql://user:pass@host:3306/roadiz |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/var/www/html/public/files | 20 GB | Media and document storage |
/var/www/html/var | 5 GB | Cache and logs |
Deploy Your Application
Click Deploy to start the build process.
Access Roadiz
Once deployment completes, access Roadiz at your app URL.
Initial Configuration
Installation
- Navigate to your Roadiz URL
- Complete the installation wizard
- Create your administrator account
- Configure initial settings
Defining Node Types
- Go to Settings > Node Types
- Create custom node types for your content
- Add fields with appropriate data types
- Configure display and validation settings
Creating Content
- Navigate to Nodes
- Create nodes using your defined types
- Fill in content fields
- Publish content when ready
Building Themes
- Create a custom theme in
/themes - Define Twig templates for node types
- Configure routing for your front-end
Headless Usage
REST API
Access content via the REST API:
GET /api/nodesGET /api/nodes/{id}GraphQL
Use the GraphQL endpoint for flexible queries:
POST /graphqlAdditional Resources
Conclusion
Deploying Roadiz on Klutch.sh gives you a flexible, modern CMS with polymorphic content modeling. Whether building traditional websites or headless applications, Roadiz’s node-based architecture provides the flexibility to model any content structure while Klutch.sh handles the infrastructure.