TYPO3 CMS is a powerful, open-source content management system that provides enterprise-level features for building flexible and reliable websites. In this comprehensive guide, we will walk you through the step-by-step process of installing TYPO3 CMS on a Debian 12 server using the LAMP stack (Apache2, MariaDB, and PHP). By the end of this tutorial, you will have a fully functional TYPO3 CMS installation that you can use to manage your content, set up multilingual sites, and more.
Prerequisites
Before we begin, make sure you have the following prerequisites in place:
- A Debian 12 server
- A non-root user with sudo administrative privileges
- A domain name pointed to your server’s IP address
Installing Dependencies
To install TYPO3 CMS, we need to install the LAMP stack and Composer, which is a PHP dependency manager. Let’s start by updating and refreshing the Debian repository:
sudo apt update
Once the repository is updated, we can install the necessary dependencies for TYPO3 CMS using the following command:
sudo apt install apache2 mariadb-server composer 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
During the installation process, you will be prompted to confirm the installation. Type ‘y’ and hit Enter to proceed.
After the installation is complete, we need to verify that each dependency is installed and working correctly. Let’s start by checking the status of the Apache2 service:
sudo systemctl status apache2
You should see an output that confirms the Apache2 service is running and enabled.
Next, let’s check the status of the MariaDB service:
sudo systemctl status mariadb
Similar to the Apache2 service, the output should indicate that the MariaDB service is running and enabled.
To verify your PHP installation, run the following commands:
php -v php -m
You should see that PHP is installed and running with the necessary extensions enabled.
Finally, let’s ensure that Composer is installed:
which composer
composer -v
If you see the Composer version and installation path, it means Composer is installed correctly.
Configuring PHP
Now that we have installed the LAMP stack and Composer, we need to configure our PHP installation to meet the requirements of TYPO3 CMS. We will modify the php.ini configuration file to adjust certain settings.
Open the php.ini file using a text editor:
sudo nano /etc/php/8.2/apache2/php.ini
Inside the file, locate the following lines and modify them as shown below:
memory_limit = 512M max_execution_time = 240 max_input_vars = 1500 date.timezone = Europe/Amsterdam post_max_filesize = 50M upload_max_filesize = 50M
These settings ensure that TYPO3 CMS has enough memory, execution time, and file size limits to operate smoothly. Adjust the values according to your server environment if necessary.
Save the file and exit the text editor.
To apply the changes, restart the Apache2 service:
sudo systemctl restart apache2
Configuring MariaDB Server
Now that we have configured PHP, let’s move on to securing the MariaDB server and creating a new database and user for TYPO3 CMS.
To secure the MariaDB server, run the following command:
sudo mariadb-secure-installation
This command will guide you through a series of prompts to set up the root password, remove test databases, and secure other aspects of the MariaDB installation. Follow the prompts and input ‘y’ or ‘n’ to make the necessary configurations.
Once the MariaDB server is secured, log in to the MariaDB shell as root:
sudo mariadb -u root -p
Enter your root password when prompted.
Inside the MariaDB shell, run the following queries to create a new database and user for TYPO3 CMS:
CREATE DATABASE typo3db; GRANT ALL PRIVILEGES ON typo3db.* to typo3@localhost IDENTIFIED BY 'typo3password'; FLUSH PRIVILEGES;
Make sure to replace ‘typo3db’ with your desired database name and ‘typo3password’ with a strong password of your choice.
To verify that the user has the necessary privileges, run the following query:
SHOW GRANTS FOR typo3@localhost;
You should see the privileges granted to the user.
Exit the MariaDB shell by typing ‘quit’.
Downloading TYPO3 CMS via Composer
Now that we have prepared the server and set up the database, let’s proceed with downloading TYPO3 CMS using Composer.
First, create the necessary directories for TYPO3 CMS:
sudo mkdir -p /var/www/{.cache,.config,typo3}
Change the ownership of the directories to the Apache user:
sudo chown -R www-data:www-data /var/www/{.cache,.config,typo3}
Next, navigate to the TYPO3 CMS directory:
cd /var/www/typo3
Download TYPO3 CMS using Composer:
sudo-u www-data composer create-project typo3/cms-base-distribution:^12.
This command will download the TYPO3 CMS source code and install it in the current directory.
Verify that the source code has been downloaded:
ls
You should see a list of files and directories related to TYPO3 CMS.
Setting Up Apache2 Virtual Host
To run TYPO3 CMS, we need to set up an Apache2 virtual host configuration. This configuration will allow us to access TYPO3 CMS using a domain name.
First, enable the required Apache2 modules:
sudo a2enmod rewrite headers
Create a new virtual host configuration file:
sudo nano /etc/apache2/sites-available/typo3.conf
Inside the file, add the following configuration:
<VirtualHost *:80> ServerAdmin admin@example.io DocumentRoot /var/www/typo3/public ServerName example.io <Directory /var/www/typo3/public/> Options FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /var/www/typo3/public/> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) index.php [PT,L] </Directory> </VirtualHost>
Replace ‘yourdomain.com’ with your actual domain name.
Save the file and exit the text editor.
Enable the new virtual host configuration:
sudo a2ensite typo3.conf
Check the Apache2 configuration syntax:
sudo apachectl configtest
If the syntax is correct, you should see the message ‘Syntax OK’.
Restart the Apache2 service to apply the changes:
sudo systemctl restart apache2
Securing TYPO3 CMS with Certbot
To secure your TYPO3 CMS installation, we will enable HTTPS using SSL/TLS certificates from Let’s Encrypt. We will use Certbot and the Certbot Apache plugin to generate and install the certificates.
First, install Certbot and the Certbot Apache plugin:
sudo apt install certbot python3-certbot-apache
During the installation, you will be prompted to confirm. Type ‘y’ and hit Enter to proceed.
Once the installation is complete, run the following command to generate the SSL/TLS certificates:
sudo certbot --apache --agree-tos --no-eff-email --redirect --hsts --staple-ocsp--email[jhon@example.io] -d example.io
Replace ‘yourdomain.com’ with your actual domain name, and ‘[email protected]’ with your email address.
Certbot will automatically configure Apache to use the generated certificates.
Installing TYPO3 CMS via Web Installer
With the server set up and secured, we can now proceed with the TYPO3 CMS installation via the web installer.
First, create a file to enable the web installer:
sudo -u www-data touch /var/www/typo3/public/FIRST_INSTALL
Now, open your web browser and navigate to your TYPO3 CMS domain name (e.g., https://yourdomain.com/ ). You will be redirected to the TYPO3 web installer.
The web installer will perform a system environment check. If everything is in order, click on the “No problems detected” button to continue.
Next, you will be prompted to provide the details of your MariaDB database. Enter the database username, password, and host, and click on the “Continue” button.
In the next step, select the option to use an existing empty database and choose the ‘typo3db’ database we created earlier. Click on the “Continue” button.
Now, you need to provide the details for the TYPO3 CMS administrator account. Enter the desired username, password, and email address, and click on the “Continue” button to proceed.
Once the installation is complete, you will see a confirmation page. Click on the “Open the TYPO3 Backend” button to access the TYPO3 administration dashboard.
Enter your username and password to log in to the TYPO3 backend. You should now have access to the TYPO3 administration dashboard, where you can start managing your content.
Congratulations! You have successfully installed TYPO3 CMS on your Debian 12 server using the LAMP stack. You now have a powerful and flexible content management system at your disposal.
Conclusion
In this comprehensive guide, we have walked you through the process of installing TYPO3 CMS on a Debian 12 server using the LAMP stack. We have covered the installation of dependencies, configuration of PHP and MariaDB, downloading TYPO3 CMS via Composer, setting up an Apache2 virtual host, securing TYPO3 with SSL/TLS certificates, and installing TYPO3 via the web installer.
Now that you have TYPO3 CMS up and running, you can leverage its enterprise-grade features to create and manage flexible and reliable websites. TYPO3 CMS provides a vibrant professional community and a pluggable architecture that allows you to customize and extend its functionality to meet your specific needs.
If you are looking for reliable and secure hosting solutions for your TYPO3 CMS, consider exploring the services offered by Shape.host. With their Linux SSD VPS, you can enjoy fast and scalable hosting tailored to your TYPO3 CMS requirements.