Skip to content

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
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM roadiz/roadiz:latest
# Set environment variables
ENV APP_ENV=prod
ENV APP_SECRET=${APP_SECRET}
ENV DATABASE_URL=${DATABASE_URL}
ENV MAILER_DSN=${MAILER_DSN}
# Create necessary directories
RUN 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 port
EXPOSE 80
# The base image includes the default entrypoint

Environment Variables Reference

VariableRequiredDescription
APP_SECRETYesSymfony application secret (generate with openssl rand -hex 32)
DATABASE_URLYesDatabase connection URL (e.g., mysql://user:pass@host/roadiz)
MAILER_DSNNoSMTP configuration for notifications
APP_ENVNoEnvironment (default: prod)

Deploying Roadiz on Klutch.sh

    Generate Application Secret

    Create a secure application secret:

    Terminal window
    openssl rand -hex 32

    Push 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:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    APP_SECRETYour generated secret
    DATABASE_URLmysql://user:pass@host:3306/roadiz

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /var/www/html/public/files20 GBMedia and document storage
    /var/www/html/var5 GBCache 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

  1. Navigate to your Roadiz URL
  2. Complete the installation wizard
  3. Create your administrator account
  4. Configure initial settings

Defining Node Types

  1. Go to Settings > Node Types
  2. Create custom node types for your content
  3. Add fields with appropriate data types
  4. Configure display and validation settings

Creating Content

  1. Navigate to Nodes
  2. Create nodes using your defined types
  3. Fill in content fields
  4. Publish content when ready

Building Themes

  1. Create a custom theme in /themes
  2. Define Twig templates for node types
  3. Configure routing for your front-end

Headless Usage

REST API

Access content via the REST API:

GET /api/nodes
GET /api/nodes/{id}

GraphQL

Use the GraphQL endpoint for flexible queries:

POST /graphql

Additional 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.