Skip to content
Follow
CMS

How to install Bolt CMS with Apache on Ubuntu 24.04

Richard
Written by
Richard
Jun 15, 2024 Updated Jul 13, 2026 7 min read
Bolt CMS featured image
Bolt CMS featured image

Installing Bolt CMS with Apache on Ubuntu 24.04 lets you create and manage website content easily.

Bolt CMS is a flexible, open-source system for building modern websites. Apache is a popular web server great for running PHP sites like Bolt.

This guide walks you through installing Bolt CMS version 5.2.x on Ubuntu 24.04. We’ll specifically set it up to work with the Apache web server.

Following these steps will give you a secure and fast content management system for your website projects.

⚡ Quick Answer

Install Apache, MariaDB, and PHP 7.2 with the necessary modules using `apt`. Create a database and user for Bolt within MariaDB. Download Bolt, configure Apache virtual host, and run the Composer installer to complete the setup.

Install Apache HTTP server on Ubuntu

Apache is a web server needed for Bolt CMS to work. Installing Apache on Ubuntu 24.04 is easy using the terminal. Just open your terminal and run the commands to get the Apache web server set up so Bolt CMS can function correctly.

To do that, open the Ubuntu terminal and run the commands below to install the Apache web server.

🐧Bash / Shell
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.

🐧Bash / Shell
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

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

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

Install the MariaDB database server on Ubuntu

Bolt CMS needs a database to keep all its information safe. MariaDB is a good choice for your Ubuntu 24.04 server. To install and start using MariaDB, open your Ubuntu terminal and run the commands provided below to set up the database 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.

🐧Bash / Shell
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.

🐧Bash / Shell
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.

🐧Bash / Shell
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.

💻Code
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.

Create a Bolt database

After setting up MariaDB, you must create a special database and user just for Bolt CMS. We will create a database called ‘boltdb’ and a user named ‘boltdbuser’. This user gets full control over the ‘boltdb’ database, which is essential for Bolt CMS to store its content.

As part of the setup, we will create a boltdb database and a user account called boltdbuser.

Finally, we’ll grant the boltdbuser full access to the boltdb database.

All the database steps above can be done using the commands below:

But first, log on to the MariaDB database server:

🐧Bash / Shell
sudo mariadb

Then run the commands below to complete the steps:

💻Code
CREATE DATABASE boltdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER boltdbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON boltdb.* TO boltdbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

Ensure to replace ‘type_your_password_here ‘with your password.

Install PHP on Ubuntu Linux

Bolt CMS is built with PHP, so you need to install a version that works on your Ubuntu system. To install an older PHP version, first add the correct software source. Then, run the commands to install PHP 7.2 and other needed parts for Bolt CMS.

To install an older version of PHP, add this repository.

🐧Bash / Shell
sudo add-apt-repository ppa:ondrej/php

Then, run the commands below to install the PHP 7.2 version.

🐧Bash / Shell
sudo apt install php7.2 libapache2-mod-php7.2 php7.2-intl php7.2-mysql php7.2-curl php7.2-cli php7.2-zip php7.2-xml php7.2-gd php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-json php7.2-sqlite3 php7.2-soap php7.2-zip

Additional help on installing PHP

How to install PHP on Ubuntu Linux

Download Bolt files

To install Bolt CMS on Ubuntu, you first need to download the files using Composer. After downloading, you’ll set up its settings. Start by installing Composer, Curl, and other required tools using the terminal to get the necessary components for Bolt CMS.

First, install Composer, Curl, and other dependencies.

🐧Bash / Shell
sudo apt install curl git
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Then, navigate to the /var/www/ directory and clone the Bolt files. Next, make a copy of Bolt’s sample config.yml.dist file to create a new one called config.yml.

Command Prompt
cd /var/www
sudo git clone https://github.com/bolt/bolt.git
sudo cp /var/www/bolt/app/config/config.yml.dist /var/www/bolt/app/config/config.yml

Next, open the Bolt config.yml file using the command below.

🐧Bash / Shell
sudo nano /var/www/bolt/app/config/config.yml
⚠️Warning
Then, add the database name, username, and password created above. Save the file and exit.
💻Code

# If you're trying out Bolt, just keep it set to SQLite for now.
database:
driver: mysql
databasename: boltdb
username: boltdbuser
password: your_strong_password
⚠️Warning
After setting up your environment above, change to the bolt directory and install all required PHP dependencies for Bolt CMS using Composer.
Command Prompt
cd /var/www/bolt
sudo composer install
sudo chown -R www-data:www-data /var/www/bolt

Once you have completed all the above steps, continue configuring the Apache web server below to serve the Bolt content.

Run the commands below to create an Apache virtual host file for Bolt.

🐧Bash / Shell
sudo nano /etc/apache2/sites-available/bolt.conf

Then, copy and paste the content block below into the Apache server block.

💻Code
<VirtualHost *:80>
ServerName bolt.example.com
ServerAlias www.bolt.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/bolt

<Directory /var/www/bolt/>
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 Bolt CMS virtual host and restart the Apache server by running specific commands. This action makes the Bolt CMS website accessible through your web browser.

🐧Bash / Shell
sudo a2ensite bolt.conf
sudo a2enmod rewrite
sudo systemctl restart apache2

Setup Let’s Encrypt SSL/TLS for Bolt

Securing your Bolt CMS website with a free SSL certificate from Let’s Encrypt is important for protecting data and building trust. Please read the linked guide for more details on how to install and create Let’s Encrypt SSL certificates specifically for Apache, ensuring your Bolt CMS site is secure.

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.

💻Code
http://bolt.example.com/

A Bolt setup wizard page should appear. Create the first user for the site.

Bolt CMS create first user
Bolt CMS create first user

Your Bolt site should be set up and ready to use.

Bolt CMS setup complete
Bolt CMS setup complete

That should do it!

Conclusion

  • Installing Bolt CMS with Apache on Ubuntu grants you the stability of the widely used Apache web server for exceptional performance and reliability.
  • The addition of the MariaDB database server provides secure and robust support for dynamic website content, ensuring a solid foundation for your Bolt CMS installation.
  • Setting up the Bolt database and creating a user account is easy, with clear step-by-step instructions, ensuring a seamless integration process.
  • Installing the required PHP components, configuring Bolt files on Ubuntu, and installing the Let’s Encrypt SSL/TLS certificate establishes a well-rounded environment for a secure and efficient Bolt CMS deployment.

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.

📚 Related Tutorials

How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04
How to install Bolt CMS with Nginx on Ubuntu 24.04
CMS How to install Bolt 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 *