How to install Textpattern CMS with Apache on Ubuntu 24.04
Installing Textpattern CMS with Apache on Ubuntu 24.04 lets you set up a powerful yet simple website builder.
Textpattern CMS is a free, open-source content management system known for being flexible and reliable, offering a great choice if you find other website builders too complicated.
This guide walks you through installing Textpattern on Ubuntu 24.04 using the Apache web server. You’ll learn how to get Apache ready to host your new Textpattern website smoothly.
Install Apache, MariaDB, and PHP using `apt install apache2 mariadb-server php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mb`. Then, create a Textpattern database in MariaDB and configure Apache to serve your Textpattern files.
Install Apache HTTP server on Ubuntu
To run Textpattern CMS on your Ubuntu 24.04 system, you need to install Apache, which is a web server. Installing Apache is straightforward using the terminal with a couple of simple commands. Just open your terminal and type ‘sudo apt update’ followed by ‘sudo apt install apache2’ to get it set up.
To do that, open the Ubuntu terminal and run the commands below to install the Apache web server.
sudo apt update
sudo apt install apache2
Once Apache is installed, the commands below can start, stop, and enable the Apache web server to start automatically when your server boots up.
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2
You can test that the Apache web server is running by opening your web browser and browsing to the server’s localhost or IP address.
http://localhost

When you see the Apache2 Default Page, it means the Apache HTTP server is successfully installed.
Additional help on installing Apache on Ubuntu is in the link below.
Install the MariaDB database server on Ubuntu
Textpattern CMS requires a database to store all its content and settings, and MariaDB is an excellent choice for your Ubuntu server. You can easily install and set up MariaDB using a few commands directly in your terminal. To begin, open your Ubuntu terminal and run ‘sudo apt update’ then ‘sudo apt install mariadb-server’.
To install and use the MariaDB database server, use the instructions below.
Open the Ubuntu terminal and run the commands below to install the MariaDB database server.
sudo apt update sudo apt install mariadb-server
Once the MariaDB database server is installed, use the commands below to stop, start, and enable the MariaDB server to start automatically when the server boots.
sudo systemctl stop mariadb sudo systemctl start mariadb sudo systemctl enable mariadb
Run the following commands to validate and test if the MariaDB database server is installed successfully.
sudo mariadb
Once you run the commands above, it will log you onto the MariaDB console and display a message similar to the one below.
Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 32 Server version: 10.11.2-MariaDB-1 Ubuntu 23.04 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. MariaDB [(none)]>
The message tells you that the server is installed successfully.
Additional help on installing MariaDB.
- How to install MariaDB on Ubuntu Linux
- MariaDB without password prompt
Create a Textpattern database
Once MariaDB is set up, you must create a specific database for Textpattern to keep all its information safe. This process involves creating the database itself, setting up a dedicated user for it, and then giving that user complete control over the database. We’ll create a database named ‘tpdb’ and a user called ‘tpdbuser’.
As part of the setup, we will create a tpdb database and a user account called tpdbuser.
Finally, we’ll grant the tpdbuser full access to the tpdb database.
All the database steps above can be done using the commands below:
But first, log on to the MariaDB database server:
sudo mariadb
Then run the commands below to complete the steps:
CREATE DATABASE tpdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER tpdbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON tpdb.* TO tpdbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
Ensure to replace ‘type_your_password_here ‘with your password.
Install PHP on Ubuntu Linux
Textpattern CMS is built using PHP, meaning you need to install PHP along with some necessary extra tools on your Ubuntu system. Installing the latest PHP version and the required modules is a simple task using your terminal. Run the command ‘sudo apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common’ to get everything you need.
Then, run the commands below to install the latest PHP version.
sudo apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-bcmath php-json php-sqlite3 php-soap php-zip
Additional help on installing PHP
Download Textpattern files
To get Textpattern CMS running, you need to download its files and place them correctly on your Ubuntu server. You can always find the latest version on the official Textpattern download page. Once you find the download link for the package, download it and then extract its contents into the appropriate folder on your server.
First, navigate to the /tmp/ directory and download the Textpattern files. Next, move the content into the Textpattern folder in the Apache root directory.
cd /tmp/
wget https://textpattern.com/file_download/118/textpattern-4.8.8.zip
sudo unzip textpattern-*.zip
sudo mv textpattern-4.8.8 /var/www/textpattern
sudo chown -R www-data:www-data /var/www/textpattern
Once you have completed all the above steps, continue configuring the Apache web server below to serve the Textpattern content.
Run the commands below to create an Apache virtual host file for Textpattern.
sudo nano /etc/apache2/sites-available/textpattern.conf
Then, copy and paste the content block below into the Apache server block.
<VirtualHost *:80>
ServerName textpartten.example.com
ServerAlias www.textpattern.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/textpattern
<Directory /var/www/textpattern/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save the file.
You can enable the Textpattern virtual host configuration by running the `sudo a2ensite textpattern.conf` command and then restart the Apache web server with `sudo systemctl restart apache2` to apply these changes.
sudo a2ensite textpattern.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
Setup Let’s Encrypt SSL/TLS for Textpattern
It’s important to secure your Textpattern website, and using a free SSL certificate from Let’s Encrypt is the best method for this. You can follow a separate guide to install and create a Let’s Encrypt SSL certificate specifically for Apache on your Ubuntu system. This ensures your site is trusted and secure for all visitors.
Please read the post below for additional resources on installing and creating Let’s Encrypt SSL certificates for Apache.
How to set up Let’s Encrypt SSL certificate for Apache on Ubuntu Linux
Once you have restarted the Apache web server, open your browser and browse to the server hostname or IP address defined in the Apache server block.
http://textpattern.example.com/textpattern/setup/
A Textpattern installation wizard page should appear. Select the installation language and continue.

Type in the database details created above and continue.

Before you proceed: Create a file called config.php in the /var/www/textpattern/textpattern/ directory and paste the following inside.
sudo nano /var/www/textpattern/textpattern/config.php
Paste the content below into the file and save.
<?php
$txpcfg['db'] = 'tpdb';
$txpcfg['user'] = 'tpdbuser';
$txpcfg['pass'] = 'type_your_password_here';
$txpcfg['host'] = 'localhost';
$txpcfg['table_prefix'] = '';
$txpcfg['txpath'] = '/var/www/textpattern/textpattern';
$txpcfg['dbcharset'] = 'utf8mb4';
// For more customization options, please consult config-dist.php file.

Create your admin account.

You should remove the setup directory from your /textpattern/ directory for security reasons. Please check the Admin Diagnostics panel from time to time for update announcements or troubleshooting hints.
sudo rm -rf /var/www/textpattern/textpattern/setup
Your site should be ready to use.

That should do it!
Conclusion:
Following the steps outlined in this guide, you successfully installed Textpattern CMS on your Ubuntu 24.04 server using Apache. Here are the key takeaways:
- Lightweight and Elegant: Textpattern is a user-friendly CMS suitable for publishers, designers, and developers.
- Secure Setup: Utilizing Apache and MariaDB ensures a stable and safe environment for your web application.
- Database Configuration: Creating a dedicated database and user enhances security and management.
- SSL/TLS Implementation: Setting up Let’s Encrypt SSL certificates secures your website with HTTPS, boosting user trust.
- Easy Management: The intuitive interface of Textpattern simplifies content management and website updates.
- Ongoing Maintenance: Regularly check the Admin Diagnostics panel to stay updated on version releases and maintenance tips.
Now, you can start building and managing your website with Textpattern!
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!