Sulu CMS (Symfony) Installation and Setup

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Sulu CMS (Symfony) Installation and Setup
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1212
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    815

Sulu CMS Installation and Configuration (Symfony)

Sulu is installed as a Symfony project via Composer. It requires PHP 8.2+, MySQL/MariaDB or PostgreSQL, and understanding of the Webspaces concept. This is not WordPress — without Symfony knowledge, the installation process takes more time.

System Requirements

  • PHP 8.2+ with extensions: intl, gd or imagick, pdo_mysql / pdo_pgsql, xml, zip, curl
  • MySQL 8.0+ / MariaDB 10.6+ / PostgreSQL 14+
  • Composer 2
  • Node.js 18+ (for building the backoffice frontend)

Installation

composer create-project sulu/skeleton my-project
cd my-project

Configure .env.local:

APP_ENV=dev
APP_SECRET=your-secret-key-here

DATABASE_URL="mysql://sulu:[email protected]:3306/sulu_db?serverVersion=8.0"
# or PostgreSQL:
# DATABASE_URL="postgresql://sulu:[email protected]:5432/sulu_db?serverVersion=14&charset=utf8"

[email protected]

Database Initialization

# create database
php bin/console doctrine:database:create

# run Sulu migrations
php bin/console doctrine:migrations:migrate --no-interaction

# create first admin user
php bin/console sulu:security:user:create \
  --firstName="Admin" \
  --lastName="Admin" \
  --username=admin \
  [email protected] \
  --locale=en \
  --role=ROLE_SULU_ADMIN

# populate necessary Sulu data
php bin/console sulu:document:initialize
php bin/console sulu:phpcr:init

Sulu Configuration

# config/packages/sulu.yaml
sulu_core:
    content:
        structure:
            default_type:
                homepage: 'default'
                page: 'default'
            paths:
                app:
                    path: '%kernel.project_dir%/config/templates'
                    type: 'page'
                app_homepage:
                    path: '%kernel.project_dir%/config/templates'
                    type: 'home'

sulu_document_manager:
    mapping:
        - alias: 'page'
          phpcr_type: 'sulu:page'
          class: 'Sulu\Bundle\ContentBundle\Document\PageDocument'

sulu_media:
    storage:
        name: 'local'
        options:
            base_path: '%kernel.project_dir%/public/uploads/media'
            base_url: '/uploads/media'
    image_format_files:
        - '%kernel.project_dir%/config/image-formats.xml'

Nginx Configuration

server {
    listen 443 ssl http2;
    server_name example.com en.example.com admin.example.com;

    root /var/www/my-project/public;
    index index.php;

    ssl_certificate     /etc/ssl/certs/example.com.crt;
    ssl_certificate_key /etc/ssl/private/example.com.key;

    client_max_body_size 50M;

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        internal;
    }

    location /uploads/ {
        expires 30d;
        add_header Cache-Control "public, immutable";
    }
}

Jackalope and PHPCR

Sulu uses PHPCR (PHP Content Repository) via Jackalope. By default, Jackalope Doctrine DBAL stores content in a relational database. Alternative is Jackrabbit (Java), but for most projects, DBAL is sufficient.

# config/packages/doctrine_phpcr.yaml
doctrine_phpcr:
    session:
        backend:
            type: doctrinedbal
            connection: default
            caches:
                meta: cache.app
                nodes: cache.app
        workspace: default
    odm:
        auto_mapping: true
        auto_generate_proxy_classes: '%kernel.debug%'

Route Configuration

# config/routes_website.yaml
sulu_website:
    resource: "@SuluWebsiteBundle/Resources/config/routing/website.xml"
    type: xml

app_default:
    path: /{slug}
    requirements:
        slug: .*
    defaults:
        _controller: Sulu\Bundle\WebsiteBundle\Controller\DefaultController::indexAction
# config/routes_admin.yaml
sulu_admin:
    resource: "@SuluAdminBundle/Resources/config/routing/admin.xml"
    prefix: /admin

sulu_core_api:
    resource: "@SuluCoreBundle/Resources/config/routing/api.xml"
    prefix: /api

app_admin:
    resource: ../src/Controller/Admin/
    type: annotation
    prefix: /api

Building the Backoffice Frontend

# install dependencies
npm install

# development
npm run build:dev   # or npm run watch

# production
npm run build

Sulu backoffice is a React application. Custom components are added via custom Bundles.

Caching and Performance

# warm up cache
php bin/console cache:warmup --env=prod

# clear PHPCR cache
php bin/console cache:clear

# task queue (Messenger)
php bin/console messenger:consume async --limit=100

For production, Redis is recommended as cache backend:

# config/packages/cache.yaml
framework:
    cache:
        default_redis_provider: 'redis://127.0.0.1:6379'
        pools:
            cache.app:
                adapter: cache.adapter.redis

Deployment

# on server
composer install --no-dev --optimize-autoloader
npm ci && npm run build
php bin/console cache:warmup --env=prod
php bin/console doctrine:migrations:migrate --no-interaction --env=prod

Timeline

Basic installation with one Webspace, two languages, and first user: 1 day. With Nginx setup, Redis, Messenger, and initial template configuration: 2–3 days.