How to Install TYPO3 on Ubuntu 22.04

how to install typo3 on ubuntu 22.04

TYPO3 is a free, open-source enterprise Content Management System (CMS) based on PHP.  It allows you to set up flexible blogs and websites easily and is a great alternative to the most popular CMS platforms like WordPress, Joomla, and Drupal.

In this tutorial, we will show you how to install TYPO3 on your Ubuntu 22.04 server.

Requirements

  • Ubuntu 22.04 Server.
  • SSH root access or a user with sudo privileges is also required.

Step 1: Connect to your server via SSH

Connect to your server via SSH as the root user using the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

Remember to replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number. Replace “root” with your admin username if you’re not planning on using the root account.

Before starting the installation, we need to update the OS packages to their latest versions.

We can do this by running the following commands:

apt-get update 
apt-get upgrade

Once the upgrade is complete, we can move on to the next step.

Step 2: Install Apache webserver

To install the Apache web server execute the command below:

apt-get install apache2

To start and enable the apache service, execute the following command:

systemctl start apache2 && sudo systemctl enable apache2

Check the status of the Apache service:

systemctl status apache2

You should get the following output:

● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running)
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 26009 (apache2)
      Tasks: 55 (limit: 2200)
     Memory: 4.8M
        CPU: 136ms
     CGroup: /system.slice/apache2.service
             ├─26009 /usr/sbin/apache2 -k start
             ├─26011 /usr/sbin/apache2 -k start
             └─26012 /usr/sbin/apache2 -k start

Step 3: Install PHP

To install PHP and the required PHP extensions required by TYPO3, run the following command:

apt install php 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

To verify that PHP is successfully installed, run the following command:

php -v

You should get the following output on your screen:

PHP 8.1.2 (cli) (built: Jun 13 2022 13:52:54) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies

Once all the packages are installed, we will need to edit the php.ini file and modify some settings:

nano /etc/php/8.1/apache2/php.ini
max_execution_time = 240
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_input_vars = 1500
date.timezone = America/Chicago

Restart Apache for the changes to take effect.

systemctl restart apache2

Step 4: Install MySQL

TYPO3 supports MySQL, PostgreSQL, and SQLite. Run the following command to install the MySQL server from the official Ubuntu repositories:

apt install mysql-server

When the installation is complete, check the status of the MySQL service:

sudo systemctl status mysql

You should receive the following output:

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running)
    Process: 28664 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
   Main PID: 28672 (mysqld)
     Status: "Server is operational"
      Tasks: 38 (limit: 2200)
     Memory: 359.4M
        CPU: 1.083s
     CGroup: /system.slice/mysql.service
             └─28672 /usr/sbin/mysqld

To enable the MySQL service to start on system reboot execute the following command:

systemctl enable mysql.service

If desired, you can improve the security of your MySQL server, by running the mysql_secure_installation script:

mysql_secure_installation

We recommend answering every prompt with ‘Y’.

Step 5: Create a Database for TYPO3

Next, we will need to log in to the MySQL console and create a database for the TYPO3. Run the following command:

mysql -u root -p
mysql> CREATE DATABASE typo3db; 
mysql> CREATE USER 'typo3user'@'localhost' IDENTIFIED BY 'Str0ngPa$$w0rd'; 
mysql> GRANT ALL PRIVILEGES ON typo3db.* TO 'typo3user'@'localhost'; 
mysql> FLUSH PRIVILEGES; 
mysql> EXIT;

Don’t forget to replace ‘Str0ngPa$$w0rd’ with an actual strong password.

Step 6: Download TYPO3

First, download the latest stable release of the software to your server. To check the latest version, visit the official download page.

At the time of writing this tutorial, the latest stable version of TYP03 is 11.5.12.

cd /tmp
wget --content-disposition https://get.typo3.org/11.5.12

Once it is downloaded, unpack the downloaded TAR archive to the document root directory of your server:

tar -xvzf typo3_src-11.5.12.tar.gz -C /var/www/html

Rename the directory to something simpler (this is optional, however, it makes it easier to type and memorize where your files are):

cd /var/www/html && mv typo3_src-11.5.12 typo3

For a fresh TYPO3 CMS server install, create a file named FIRST_INSTALL on the web root directory.

touch /var/www/html/typo3/FIRST_INSTALL

Set the Apache user to be the owner of all TYPO3 files:

chown -R www-data:www-data typo3

Step 7: Configure Apache TYPO3 Site

Create a new virtual host with the following content by creating a file in the directory /etc/apache2/sites-available:

nano /etc/apache2/sites-available/typo3.conf
<VirtualHost *:80>
     ServerAdmin admin@your_domain.com
     DocumentRoot /var/www/html/typo3
     ServerName your_domain.com
     ServerAlias www.your_domain.com

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

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

Once you are done, save the file and close it.

Activate the server block by creating a symbolic link:

$ ln -s /etc/apache2/sites-available/typo3.conf /etc/apache2/sites-enabled/typo3.conf

And finally, enable the Apache rewrite module and restart the Apache service for the changes to take effect.

a2enmod rewrite
systemctl restart apache2

Step 8: Installing TYPO3 Using the Web Interface

You can now go to your http://your_domain.com and follow the on-screen instructions to complete the TYPO3 installation.

Next, enter your database username, and password and click Continue.

Select the option Use an existing empty database and select the database typo3db, then click Continue.

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS

On the next screen, provide your admin username, password, and site name then click on the Continue button.

The TYPO3 CMS installation is now completed, click the button Open the TYPO3 Backend.

You will be redirected to the TYPO3 login page. Enter your admin username and password, then click Login.


You will see the TYPO3 administration dashboard.

That’s it! TYPO3 CMS has been successfully installed on your Ubuntu 22.04 server.

Of course, you don’t have to install TYPO3 on Ubuntu 22.04 if you use one of our Ubuntu VPS Hosting services, in which case you can simply ask our expert Linux admins to install TYPO3 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to install TYPO3 on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.

Leave a Comment