TYPO3 is a free and open-source enterprise-grade content management system (CMS) offering features like scalable multisite support, multilingual installation, strong security, and high performance. It is a flexible and reliable platform supported by a vibrant community with a pluggable design and adaptable architecture.
This guide details the process of installing TYPO3 CMS using the LAMP Stack on Debian 11 (Bullseye) and includes a basic TYPO3 CMS installation walkthrough.
Prerequisites
- A Linux server running Debian 11.
- Access to a root user or a non-root user with root privileges.
- A domain name pointing to your server’s IP address.
Installing the LAMP Stack
Since TYPO3 is built on PHP, you must install a LAMP or LEMP stack. Follow these steps to set up a LAMP Stack for TYPO3:
Start by updating your package index:
sudo apt update
Now, install the necessary packages:
sudo apt install apache2 mariadb-server php php-common php-mysql libapache2-mod-php php-gd php-curl php-json php-xmlrpc php-intl php-bcmath php-zip php-apcu php-mbstring php-fileinfo php-xml php-soap
Confirm the installation by typing Y and pressing Enter.
Next, configure PHP by editing the php.ini file:
sudo nano /etc/php/7.4/apache2/php.ini
Adjust the configuration as follows:
memory_limit = 512M max_execution_time = 240 max_input_vars = 1500 date.timezone = Europe/Amsterdam post_max_size = 50M upload_max_filesize = 50M
Save the changes, then restart Apache to apply them:
sudo systemctl restart apache2 sudo systemctl status apache2
Ensure the Apache service is active and running:
Configuring MariaDB
Secure your MariaDB installation using mysql_secure_installation:
sudo mysql_secure_installation
Follow the prompts:
- Press Enter for no root password.
- Switch to unix_socket authentication: Y
- Set a new MariaDB root password: Y
- Remove anonymous users: Y
- Disallow root remote login: Y
- Remove test database: Y
- Reload privilege tables: Y
Restart and check the MariaDB service:
sudo systemctl restart mariadb sudo systemctl status mariadb
Ensure MariaDB is active and running:
Creating a Database and User for TYPO3
Create a database and user for TYPO3:
mysql -u root -p
Then execute the following SQL queries:
CREATE DATABASE typo3db; GRANT ALL PRIVILEGES ON typo3db.* TO 'typo3'@'localhost' IDENTIFIED BY 'typo3password'; FLUSH PRIVILEGES; EXIT;
Installing Composer
Install the PHP Composer by downloading and verifying the installer:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
Run the installer and remove it:
php composer-setup.php php -r "unlink('composer-setup.php');"
Move Composer to /usr/local/bin for system-wide access:
sudo mv composer.phar /usr/local/bin/composer
Verify Composer installation:
sudo -u www-data composer --version sudo -u www-data composer -v
Downloading TYPO3 CMS with Composer
Create a directory for TYPO3 and ensure it is writable by www-data:
mkdir -p /var/www/typo3 sudo chown -R www-data:www-data /var/www/typo3 sudo chmod u+rw /var/www/typo3
Download TYPO3 using Composer:
cd /var/www/typo3 sudo -u www-data composer create-project typo3/cms-base-distribution:^11 .
Setting up Apache Virtual Host
Create a virtual host configuration for TYPO3:
cd /etc/apache2/sites-available/ sudo nano typo3.conf
Add the following configuration, modifying the domain and certificate paths:
<VirtualHost *:80> ServerName example.io Redirect permanent / https://example.io/ </VirtualHost> <VirtualHost *:443> ServerAdmin admin@example.io DocumentRoot /var/www/typo3/public ServerName example.io Protocols h2 http/1.1 SSLEngine On SSLCertificateFile /etc/letsencrypt/live/example.io/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.io/privkey.pem Options FollowSymlinks AllowOverride All Require all granted ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) index.php [PT,L] </VirtualHost>
Save the file, then enable Apache modules and the virtual host configuration:
sudo a2enmod ssl rewrite headers sudo a2ensite typo3.conf sudo apachectl configtest
Ensure you receive “Syntax OK” as confirmation:
Restart Apache:
sudo systemctl restart apache2 sudo systemctl status apache2
Installing TYPO3 CMS
Create a FIRST_INSTALL file to indicate a fresh installation:
sudo -u www-data touch /var/www/typo3/public/FIRST_INSTALL
Access the TYPO3 installation through your browser at:
https://example.io/
Ensure your environment setup is correct and proceed by clicking the green button:
Enter database credentials and continue:
Select the existing empty typo3db and continue:
Create an admin account and finish the installation:
Upon completion, click “Open the TYPO3 Backend”:
Login with your admin credentials:
You will be directed to the TYPO3 admin dashboard:
Explore detailed information through the admin menu:
Conclusion
Congratulations! You have successfully installed TYPO3 CMS using the LAMP Stack on Debian 11 Bullseye. Now, you can customize your TYPO3 setup and explore extensions to enhance its functionality.
FAQ
- What are the prerequisites for installing TYPO3 CMS?
- You need a Linux server running Debian 11, access to root privileges, and a domain name pointed to the server’s IP.
- Why use the LAMP Stack for TYPO3?
- TYPO3 is PHP-based, thus requiring a LAMP stack (Linux, Apache, MySQL/MariaDB, PHP) to function properly.
- How can I verify the Composer installation?
- You can verify it by executing the command
sudo -u www-data composer --version
. The output will display the installed Composer version. - Is there a graphical interface for configuring Apache virtual hosts?
- Apache’s virtual hosts are typically managed through configuration files, but graphical tools are available for some desktop environments or controlled situations.
- Can I install TYPO3 without using Composer?
- While Composer is a recommended method for managing dependencies, TYPO3 can also be installed manually by downloading the source files and managing dependencies yourself.