How to Install TYPO3 CMS on Ubuntu 22.04
This tutorial exists for these OS versions
- Ubuntu 24.04 (Noble Numbat)
- Ubuntu 22.04 (Jammy Jellyfish)
- Ubuntu 20.04 (Focal Fossa)
- Ubuntu 14.04 LTS (Trusty Tahr)
On this page
TYPO3 is a free, open-source, and enterprise-class content management system. It is written in PHP and combines open-source code with reliability and scalability. It is cross-platform and can be installed on all major operating systems, including Windows, Linux, macOS, etc. It is designed for beginner users, so you can easily customize and extend it without writing code. It is simple, responsive, mobile-ready, and a great choice for quickly getting your website up and running.
This tutorial will show you how to install TYPO3 CMS with Let's Encrypt SSL on Ubuntu 22.04.
Prerequisites
- A server running Ubuntu 22.04.
- A valid domain name is linked to your server IP.
- A root password is configured on the server.
Getting Started
First, updating your system packages with the latest version is recommended. You can update all packages by running the following command:
apt update -y
apt upgrade -y
Once all the packages are up-to-date, you can proceed to the next step.
Install Apache, PHP, and MariaDB Server
Next, you will need to install the Apache web server, MariaDB, PHP, and other PHP extensions on your server. You can install all of them with the following command:
apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-gmp php-curl php-intl php-mbstring php-xmlrpc php-mysql php-gd php-xml php-cli php-zip curl git gnupg2 -y
After installing all packages, edit the php.ini file and change some recommended settings:
nano /etc/php/8.1/apache2/php.ini
Change the following lines:
memory_limit = 256M upload_max_filesize = 100M post_max_size = 100M max_execution_time = 360 max_input_vars = 1500 date.timezone = UTC
Save and close the file, then restart the Apache service to apply the changes:
systemctl restart apache2
Create a Database for TYPO3
Next, you will need to create a database and user for TYPO3. First, log in to the MariaDB shell with the following command:
mysql
Once login, create a database and user with the following command:
MariaDB [(none)]> CREATE DATABASE typo3db;
Next, grant all the privileges to the typo3db with the following command:
MariaDB [(none)]> GRANT ALL ON typo3db.* TO 'typo3user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Next, flush the privileges and exit from the MariaDB with the following command:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
At this point, your MariaDB database is configured. You can now proceed to the next step.
Install TYPO3 CMS
First, visit the TYPO3 official website and download the latest version of TYPO3 using the curl command:
curl -L -o typo3_src.tgz https://get.typo3.org/11
Once the download is completed, extract the downloaded file with the following command:
tar -xvzf typo3_src.tgz
Next, move the extracted directory to the Apache web root directory:
mv typo3_src-11.5.15 /var/www/html/typo3
Next, give proper permission and permission with the following command:
chown -R www-data:www-data /var/www/html/typo3
chmod -R 775 /var/www/html/typo3
Once you are finished, you can proceed to the next step.
Create an Apache Virtual Host for TYPO3
Next, create an Apache virtual host configuration file to host TYPO3 CMS. You can create it with the following command:
nano /etc/apache2/sites-available/typo3.conf
Add the following lines:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/typo3 ServerName typo3.example.com <Directory /var/www/html/typo3> Options +FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Save and close the file, then enable the virtual host configuration file and rewrite module with the following command:
a2ensite typo3.conf
a2enmod rewrite
Next, restart the Apache service to apply the changes:
systemctl restart apache2
At this point, the Apache web server is configured to serve TYPO3. You can now proceed to the next step.
Access TYPO3 CMS
If you are installing TYPO3 in a fresh server then you will need to create a FIRST_INSTALL file inside the TYPO3 web root directory. You can create it with the following command:
touch /var/www/html/typo3/FIRST_INSTALL
chown -R www-data:www-data /var/www/html/typo3/FIRST_INSTALL
Now, open your web browser and access the TYPO3 using the URL http://typo3.example.com. You should see the following page:
Provide your database username, password, host and click on the Continue button. You should see the following page:
Select your TYPO3 database name and click on the Continue button. You should see the following page:
Next, provide your admin username, password, site name and click on the Continue button. You will be redirected to the TYPO3 login page:
Provide your admin username, password and click on the Login button. You should see the TYPO3 dashboard on the following page:
Secure TYPO3 with Let's Encrypt
Securing your website with Let's Encrypt Free SSL is a good idea. First, install the Certbot client to install and manage the SSL. You can install it with the following command:
apt-get install python3-certbot-apache -y
Once installed, run the following command to secure your website with Let's Encrypt SSL:
certbot --apache -d typo3.example.com
You will be asked to provide your email and accept the term of service as shown below:
Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator standalone, Installer None Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): [email protected] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server at https://acme-v02.api.letsencrypt.org/directory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (A)gree/(C)ancel: A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y Plugins selected: Authenticator apache, Installer apache Obtaining a new certificate Performing the following challenges: http-01 challenge for typo3.example.com Enabled Apache rewrite module Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/apache2/sites-available/typo3-le-ssl.conf Enabled Apache socache_shmcb module Enabled Apache ssl module Deploying Certificate to VirtualHost /etc/apache2/sites-available/typo3-le-ssl.conf Enabling available site: /etc/apache2/sites-available/typo3-le-ssl.conf
Next, select whether or not to redirect HTTP traffic to HTTPS as shown below:
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: No redirect - Make no further changes to the webserver configuration. 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites, or if you're confident your site works on HTTPS. You can undo this change by editing your web server's configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Type 2 and hit Enter to install the Let's Encrypt SSL for your website:
Enabled Apache rewrite module Redirecting vhost in /etc/apache2/sites-enabled/typo3.conf to ssl vhost in /etc/apache2/sites-available/typo3-le-ssl.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations! You have successfully enabled https://typo3.example.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=typo3.example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/typo3.example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/typo3.example.com/privkey.pem Your cert will expire on 2022-12-07. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
Now, you can access the TYPO3 CMS securely using the URL https://typo3.example.com.
Conclusion
Congratulations! You have successfully installed TYPO3 CMS and secured it with Let's Encrypt SSL on Ubuntu 22.04. You can now create your website and blog easily via a web browser. Feel free to ask me if you have any questions.