Install TYPO3 CMS on Ubuntu 22.04

In this guide, you will learn to Install and Configure TYPO3 CMS with LAMP Stack on Ubuntu 22.04. TYPO3 is a free and open-source content management system (CMS). With TYPO3 you can easily build and manage your website.

Now you can follow the steps below to start your TYPO3 installation on your Ubuntu 22.04.

Steps To Install TYPO3 CMS With LAMP Stack on Ubuntu 22.04

You must have access to your server as a non-root user with sudo privileges and set up a basic firewall. For this purpose, you can visit this guide on Initial Server Setup with Ubuntu 22.04.

Because we want to install TYPO3 with LAMP stack, you must install it on your server. To do this, you can visit this guide on Install LAMP Stack on Ubuntu 22.04.

Also, you need a domain name that is pointed to your server’s IP address.

When you are done, follow the steps below to complete your TYPO3 installation.

Step 1 – Configure PHP for TYPO3 CMS on Ubuntu

First, you need to install PHP extensions that are needed for TYPO3 CMS. To do this, you can run the following command:

sudo apt install libapache2-mod-php php-cli php-common php-gmp php-curl php-mysql php-json php-intl php-mbstring php-xmlrpc php-gd php-xml php-zip php-imap

Then, you need to edit the php.ini file and make some configuration changes to it for your TYPO 3 CMS. To do this, you can open the file with your desired text editor, we use vi:

sudo vi /etc/php/8.1/apache2/php.ini

In the file look for the following directives and change their value as shown below:

max_execution_time = 240

memory_limit = 256M

upload_max_filesize = 100M

post_max_size = 100M

max_input_vars = 1500

date.timezone = Etc/UTC

When you are done, save and close the file.

Next, restart Apache to apply the changes:

sudo systemctl restart apache2

Step 2 – Create a TYPO3 Database and Database User

At this point, you must create a TYPO3 database and user. To do this, log in to your MariaDB shell with the command below:

sudo mysql -u root -p

Then, from your MariaDB shell run the command below to create the TYPO3 database on Ubuntu 22.04:

MariaDB [(none)]> CREATE DATABASE typo3db; 

Next, create your database user with a strong password by using the following command:

MariaDB [(none)]> CREATE USER 'typo3user'@'localhost' IDENTIFIED BY 'strongpassword'; 

Grant all the privileges to your database user by using the command below:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON typo3db.* TO 'typo3user'@'localhost'; 

Finally, flush the privileges and exit from the MariaDB console by using the commands below:

MariaDB [(none)]> FLUSH PRIVILEGES; 
MariaDB [(none)]> EXIT;

Step 3 – Download TYPO3 LTS on Ubuntu 22.04

At this point, you need to visit the TYPO3 downloads page and get the latest version by using the following wget command under the /tmp directory:

# cd /tmp
# sudo wget --content-disposition https://get.typo3.org/12.4.1

Then, extract your downloaded file in the /var/www/html directory by using the command below:

sudo tar -xvzf typo3_src-12.4.1.tar.gz -C /var/www/html

Next, switch to your web root directory and rename your TYPO3 file with the command below:

# cd /var/www/html 
# sudo mv typo3_src-12.4.1 /var/www/html/typo3

Now you can create a file on your web root directory for a fresh installation of TYPO3:

sudo touch /var/www/html/typo3/FIRST_INSTALL

Set the correct ownership for your TYPO3 and set the correct permissions on Ubuntu 22.04 with the command below:

# sudo chown -R www-data:www-data /var/www/html/typo3
# sudo chmod -R 755 /var/www/html/typo3

Step 4 – Configure Apache for TYPO3 on Ubuntu 22.04

At this point, you need to create an Apache virtual host for TYPO3 by using the command below: Here we use the vi editor, you can use your desired text editor like nano editor.

sudo vi /etc/apache2/sites-available/typo3.conf

Add the following content to the file:

<VirtualHost *:80>
     ServerAdmin admin@example.com
     DocumentRoot /var/www/html/typo3
     ServerName example.com
     ServerAlias www.example.com

     <Directory /var/www/html/typo3/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/typo3_error.log
     CustomLog ${APACHE_LOG_DIR}/typo3_access.log combined
</VirtualHost>

When you are done, save and close the file.

Then, disable the default Apache configuration file with the following command:

sudo a2dissite 000-default.conf

Activate your Apache virtual host file by using the command below:

sudo a2ensite typo3.conf

Finally, enable the Apache rewrite module and restart the Apache service to apply the changes:

# sudo a2enmod rewrite
# sudo systemctl restart apache2

Step 7 – Configure Firewall for TYPO3 on Ubuntu 22.04

If you have a running UFW firewall, you must allow port HTTP. To do this, you can run the command below:

# sudo ufw allow http

To apply the changes, reload the firewall:

sudo ufw reload

Step 8 – TYPO3 Setup through Web Interface on Ubuntu 22.04

At this point, you can continue your TYPO3 installation through the web interface by typing your domain name in your web browser:

http://example.com-or-ipaddress/typo3

You will see the following screen. Enter ‘No problems detected, continue with installation‘.

TYPO3 overview

Then, enter your MariaDB user credentials for TYPO3 CMS installation.

TYPO3 database user credentials Ubuntu 22.04

Next, you need to choose ‘Use an existing empty database‘, select the database ‘typo3db‘, and click Continue.

Select TYPO3 database

At this point, you need to create an Admin user and password for your TYPO3 CMS on Ubuntu 22.04, choose a site name, and click Continue.

TYPO3 admin user

Now choose ‘Take me straight to the backend‘ and click ‘Open the TYPO3 Backend‘ to continue.

Open TYPO3 backend Ubuntu 22.04

Then, you will see your TYPO3 login screen. Enter your Admin user and password and click Login.

TYPO3 login screen

You will see your TYPO3 CMS dashboard on Ubuntu 22.04:

TYPO3 CMS dashboard on Ubuntu 22.04

From your TYPO3 CMS dashboard, you can easily manage your website.

Step 8 (Optional) – Secure TYPO3 Installation with Let’s Encrypt

At this point, you can use the certbot command to generate SSL/TLS certificates for your TYPO3 CMS domain name.

First of all, you need to install “certbot” to get an SSL certificate with Let’s Encrypt:

sudo apt install certbot python3-certbot-apache -y

To allow for HTTPS traffic, allow the “Apache Full” profile with the following command:

sudo ufw allow 'Apache Full'

Then, run the certbot to get your SSL certificates:

sudo certbot --apache

You will be asked some questions. Enter your Email address, Accept the terms of service, and Activate HTTPS for your site.

Next, you can set up the auto-renewal Of the Lets Encrypt Certifications by using the command below:

sudo certbot renew --dry-run

At this point, you can easily access your TYPO3 CMS with HTTPS:

https://domain-name/typo3

Conclusion

At this point, you have learned to Install and Configure TYPO3 CMS with LAMP Stack on Ubuntu 22.04 Step by Step. And you have learned to complete your TYPO3 setup through the web interface. Additionally, you have learned to secure your TYPO3 installation by generating the SSL certificates from Let’s Encrypt.

Hope you enjoy it. You may like these articles on the Orcacore Blog page:

Install build-essential on Ubuntu 22.04

Install and Configure WordPress on Ubuntu 22.04

Fix no module named ‘distutils’

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!