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.
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
Update System
Start by updating your system packages:
sudo apt update && sudo apt upgrade -yPHP Installation
Add PHP Repository
TYPO3 requires PHP 8.2 or higher. Add the Ondřej PHP repository:
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php -y
sudo apt updateInstall PHP 8.3 and Extensions
Install PHP 8.3 with all required extensions:
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-fileinfoConfigure PHP for TYPO3
Edit PHP-FPM configuration:
sudo nano /etc/php/8.3/fpm/php.inimax_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=2sudo systemctl restart php8.3-fpmInstall Composer
TYPO3 is installed via Composer:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
composer --versionDatabase Setup
Install MariaDB
Install and secure MariaDB:
sudo apt install -y mariadb-server mariadb-client
sudo mysql_secure_installationFollow the prompts to set a root password, remove anonymous users, disallow remote root login, and remove the test database.
Create Database and User
Create a dedicated database and user for TYPO3:
sudo mysql -u root -pCREATE 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
Create Web Directory
Create the directory structure:
sudo mkdir -p /var/www/typo3
sudo chown -R www-data:www-data /var/www/typo3
cd /var/www/typo3Install TYPO3 via Composer
Install TYPO3 v13 LTS:
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.
Set Permissions
Ensure proper 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 {} \;Create FIRST_INSTALL File
Trigger the installation wizard:
sudo -u www-data touch /var/www/typo3/public/FIRST_INSTALLOption A: Nginx Configuration
Install Nginx
Install Nginx web server:
sudo apt install -y nginxCreate Server Block
Create the Nginx configuration:
sudo nano /etc/nginx/sites-available/typo3server {
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;
}
}Enable Site
Enable the site and test configuration:
sudo ln -s /etc/nginx/sites-available/typo3 /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginxOption B: Apache Configuration
Install Apache
Install Apache with required modules:
sudo apt install -y apache2 libapache2-mod-fcgid
sudo a2enmod rewrite proxy_fcgi setenvif headers expires
sudo a2enconf php8.3-fpmCreate Virtual Host
Create Apache virtual host:
sudo nano /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>sudo a2ensite typo3.conf
sudo a2dissite 000-default.conf
sudo systemctl restart apache2SSL Configuration
Install Certbot
Secure your site with Let's Encrypt:
sudo apt install -y certbotObtain SSL Certificate
For Nginx:
sudo apt install -y python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.comFor Apache:
sudo apt install -y python3-certbot-apache
sudo certbot --apache -d yourdomain.com -d www.yourdomain.comsudo certbot renew --dry-runInstallation Wizard
Complete Web Setup
Open your browser and navigate to:
https://yourdomain.comThe TYPO3 installation wizard will guide you through:
- System Environment Check: Verify all requirements are met
- Database Connection: Enter your database credentials (typo3, typo3user, password)
- Select Database: Choose the typo3 database
- Create Admin User: Set up your administrator account
- Initialize: Complete the installation
Scheduled Tasks
Configure Cron Job
TYPO3 requires periodic task execution:
sudo crontab -u www-data -e*/5 * * * * /usr/bin/php /var/www/typo3/vendor/bin/typo3 scheduler:run >> /var/log/typo3-scheduler.log 2>&1This runs the scheduler every 5 minutes.
Security Hardening
Configure Firewall
Set up UFW firewall:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 'Nginx Full' # Or 'Apache Full'
sudo ufw enableInstall Fail2Ban
Protect against brute-force attacks:
sudo apt install -y fail2bansudo nano /etc/fail2ban/jail.local[typo3]
enabled = true
port = http,https
filter = typo3
logpath = /var/log/nginx/typo3_access.log
maxretry = 5
bantime = 3600
findtime = 600sudo nano /etc/fail2ban/filter.d/typo3.conf[Definition]
failregex = ^<HOST> .* "POST /typo3/.*" (401|403)
ignoreregex =sudo systemctl restart fail2banPerformance Optimization
Enable Redis Caching
Install Redis for improved caching:
sudo apt install -y redis-server php8.3-redis
sudo systemctl enable redis-server
sudo systemctl start redis-serverConfigure TYPO3 to use Redis in config/system/additional.php:
$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,
];Optimize MariaDB
Add database optimizations:
sudo nano /etc/mysql/mariadb.conf.d/99-typo3.cnf[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 = 0sudo systemctl restart mariadbBackup Strategy
Automated Backup Script
Create a backup script:
sudo mkdir -p /opt/scripts
sudo nano /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 -deletesudo chmod +x /opt/scripts/typo3-backup.sh
sudo crontab -e
# Add: Run daily at 2 AM
0 2 * * * /opt/scripts/typo3-backup.shTroubleshooting
500 Internal Server Error
Check error logs:
sudo tail -f /var/log/nginx/error.log
sudo tail -f /var/log/php8.3-fpm.logPermission Denied Errors
Fix ownership and 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 {} \;Database Connection Failed
Verify database status:
sudo systemctl status mariadb
mysql -u typo3user -p -e "SHOW DATABASES;"Clear All Caches
Clear TYPO3 caches via CLI:
cd /var/www/typo3
sudo -u www-data vendor/bin/typo3 cache:flushUseful CLI Commands
Common TYPO3 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 listSetup 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.
