How to Install b2evolution with Apache on Ubuntu 24.04
Installing b2evolution with Apache on Ubuntu 24.04 gives you a self-hosted platform that runs multiple blogs, forums, and photo galleries from one server. This guide uses b2evolution version 7.2.6 or newer, so you control your web content without relying on a third-party hosting service.
Apache is the web server that delivers your pages. PHP runs the b2evolution code, and MariaDB stores your posts, comments, and user accounts. Running all of this on your own Ubuntu 24.04 machine keeps your files and data under your control.
Before you start, make sure you have an Ubuntu 24.04 server or desktop and a user account that can run commands with sudo. All commands in this guide run in the terminal. If you plan to use a public domain name with HTTPS, point its DNS record at this server before the SSL step near the end.
To install b2evolution on Ubuntu 24.04 with Apache, first run sudo apt update and sudo apt install apache2, then install the database with sudo apt install mariadb-server. Apache serves your pages, PHP runs the b2evolution code, and MariaDB stores your posts, comments, and user accounts. Apache starts automatically after installation.
Install Apache HTTP server on Ubuntu
Apache is the web server that serves your b2evolution pages to visitors. To install it , open your terminal and run sudo apt update followed by sudo apt install apache2. The first command refreshes the package list. The second downloads and installs Apache from the Ubuntu repositories.
Open the Ubuntu terminal and run the commands in the box below. Apache and its dependencies download and install, which usually takes under a minute on a decent connection. If apt asks you to confirm, type Y and press Enter.
sudo apt update
sudo apt install apache2
After Apache is installed, use the commands below to stop it, start it, and enable it so it starts automatically every time the server boots. On Ubuntu, Apache normally starts by itself right after installation, so the start command is mostly a check. You only need the stop command when you want to take the web server offline.
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2
Next, test that Apache is running. Open a web browser and go to the server's localhost or IP address. If you are working on the server itself, use localhost. If you are connecting from another computer, use the server's IP address.
http://localhost

When you see the Apache2 Default Page, the Apache HTTP server is installed and working.
You will also need port 443 open later if you add HTTPS.
Additional help on installing Apache on Ubuntu is in the link below.
Install the MariaDB database server on Ubuntu
b2evolution needs a database to store its content. To install the MariaDB database server on Ubuntu 24.04, open your terminal and run sudo apt install mariadb-server. This installs the database program that holds all your blog posts, comments, and user accounts.
Use the instructions below to install MariaDB and check that it works.
Open the Ubuntu terminal and run the commands below to install the MariaDB database server.
sudo apt update sudo apt install mariadb-server
Once MariaDB is installed, use the commands below to stop it, start it, and enable it so it starts automatically when the server boots. As with Apache, the service normally starts on its own after installation.
sudo systemctl stop mariadb sudo systemctl start mariadb sudo systemctl enable mariadb
Run the following commands to confirm that the MariaDB database server installed correctly.
sudo mariadb
When you run the commands above, you are logged on to the MariaDB console and see 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)]>
This message tells you the server is installed and responding. If you get an error instead, check that the MariaDB service is running before you go further.
Additional help on installing MariaDB.
- How to install MariaDB on Ubuntu Linux
- MariaDB without password prompt
Create a b2evolution HRM database
To create the b2evolution database, log into the database shell using sudo mysql and run SQL commands that create a new database and a new user. You will set up a database named b2edb and a dedicated user account with full permissions on that database only.
As part of the setup, you will create a b2edb database and a user account called b2edbuser. Using a separate user instead of the MariaDB root account is safer, because b2evolution can then only reach its own data.
Finally, you grant b2edbuser full access to the b2edb database.
You can do all of the database steps above with the commands below.
First, log on to the MariaDB database server:
sudo mariadb
Then run the commands below at the MariaDB prompt to finish the steps:
CREATE DATABASE b2edb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER b2edbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON b2edb.* TO b2edbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
You will need it again in the b2evolution installation wizard.
Install PHP on Ubuntu Linux
b2evolution is written in PHP, so Apache needs PHP and a few extra modules. To install them on Ubuntu 24.04, open your terminal and run sudo apt install php libapache2-mod-php php-intl php-mysql php-curl. This installs PHP itself, the Apache PHP module, and the modules b2evolution needs for internationalization, database access, and web requests.
Then run the commands below to install the latest PHP version available for Ubuntu 24.04. The package manager picks the version that ships with the release, so you don't need to add any extra repository.
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-sqlite3 php-soap php-zip php-ldap php-imap
Additional help on installing PHP.
Download b2evolution HRM files
To download the b2evolution files, go to the official download page, copy the link for the latest release, and use the wget command in your terminal to save the archive into your /tmp/ directory. From there you extract it into the Apache web root.
To always install the latest version, check the download page for b2evolution. Copy the download link, download the archive to your server, then extract it.
First, go to the /tmp/ directory and download the b2evolution files. Next, extract the contents into a b2evolution folder in the Apache root directory.
The last step is to change the permissions. This lets the Apache web server read and write the files it needs, and it keeps your b2evolution installation properly secured.
The permissions on the b2evolution folder must change so the application can work correctly. Run the following commands to set ownership of the b2evolution installation directory (for example, /var/www/b2evolution) to the user Apache runs as, which is www-data on Ubuntu. This gives the application the write access it needs and prevents errors during setup, such as the installer being unable to save its configuration file.
cd /tmpwget https://b2evolution.net/media/blogs/downloads/v7/b2evolution-7.2.6-stable-2022-08-06.zipsudo unzip b2evolution-*.zip -d /var/wwwsudo chown -R www-data:www-data /var/www/b2evolution/
Once the steps above are done, configure Apache to serve the b2evolution content.
Run the commands below to create an Apache virtual host file for b2evolution. The command opens an empty file in a text editor, so you need to run it with administrator rights.
sudo nano /etc/apache2/sites-available/b2evolution.conf
Copy and paste the content block below into the new file. Change the server name and any path in it to match your own domain or IP address and the folder where you extracted b2evolution.
<VirtualHost *:80>
ServerName b2evolution.example.com
ServerAlias www.b2evolution.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/b2evolution
<Directory /var/www/b2evolution/>
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 and close the editor.
Now enable the b2evolution virtual host and restart Apache with the two commands below. Apache only reads a new site configuration after the site is enabled and the service is reloaded or restarted. If Apache fails to restart, there is usually a typo in the virtual host file, so reopen it and compare it to the block above.
sudo a2ensite b2evolution.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
Setup Let’s Encrypt SSL/TLS for b2evolution
To set up Let's Encrypt SSL/TLS for b2evolution on Apache, install the Certbot tool from your terminal, then run its command to configure your domain with a free security certificate. This turns on HTTPS, which protects your visitors' data and your own admin login. Certbot needs a real domain name that points to your server and is reachable from the internet, so this step will not work with localhost or a bare IP address. Certbot normally also sets up automatic renewal, because Let's Encrypt certificates expire after 90 days.
Read the post below for more 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
After you restart the Apache web server, open your browser and go to the server hostname or IP address you set in the Apache virtual host file.
http://b2evolution.example.com/install/index.php
The b2evolution installation wizard should appear. If you still see the Apache default page, the default site is taking priority over your new one. Check that the virtual host is enabled and that the server name matches the address you typed.
Enter the database details you created earlier: the database name (b2edb), the database user (b2edbuser), and the password you chose. Leave the database host at its default unless your database runs on another machine. Then click the Update config file button. This only works if the permissions step was done correctly, because the wizard writes the settings to a file in the b2evolution folder.

Select New Install and click Next.

Click Install to begin. The wizard creates the database tables and the default content, which can take a moment. Do not close the page until it finishes.

b2evolution is now ready to use. Note any login details shown on the final page and keep them somewhere safe, then sign in to the admin area and change the password to your own.

That should do it!
Conclusion:
Setting up b2evolution with Apache on Ubuntu is a straightforward process, and it gives you a capable content management system on your own server. Here are the key takeaways from the installation:
- Multi-Feature CMS: b2evolution is an open-source tool for managing blogs, forums, and newsletters from a single installation.
- Robust Environment: By pairing with Apache and MariaDB, you ensure a robust and flexible infrastructure for your website.
- Easy Installation: The step-by-step instructions simplify the installation process for novice and experienced users.
- Security Features: Implementing SSL/TLS with Let's Encrypt provides enhanced security for your site.
- Customizable: The ability to adjust settings via Apache’s virtual host configuration grants you flexibility in managing your application.
- Community Support: Access to various resources and documentation ensures you can find help when needed.
Keeping a b2evolution site healthy depends on having the right pieces in place: a properly configured Apache web server, a working database, and the b2evolution software files. With these components in place, you can manage and grow your b2evolution-powered site with confidence.
Have a question about this guide?
Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.
Did this guide fix your problem?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!