Skip to content
Follow
CMS

How to install Textpattern CMS with Apache on Ubuntu 24.04

Richard
Written by
Richard
Nov 15, 2024 Updated Sep 15, 2026 7 min read
How to install Textpattern CMS with Apache on Ubuntu 24.04
How to install Textpattern CMS with Apache on Ubuntu 24.04

Textpattern CMS is a free content management system that runs on Ubuntu 24.04 to help you build and manage websites with a clean, simple layout. Apache acts as the web server that hosts your site and shows your pages to visitors.

Advertisement

You need a server running Ubuntu 24.04, an active Apache setup, and PHP to run Textpattern. This setup process takes about 15 minutes to complete from start to finish.

⚡ Quick Answer

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.

Advertisement

Install Apache HTTP server on Ubuntu

Apache HTTP server installation on Ubuntu 24.04 requires the standard package manager to download and set up the web server. Open your terminal and run the command sudo apt update followed by sudo apt install apache2 to install the software. Once the installation finishes, the Apache service starts automatically on your system.

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.

Advertisement

http://localhost

Apache2 default landing page confirming successful installation on Ubuntu 24.04 server
Apache2 default landing page confirming successful installation on Ubuntu 24.04 server

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.

How to install Apache on Ubuntu

Advertisement

Install the MariaDB database server on Ubuntu

MariaDB database server installation on Ubuntu 24.04 provides the database storage required by Textpattern CMS. Open your terminal and run sudo apt update followed by sudo apt install mariadb-server to download and set up the database software. After the installation completes, start the database service and secure the root installation.

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.

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

Advertisement

Create a Textpattern database

Database creation for Textpattern involves setting up a dedicated database and user in MariaDB to store your site content securely. Log into the MariaDB shell using sudo mysql and run the create database and grant privileges commands to set up the new database and user account. Make sure to replace the placeholder names with your own secure credentials.

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:

Advertisement

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
⚠️WarningEnsure to replace 'type_your_password_here 'with your password.

Install PHP on Ubuntu Linux

PHP installation on Ubuntu 24.04 requires the core language processor and several mandatory extensions for Textpattern CMS to function correctly. Run sudo apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common in your terminal to install all required modules at once. This ensures the Apache web server can process dynamic PHP pages.

Advertisement

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

How to install PHP on Ubuntu Linux

Download Textpattern files

Textpattern CMS file download and setup requires getting the latest stable release package from the official project website and extracting it into your web root directory. Use the wget command followed by the direct download link in your terminal to fetch the archive directly to your server. After downloading, extract the files and adjust the folder permissions so Apache can read them.

To always install the latest version, check the download page for Textpattern. Get the download link and download the archived package to your computer. Then, extract it.

First, navigate to the /tmp/ directory and download the Textpattern files. Next, move the content into the Textpattern folder in the Apache root directory.

The final step is to change the permissions. This will allow the Apache web server to interact safely with the files, ensuring a secure environment for your Textpattern installation.

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

Let's Encrypt SSL/TLS certificate setup for Apache on Ubuntu secures your Textpattern website with free HTTPS encryption. Install Certbot using your package manager and run the Apache plugin command to automatically generate and configure your SSL certificate. This process updates your web server configuration to redirect all traffic to the secure version of your site.

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.

Textpattern installation wizard language
Textpattern installation wizard language

Type in the database details created above and continue.

Textpattern installation wizard database
Textpattern installation wizard database
⚠️WarningBefore 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.
Textpattern installation wizard config
Textpattern installation wizard config

Create your admin account.

Textpattern installation wizard admin
Textpattern installation wizard admin

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.

Textpattern installation wizard complete
Textpattern installation wizard complete

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?

Was this helpful?
Richard

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.

Advertisement

📚 Related Tutorials

How to Install Apache on Ubuntu Linux
Ubuntu Linux How to Install Apache on Ubuntu Linux
Install MySQL and MariaDB on Ubuntu: A Step-by-Step Guide
Ubuntu Linux Install MySQL and MariaDB on Ubuntu: A Step-by-Step Guide
How to Install PHP on Ubuntu Linux
Ubuntu Linux How to Install PHP on Ubuntu Linux
How to install Textpattern CMS with Nginx on Ubuntu 24.04
CMS How to install Textpattern CMS with Nginx on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *