CMS Guide

    Self-Hosted TYPO3 CMS

    Deploy TYPO3, the enterprise-grade content management system, on RamNode VPS. Sophisticated multi-site management, granular access controls, and extensive customization.

    Ubuntu 24.04 LTS
    TYPO3 v13 LTS
    ⏱️ 30-45 minutes

    Why TYPO3?

    TYPO3 is an enterprise-grade, open-source content management system renowned for its flexibility, scalability, and robust feature set. Originally developed in Germany, it's the CMS of choice for large organizations and government institutions.

    Multi-site management capabilities
    Granular access controls and permissions
    Extensive extension ecosystem
    Enterprise-grade scalability
    Long-term support (LTS) releases
    Multi-language content support

    Prerequisites

    Requirements

    • • Ubuntu 24.04 LTS installed
    • • Minimum 2GB RAM (4GB recommended)
    • • Root or sudo access
    • • Domain name pointed to your server

    Stack

    • • PHP 8.3 with required extensions
    • • MariaDB database server
    • • Nginx or Apache web server
    • • Composer dependency manager
    1

    Update System

    Start by updating your system packages:

    Update System
    sudo apt update && sudo apt upgrade -y

    PHP Installation

    1

    Add PHP Repository

    TYPO3 requires PHP 8.2 or higher. Add the Ondřej PHP repository:

    Add Repository
    sudo apt install -y software-properties-common
    sudo add-apt-repository ppa:ondrej/php -y
    sudo apt update
    2

    Install PHP 8.3 and Extensions

    Install PHP 8.3 with all required extensions:

    Install PHP
    sudo apt install -y php8.3 php8.3-fpm php8.3-cli php8.3-common \
      php8.3-mysql php8.3-xml php8.3-curl php8.3-gd php8.3-mbstring \
      php8.3-zip php8.3-intl php8.3-soap php8.3-bcmath php8.3-opcache \
      php8.3-apcu php8.3-imagick php8.3-fileinfo
    3

    Configure PHP for TYPO3

    Edit PHP-FPM configuration:

    Edit php.ini
    sudo nano /etc/php/8.3/fpm/php.ini
    PHP Settings
    max_execution_time = 240
    max_input_vars = 1500
    memory_limit = 512M
    post_max_size = 100M
    upload_max_filesize = 100M
    date.timezone = America/Chicago
    
    ; OPcache settings
    opcache.enable=1
    opcache.memory_consumption=256
    opcache.interned_strings_buffer=16
    opcache.max_accelerated_files=10000
    opcache.revalidate_freq=2
    Restart PHP-FPM
    sudo systemctl restart php8.3-fpm
    4

    Install Composer

    TYPO3 is installed via Composer:

    Install Composer
    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
    sudo chmod +x /usr/local/bin/composer
    composer --version

    Database Setup

    1

    Install MariaDB

    Install and secure MariaDB:

    Install MariaDB
    sudo apt install -y mariadb-server mariadb-client
    sudo mysql_secure_installation

    Follow the prompts to set a root password, remove anonymous users, disallow remote root login, and remove the test database.

    2

    Create Database and User

    Create a dedicated database and user for TYPO3:

    Login to MariaDB
    sudo mysql -u root -p
    SQL Commands
    CREATE DATABASE typo3 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    CREATE USER 'typo3user'@'localhost' IDENTIFIED BY 'YourSecurePassword';
    GRANT ALL PRIVILEGES ON typo3.* TO 'typo3user'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;

    Important: Replace YourSecurePassword with a strong, unique password.

    TYPO3 Installation

    1

    Create Web Directory

    Create the directory structure:

    Create Directory
    sudo mkdir -p /var/www/typo3
    sudo chown -R www-data:www-data /var/www/typo3
    cd /var/www/typo3
    2

    Install TYPO3 via Composer

    Install TYPO3 v13 LTS:

    Install TYPO3
    sudo -u www-data composer create-project typo3/cms-base-distribution . "^13"

    This installs TYPO3 v13 LTS, the latest long-term support version. Installation may take several minutes.

    3

    Set Permissions

    Ensure proper permissions:

    Set Permissions
    sudo chown -R www-data:www-data /var/www/typo3
    sudo find /var/www/typo3 -type d -exec chmod 2775 {} \;
    sudo find /var/www/typo3 -type f -exec chmod 0664 {} \;
    4

    Create FIRST_INSTALL File

    Trigger the installation wizard:

    Create File
    sudo -u www-data touch /var/www/typo3/public/FIRST_INSTALL

    Option A: Nginx Configuration

    1

    Install Nginx

    Install Nginx web server:

    Install Nginx
    sudo apt install -y nginx
    2

    Create Server Block

    Create the Nginx configuration:

    Create Config
    sudo nano /etc/nginx/sites-available/typo3
    /etc/nginx/sites-available/typo3
    server {
        listen 80;
        listen [::]:80;
        server_name yourdomain.com www.yourdomain.com;
        root /var/www/typo3/public;
        index index.php index.html;
    
        # Compression
        gzip on;
        gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
        gzip_vary on;
        gzip_min_length 1000;
    
        # Security headers
        add_header X-Frame-Options "SAMEORIGIN" always;
        add_header X-Content-Type-Options "nosniff" always;
        add_header X-XSS-Protection "1; mode=block" always;
    
        # TYPO3 Frontend
        location / {
            try_files $uri $uri/ /index.php$is_args$args;
        }
    
        # TYPO3 Backend
        location /typo3 {
            try_files $uri /typo3/index.php$is_args$args;
        }
    
        # PHP-FPM Configuration
        location ~ \.php$ {
            fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 256 16k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
            fastcgi_read_timeout 240;
        }
    
        # Block access to sensitive files
        location ~ /\. {
            deny all;
        }
    
        location ~* \.(engine|inc|install|make|module|profile|po|sh|sql|theme|twig|tpl|xtmpl|yml)$ {
            deny all;
        }
    
        # Static file caching
        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
            expires 1M;
            add_header Cache-Control "public, immutable";
            access_log off;
        }
    }
    3

    Enable Site

    Enable the site and test configuration:

    Enable Site
    sudo ln -s /etc/nginx/sites-available/typo3 /etc/nginx/sites-enabled/
    sudo nginx -t
    sudo systemctl restart nginx

    Option B: Apache Configuration

    1

    Install Apache

    Install Apache with required modules:

    Install Apache
    sudo apt install -y apache2 libapache2-mod-fcgid
    sudo a2enmod rewrite proxy_fcgi setenvif headers expires
    sudo a2enconf php8.3-fpm
    2

    Create Virtual Host

    Create Apache virtual host:

    Create Config
    sudo nano /etc/apache2/sites-available/typo3.conf
    /etc/apache2/sites-available/typo3.conf
    <VirtualHost *:80>
        ServerName yourdomain.com
        ServerAlias www.yourdomain.com
        DocumentRoot /var/www/typo3/public
    
        <Directory /var/www/typo3/public>
            Options -Indexes +FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    
        <FilesMatch \.phpgt;
            SetHandler "proxy:unix:/var/run/php/php8.3-fpm.sock|fcgi://localhost"
        </FilesMatch>
    
        # Security headers
        Header always set X-Frame-Options "SAMEORIGIN"
        Header always set X-Content-Type-Options "nosniff"
        Header always set X-XSS-Protection "1; mode=block"
    
        ErrorLog ${APACHE_LOG_DIR}/typo3_error.log
        CustomLog ${APACHE_LOG_DIR}/typo3_access.log combined
    </VirtualHost>
    Enable Site
    sudo a2ensite typo3.conf
    sudo a2dissite 000-default.conf
    sudo systemctl restart apache2

    SSL Configuration

    1

    Install Certbot

    Secure your site with Let's Encrypt:

    Install Certbot
    sudo apt install -y certbot
    2

    Obtain SSL Certificate

    For Nginx:

    Nginx SSL
    sudo apt install -y python3-certbot-nginx
    sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

    For Apache:

    Apache SSL
    sudo apt install -y python3-certbot-apache
    sudo certbot --apache -d yourdomain.com -d www.yourdomain.com
    Verify Auto-Renewal
    sudo certbot renew --dry-run

    Installation Wizard

    1

    Complete Web Setup

    Open your browser and navigate to:

    URL
    https://yourdomain.com

    The TYPO3 installation wizard will guide you through:

    1. System Environment Check: Verify all requirements are met
    2. Database Connection: Enter your database credentials (typo3, typo3user, password)
    3. Select Database: Choose the typo3 database
    4. Create Admin User: Set up your administrator account
    5. Initialize: Complete the installation

    Scheduled Tasks

    1

    Configure Cron Job

    TYPO3 requires periodic task execution:

    Edit Crontab
    sudo crontab -u www-data -e
    Add Scheduler
    */5 * * * * /usr/bin/php /var/www/typo3/vendor/bin/typo3 scheduler:run >> /var/log/typo3-scheduler.log 2>&1

    This runs the scheduler every 5 minutes.

    Security Hardening

    1

    Configure Firewall

    Set up UFW firewall:

    Firewall Rules
    sudo ufw default deny incoming
    sudo ufw default allow outgoing
    sudo ufw allow ssh
    sudo ufw allow 'Nginx Full'  # Or 'Apache Full'
    sudo ufw enable
    2

    Install Fail2Ban

    Protect against brute-force attacks:

    Install Fail2Ban
    sudo apt install -y fail2ban
    Create Jail
    sudo nano /etc/fail2ban/jail.local
    /etc/fail2ban/jail.local
    [typo3]
    enabled = true
    port = http,https
    filter = typo3
    logpath = /var/log/nginx/typo3_access.log
    maxretry = 5
    bantime = 3600
    findtime = 600
    Create Filter
    sudo nano /etc/fail2ban/filter.d/typo3.conf
    /etc/fail2ban/filter.d/typo3.conf
    [Definition]
    failregex = ^<HOST> .* "POST /typo3/.*" (401|403)
    ignoreregex =
    Restart Fail2Ban
    sudo systemctl restart fail2ban

    Performance Optimization

    1

    Enable Redis Caching

    Install Redis for improved caching:

    Install Redis
    sudo apt install -y redis-server php8.3-redis
    sudo systemctl enable redis-server
    sudo systemctl start redis-server

    Configure TYPO3 to use Redis in config/system/additional.php:

    Redis Configuration
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['hash']['backend'] = 
        \TYPO3\CMS\Core\Cache\Backend\RedisBackend::class;
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['hash']['options'] = [
        'database' => 0,
        'hostname' => '127.0.0.1',
        'port' => 6379,
    ];
    
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages']['backend'] = 
        \TYPO3\CMS\Core\Cache\Backend\RedisBackend::class;
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages']['options'] = [
        'database' => 1,
        'hostname' => '127.0.0.1',
        'port' => 6379,
    ];
    2

    Optimize MariaDB

    Add database optimizations:

    Create Config
    sudo nano /etc/mysql/mariadb.conf.d/99-typo3.cnf
    MariaDB Tuning
    [mysqld]
    innodb_buffer_pool_size = 512M
    innodb_log_file_size = 128M
    innodb_flush_log_at_trx_commit = 2
    innodb_flush_method = O_DIRECT
    query_cache_type = 0
    Restart MariaDB
    sudo systemctl restart mariadb

    Backup Strategy

    1

    Automated Backup Script

    Create a backup script:

    Create Script
    sudo mkdir -p /opt/scripts
    sudo nano /opt/scripts/typo3-backup.sh
    /opt/scripts/typo3-backup.sh
    #!/bin/bash
    BACKUP_DIR="/var/backups/typo3"
    DATE=$(date +%Y%m%d_%H%M%S)
    DB_NAME="typo3"
    DB_USER="typo3user"
    DB_PASS="YourSecurePassword"
    
    mkdir -p $BACKUP_DIR
    
    # Database backup
    mysqldump -u$DB_USER -p$DB_PASS $DB_NAME | gzip > $BACKUP_DIR/db_$DATE.sql.gz
    
    # File backup
    tar -czf $BACKUP_DIR/files_$DATE.tar.gz /var/www/typo3/public/fileadmin
    
    # Cleanup backups older than 7 days
    find $BACKUP_DIR -type f -mtime +7 -delete
    Schedule Backup
    sudo chmod +x /opt/scripts/typo3-backup.sh
    sudo crontab -e
    
    # Add: Run daily at 2 AM
    0 2 * * * /opt/scripts/typo3-backup.sh

    Troubleshooting

    1

    500 Internal Server Error

    Check error logs:

    View Logs
    sudo tail -f /var/log/nginx/error.log
    sudo tail -f /var/log/php8.3-fpm.log
    2

    Permission Denied Errors

    Fix ownership and permissions:

    Fix Permissions
    sudo chown -R www-data:www-data /var/www/typo3
    sudo find /var/www/typo3 -type d -exec chmod 2775 {} \;
    sudo find /var/www/typo3 -type f -exec chmod 0664 {} \;
    3

    Database Connection Failed

    Verify database status:

    Check Database
    sudo systemctl status mariadb
    mysql -u typo3user -p -e "SHOW DATABASES;"
    4

    Clear All Caches

    Clear TYPO3 caches via CLI:

    Clear Caches
    cd /var/www/typo3
    sudo -u www-data vendor/bin/typo3 cache:flush
    5

    Useful CLI Commands

    Common TYPO3 commands:

    CLI Commands
    # Clear all caches
    vendor/bin/typo3 cache:flush
    
    # Update database schema
    vendor/bin/typo3 database:updateschema
    
    # Run scheduler tasks manually
    vendor/bin/typo3 scheduler:run
    
    # List all available commands
    vendor/bin/typo3 list

    Setup Complete!

    You now have a fully functional TYPO3 CMS installation on your RamNode VPS. TYPO3's enterprise-grade features make it an excellent choice for complex websites requiring sophisticated content management, multi-site capabilities, and granular user permissions.

    Keep your installation updated with composer update and monitor the official TYPO3 documentation for security bulletins.