How to install Joomla 3 on CentOs 7 /Redhat 7 Linux (RHEL)
Enjoying this content? Subscribe to the Channel!
Mastering Content: Install Joomla 3 on CentOS 7 & RHEL 7 (The Complete Step-by-Step Guide)
Welcome back to Darren’s Tech Tutorials!
If you’re looking to build a powerful, flexible website or application, Joomla is one of the world’s most popular Content Management Systems (CMS) for a reason. And today, we’re showing you exactly how to get Joomla 3 up and running on the reliable bedrock of CentOS 7 or Red Hat Enterprise Linux (RHEL 7).
This comprehensive guide takes you step-by-step through the process, from preparing your files and installing necessary PHP components, to setting up your database and launching the final web installer. Let’s dive in and transform your server into a fully functional Joomla host!
Prerequisites: What You Need Before We Start
To successfully follow along with this tutorial, you must have a functioning LAMP stack (Linux, Apache, MariaDB/MySQL, and PHP) installed on your CentOS 7 server.
If you haven’t set up your base environment yet, don’t worry! We have detailed tutorials ready for you:
- Linux Installation: How to install CentOS 7
- Web Server Setup: How to install Apache on CentOS 7
- Database Setup: How to Install MariaDB (MySQL) on CentOS 7
Once your LAMP stack is ready, open up your terminal and let’s get started!
## Step 1: Download, Unpack, and Position the Joomla Files
The first step is retrieving the Joomla installation package and moving its contents to the appropriate directory where Apache can access them. We will be using the standard Apache web root, typically located at /var/www/html/.
-
Navigate to a temporary directory:
cd /tmp -
Download the latest stable Joomla 3 package. (Always check the official Joomla website for the most current link.)
wget https://downloads.joomla.org/cms/joomla3/3-9-27/Joomla_3-9-27-Stable-Full_Package.zip -
Unzip the archive:
unzip Joomla_3-9-27-Stable-Full_Package.zip -
Move the unzipped files to the Apache web root. We recommend creating a dedicated folder (e.g.,
joomla) for clean organization:sudo mv * /var/www/html/joomla/
## Step 2: Install Essential PHP Components
Joomla is built on PHP, and it requires specific modules to handle database connections, image manipulation, and other core functions. A crucial component for talking to MariaDB (or MySQL) is the php-mysqli extension.
Use yum to install the necessary packages. Note: If you haven’t installed PHP already, this command will install the base package along with the required extensions.
sudo yum install php php-mysql php-gd php-xml -y
Crucial Step: After installing new PHP modules, you must restart the Apache web server for the changes to take effect.
sudo systemctl restart httpd
## Step 3: Configure File Permissions for Apache
For Joomla to successfully write configuration files, install extensions, and manage media, the Apache web server user (apache on CentOS) needs appropriate ownership of the files.
We will set the ownership of the entire Joomla directory to the Apache user and group, and then ensure the files have the correct permissions.
-
Change Ownership (chown):
sudo chown -R apache:apache /var/www/html/joomla/ -
Set Directory Permissions (chmod): (We’ll use
755for directories and644for files for a good balance of security and functionality.)sudo find /var/www/html/joomla/ -type d -exec chmod 755 {} \; sudo find /var/www/html/joomla/ -type f -exec chmod 644 {} \;
## Step 4: Set Up the Joomla Database in MariaDB/MySQL
Joomla needs its own dedicated database and user account to store all its configuration and content. We will now log into the MariaDB shell and create these credentials.
-
Access the MariaDB/MySQL shell:
mysql -u root -p(Enter your root password when prompted.)
-
Create the new database (We’ll call it
joomladb):CREATE DATABASE joomladb; -
Create a new dedicated database user (Replace
'strong_password'with a secure password):CREATE USER 'joomlauser'@'localhost' IDENTIFIED BY 'strong_password'; -
Grant all necessary permissions to the new user on the new database:
GRANT ALL PRIVILEGES ON joomladb.* TO 'joomlauser'@'localhost'; -
Flush privileges to ensure the database system recognizes the new settings immediately:
FLUSH PRIVILEGES; -
Exit the MariaDB shell:
EXIT;
## Step 5: Finalize the Joomla Web Installation
The hard work on the server side is done! All the files are in place, PHP is configured, permissions are set, and your database is waiting.
Now, you can complete the installation via your web browser:
-
Open your preferred web browser.
-
Navigate to the IP address or domain name of your CentOS 7 server, followed by the Joomla directory:
http://[Your_Server_IP]/joomla
-
The Joomla installation wizard will launch. Follow the prompts:
- Configuration: Enter your Site Name, Admin Email, and Super User credentials.
- Database: Use the credentials you created in Step 4 (
joomladb,joomlauser, and your chosenstrong_password). Ensure the database type is set correctly (e.g., MySQLi). - Finalization: Review the pre-installation checks, install, and then remember to delete the installation folder when prompted for security!
Conclusion: You’re Ready to Build!
Congratulations! You have successfully installed Joomla 3 on your CentOS 7 server. You now have a robust, professionally configured foundation ready for building whatever website or application you can imagine.
Ready to start designing? Log into your new Joomla administrator panel and begin exploring the power of this fantastic CMS!
If this tutorial helped you get your server up and running, please hit the Like button and Subscribe to Darren’s Tech Tutorials for more clear, practical technology guides every week. Happy coding!
P.S. You can find all the essential commands used in this tutorial on my website here: https://darrenoneill.eu/?p=382