Install TYPO3 CMS on Ubuntu 22.04: Free CMS – OrcaCore

Posted on

Install TYPO3 CMS on Ubuntu 22.04: Free CMS - OrcaCore

Install TYPO3 CMS on Ubuntu 22.04: Free CMS – OrcaCore

In this comprehensive guide, you will learn how to Install TYPO3 CMS on Ubuntu 22.04 with a LAMP Stack. TYPO3 is a robust, enterprise-level, free and open-source content management system (CMS). With TYPO3, you can build and manage sophisticated websites, web applications, and online platforms with ease. This article will walk you through each step of the installation process, ensuring a smooth setup of TYPO3 on your Ubuntu 22.04 server. Now you can follow the steps below on the Orcacore website to start your TYPO3 installation on your Ubuntu 22.04.

Steps To Install TYPO3 CMS on Ubuntu 22.04 with LAMP Stack

Before beginning the installation, ensure you have the necessary prerequisites in place.

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

Since we are installing TYPO3 with a LAMP stack (Linux, Apache, MySQL/MariaDB, PHP), you must install it on your server. You can follow this guide on Install LAMP Stack on Ubuntu 22.04 to set up your LAMP environment.

Also, you need a domain name that is pointed to your server’s IP address. This is crucial for accessing your TYPO3 website through a human-readable address.

Once these prerequisites are met, follow the steps below to Install TYPO3 CMS on Ubuntu 22.04.

Step 1 – Configure PHP for TYPO3 CMS on Ubuntu

To successfully Install TYPO3 CMS on Ubuntu 22.04, you need to install the PHP extensions that TYPO3 CMS requires. Execute the following command to install these extensions:

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

Next, you need to edit the php.ini file and make configuration changes to optimize PHP for TYPO3. To do this, open the file with your preferred text editor (we’ll use vi here):

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

Within the php.ini file, search for the following directives and modify their values as shown below. These settings are essential for TYPO3 to function correctly:

max_execution_time = 240
memory_limit = 256M
upload_max_filesize = 100M
post_max_size = 100M
max_input_vars = 1500
date.timezone = Etc/UTC

After making these changes, save the file and close the editor.

Finally, restart the Apache web server to apply the new PHP settings:

sudo systemctl restart apache2

Step 2 – Create a TYPO3 Database and Database User

To Install TYPO3 CMS on Ubuntu 22.04, you must create a dedicated database and user for TYPO3. Log in to your MariaDB shell with the following command:

sudo mysql -u root -p

From your MariaDB shell, execute the following command to create the TYPO3 database on Ubuntu 22.04:

-- MariaDB [(none)]>
CREATE DATABASE typo3db;

Next, create a database user with a strong, secure password:

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

Grant all privileges on the typo3db database to the newly created user:

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

Finally, flush the privileges to apply the changes and exit the MariaDB console:

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

Step 3 – Download TYPO3 LTS on Ubuntu 22.04

To Install TYPO3 CMS on Ubuntu 22.04, visit the TYPO3 downloads page and obtain the latest version using the following wget command within the /tmp directory:

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

Extract the downloaded file into the /var/www/html directory:

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

Switch to your web root directory and rename the TYPO3 source directory:

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

Create a FIRST_INSTALL file in your web root directory to indicate a fresh TYPO3 installation:

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

Set the correct ownership and permissions for the TYPO3 directory on Ubuntu 22.04:

# 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

To Install TYPO3 CMS on Ubuntu 22.04, create an Apache virtual host configuration file for TYPO3. Here, we use the vi editor; however, you can use any text editor of your choice, such as nano:

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

Add the following content to the file. Remember to replace admin@example.com and example.com with your actual email address and domain name, respectively:

<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>

Save the file and close the editor.

Disable the default Apache configuration file:

sudo a2dissite 000-default.conf

Activate your TYPO3 virtual host file:

sudo a2ensite typo3.conf

Enable the Apache rewrite module and restart the Apache service to apply the changes:

# sudo a2enmod rewrite
# sudo systemctl restart apache2

Step 5 – Configure Firewall for TYPO3 on Ubuntu 22.04

If you have the UFW firewall enabled, you need to allow HTTP traffic. Execute the following command:

# sudo ufw allow http

Reload the firewall to apply the changes:

sudo ufw reload

Step 6 – TYPO3 Setup through Web Interface on Ubuntu 22.04

Now, you can proceed with the TYPO3 installation through your web browser by entering your domain name or server IP address followed by /typo3:

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

You will be presented with a system environment check. If there are no issues, proceed with the installation.

Enter your MariaDB user credentials for the TYPO3 CMS installation.

Choose “Use an existing empty database”, select the database “typo3db”, and click Continue.

Create an Admin user and password for your TYPO3 CMS on Ubuntu 22.04, choose a site name, and click Continue.

Select “Take me straight to the backend” and click “Open the TYPO3 Backend” to continue.

Enter your Admin user and password on the TYPO3 CMS login screen and click Login.

You should now see your TYPO3 CMS dashboard on Ubuntu 22.04.

At this point, you have successfully learned how to Install TYPO3 CMS on Ubuntu 22.04. You can now manage your website from the TYPO3 CMS dashboard.

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

You can secure your TYPO3 CMS with an SSL/TLS certificate from Let’s Encrypt using Certbot.

First, install Certbot:

sudo apt install certbot python3-certbot-apache -y

Allow HTTPS traffic through the firewall:

sudo ufw allow 'Apache Full'

Run Certbot to obtain your SSL certificates:

sudo certbot --apache

Follow the prompts, entering your email address, accepting the terms of service, and activating HTTPS for your site.

Set up auto-renewal of the Let’s Encrypt certificates:

sudo certbot renew --dry-run

You can now access your TYPO3 CMS securely via HTTPS:

https://domain-name/typo3

Conclusion

You have now learned how to Install TYPO3 CMS on Ubuntu 22.04 with a LAMP Stack step by step and complete the TYPO3 setup through the web interface. You’ve also learned how to secure your TYPO3 installation by generating SSL certificates from Let’s Encrypt.

Alternative Solutions for Installing TYPO3

While the above method using a manual LAMP stack is a valid approach, here are two alternative solutions for installing TYPO3 on Ubuntu 22.04, providing potentially simpler and more streamlined processes.

1. Using Docker Compose

Docker provides a containerization solution that can significantly simplify the deployment of TYPO3. Using Docker Compose, you can define the entire stack (web server, database, PHP) in a single docker-compose.yml file and deploy it with a single command.

Explanation:

Docker containers encapsulate all the necessary dependencies for TYPO3, ensuring consistency across different environments. Docker Compose allows you to define and manage multi-container Docker applications.

Steps:

  1. Install Docker and Docker Compose: If you haven’t already, install Docker and Docker Compose on your Ubuntu 22.04 server.

    sudo apt update
    sudo apt install docker.io docker-compose -y
  2. Create a docker-compose.yml file: Create a directory for your TYPO3 project and within it, create a docker-compose.yml file.

    mkdir typo3-docker
    cd typo3-docker
    nano docker-compose.yml
  3. Define the services: Add the following content to the docker-compose.yml file. This example uses the official TYPO3 Docker image along with a MariaDB database.

    version: "3.8"
    services:
      db:
        image: mariadb:10.6
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: rootpassword
          MYSQL_DATABASE: typo3db
          MYSQL_USER: typo3user
          MYSQL_PASSWORD: strongpassword
        volumes:
          - db_data:/var/lib/mysql
    
      typo3:
        image: typo3/cms-nginx:12.4
        restart: always
        ports:
          - "80:80"
          - "443:443"
        depends_on:
          - db
        environment:
          TYPO3_CONTEXT: Development
        volumes:
          - typo3_data:/var/www/html
        links:
          - db:database
    volumes:
      db_data:
      typo3_data:
  4. Run Docker Compose: Start the services defined in the docker-compose.yml file.

    docker-compose up -d
  5. Access TYPO3: After Docker Compose completes, access TYPO3 in your web browser using your server’s IP address or domain name. You will still need to complete the TYPO3 installation via the web interface as described in the original guide, using the database credentials defined in the docker-compose.yml file.

This approach offers a cleaner and more isolated environment for TYPO3, simplifying deployment and management.

2. Using a Pre-built Virtual Machine Image

Another alternative is to use a pre-built virtual machine (VM) image that already has TYPO3 and all its dependencies configured. Several providers offer such images, saving you the trouble of manual installation.

Explanation:

VM images provide a complete operating system and application environment, ready to be deployed on a virtualization platform like VirtualBox or VMware.

Steps:

  1. Choose a VM Image: Search for a TYPO3 VM image. Bitnami is a reputable provider offering ready-to-use TYPO3 VM images.

  2. Download the VM Image: Download the appropriate VM image for your virtualization platform (e.g., VirtualBox, VMware).

  3. Import the VM Image: Import the downloaded VM image into your chosen virtualization software.

  4. Configure Network Settings: Configure the network settings of the VM to allow access from your host machine. Typically, you’ll want to use a bridged or NAT network configuration.

  5. Start the VM: Start the virtual machine.

  6. Access TYPO3: Once the VM is running, access TYPO3 via the IP address assigned to the VM. The Bitnami images typically provide instructions on accessing the application in their documentation.

While this approach requires a virtualization platform, it offers the quickest way to get TYPO3 up and running, especially for testing and development purposes.