Self-hosting TYPO3 v14 LTS on Linux

How to install and run TYPO3 v14 LTS on Debian 13

Self-hosting TYPO3 v14 LTS on Linux

TYPO3 is a professional and enterprise-grade open-source CMS. Its most recent LTS release (version 14.3) is coming out this week. So let’s see how to self-host this new release on the currently stable Debian GNU/Linux 13. Below you find all steps necessary as shell commands, which you can just copy and paste. Or you can also get everything bundled into a complete shell script.

Prerequisites

We start from a fresh Debian 13 system inside a container, virtual machine or on bare metal. To run the commands you must have root privileges. We also need to define user names and passwords for the database and TYPO3 admin account, which we preset as environment variables.

DBUSER="typo3"
DBPASS="typo3"
DBNAME="typo3"
ADMINPASS="Admin1234%"

Of course you can customized these as you wish and you definitely should for production.

Install all dependencies

Next, we are going to install all dependencies, such as the Apache web server, MariaDB data base server and PHP with Composer and libraries.

apt-get update
apt-get upgrade

apt-get -y install apache2 libapache2-mod-php php-gd php-xml php-zip php-pdo php-mysql php-common php-intl php-tokenizer php-curl php-imagick wget mariadb-server unzip composer imagemagick

Download TYPO3 via Composer

A fresh TYPO3 can be easily downloaded using Composer. Additionally, we install the new Camino frontend theme.

cd /var/www
composer create-project typo3/cms-base-distribution typo14 "^14"
cd /var/www/typo14
composer require typo3/theme-camino

Configure database and web server

TYPO3 runs on a database and web server, which need to be configured for it. We create a new database with account and permissions, properly set PHP variables, setup an Apache virtual host configuration, and enable necessary Apache modules.

mysql << EOF
CREATE DATABASE $DBNAME;
CREATE USER $DBUSER@'localhost' IDENTIFIED BY "$DBPASS";
GRANT ALL PRIVILEGES ON $DBNAME.* TO $DBUSER@'localhost';
FLUSH PRIVILEGES;
EOF

php_ini="/etc/php/8.4/apache2/php.ini"
cp $php_ini $php_ini.bak
sed -i 's/^;date.timezone =/date.timezone = "Europe\/Berlin"/' $php_ini
sed -i 's/^max_execution_time = 30/max_execution_time = 240/' $php_ini
sed -i 's/^;max_input_vars = 1000/max_input_vars = 1500/' $php_ini
sed -i 's/^upload_max_filesize = 2M/upload_max_filesize = 10M/' $php_ini
sed -i 's/^post_max_size = 8M/post_max_size = 10M/' $php_ini
sed -i 's/memory_limit = 128M/memory_limit = 256M/' $php_ini
sed -i 's/^;pcre.jit=1/pcre.jit = 1/' $php_ini

cat << EOF > /etc/apache2/sites-available/typo3.conf
<VirtualHost *:80>
    #ServerName $DOMAIN
    DocumentRoot /var/www/typo14/public
    <Directory /var/www/typo14/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    ErrorLog \${APACHE_LOG_DIR}/typo3_error.log
    CustomLog \${APACHE_LOG_DIR}/typo3_access.log combined
</VirtualHost>
EOF

a2enmod expires headers rewrite
a2dissite 000-default
a2ensite typo3
systemctl restart apache2

Configure TYPO3

With a properly configured web server and database, we can finally setup our TYPO3 instance—also from the command line.

cd /var/www/typo14
./vendor/bin/typo3 setup --no-interaction --server-type=apache --driver=pdoMysqlSocket --username="$DBUSER" --dbname="$DBNAME" --password="$DBPASS" --admin-user-password="$ADMINPASS"
./vendor/bin/typo3 extension:setup

chown -R www-data:www-data /var/www/typo14

Finish

The last few commands just summarize how we can access the frontend and backend of our fresh TYPO3 site.

IP=$(ip -4 -o address | grep eth0 | tr -s " " | tr "/" " " | cut -d ' ' -f4)
echo "Frontend URL/IP: http://$IP/camino/"
echo "Backend URL/IP: http://$IP/typo3/"
echo "Backend login: admin / $ADMINPASS"

Conclusion

I hope you found this guide helpful, although we only covered the initial setup. In order to bring our TYPO3 installation into production and publish sites a few things still remain to be done:

  1. Add backend users or editors and configure their permissions.
  2. Create pages and contents.
  3. Setup to use HTTPS for secure web traffic.
  4. Add more extensions as needed.