How To Install Joomla on a Virtual Server Running CentOS 6

Published on September 27, 2012
How To Install Joomla on a Virtual Server Running CentOS 6

Status: Deprecated

This article covers a version of CentOS that is no longer supported. If you are currently operating a server running CentOS 6, we highly recommend upgrading or migrating to a supported version of CentOS.

Reason: CentOS 6 reached end of life (EOL) on November 30th, 2020 and no longer receives security patches or updates. For this reason, this guide is no longer maintained.

See Instead:
This guide might still be useful as a reference, but may not work on other CentOS releases. If available, we strongly recommend using a guide written for the version of CentOS you are using.

About Joomla

Joomla is a free and open source content management that uses a PHP and a backend database, such as MySQL. It offers a wide variety of features that make it an incredibly flexible content management system right out of the box. It was created in 2005 and is currently the 2nd most popular content management site online. It now has over 10,000 addons to customize its functionality.


The steps in this tutorial require the user to have root privileges on their virtual private server. You can see how to set that up in steps 3 and 4 of the Initial Server Setup

Before working with Joomla, you need to have LAMP installed on your virtual server. If you don't have the Linux, Apache, MySQL, PHP stack on your VPS, you can find the tutorial for setting it up here: How to Install LAMP on CentOS 6.

Once you have the user and required software, you can start installing Joomla!

Step One—Download Joomla

To start, create a directory where you will keep your Joomla files temporarily:

mkdir temp

Switch into that directory:

cd temp

Then you can go ahead and download the most recent version of Joomla straight from their website. Currently, the latest version is 2.5.7.

wget http://joomlacode.org/gf/download/frsrelease/17410/76021/Joomla_2.5.7-Stable-Full_Package.tar.gz

This command will download the zipped Joomla package straight to your user's home directory on the virtual server. You can untar it with the following command, moving it straight into the default apache directory, /var/www :

sudo tar zxvf Joomla_2.5.7-Stable-Full_Package.tar.gz  -C /var/www/html

Step Two—Configure the Settings

Once the Joomla files are in the web directory, we alter a couple of permissions to give access to the Joomla installer.

First create a Joomla configuration file and make it temporarily world-writeable:

sudo touch /var/www/html/configuration.php
sudo chmod 777 /var/www/html/configuration.php

After the installation is complete, we will change the permissions back down to 755, which will make it only writeable by the owner.

Step Three—Create the Joomla Database and User

Now we need to switch gears for a moment and create a new MySQL directory for Joomla.

Go ahead and log into the MySQL Shell:

mysql -u root -p

Login using your MySQL root password. We then need to create the Joomla database, a user in that database, and give that user a new password. Keep in mind that all MySQL commands must end with semi-colon.

First, let's make the database (I'm calling mine Joomla for simplicity's sake—for a real server, however, this name is not very secure). Feel free to give it whatever name you choose:

Query OK, 1 row affected (0.00 sec)

Then we need to create the new user. You can replace the database, name, and password, with whatever you prefer:

CREATE USER juser@localhost;
Query OK, 0 rows affected (0.00 sec)

Set the password for your new user:

SET PASSWORD FOR juser@localhost= PASSWORD("password");
Query OK, 0 rows affected (0.00 sec)

Finish up by granting all privileges to the new user. Without this command, the Joomla installer will be able to harness the new mysql user to create the required tables:

GRANT ALL PRIVILEGES ON joomla.* TO juser@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

Then refresh MySQL:

Query OK, 0 rows affected (0.00 sec)

Exit out of the MySQL shell:


Restart apache:

sudo service httpd restart

Step Four—Access the Joomla Installer

Once you have placed the Joomla files in the correct location on your VPS, assigned the proper permissions, and set up the MySQL database and username, you can complete the remaining steps in your browser.

Access the Joomla installer going to your domain name or IP address. (eg. Example.com)

Once you have finished going through the installer, delete the installation folder per Joomla’s instructions and change the permissions on the config file:

sudo rm -rf /var/www/html/installation/
sudo chmod 755 /var/www/html/configuration.php

Visit your domain or IP address to see your new Joomla page.

By Etel Sverdlov

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the authors

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

thank you www.digitalocean.com you help me about joomla installation.

Hi, when i am installing jooloma on centos 6.4 than this error occur. plz help me

sudo tar zxvf Joomla_2.5.7-Stable-Full_Package.tar.gz -C /var/www

tar: /var/www: Cannot chdir: No such file or directory tar: Error is not recoverable: exiting now

When I access the website from its domain name, I get this error: “No configuration file found and no installation code available. Exiting…”

What is wrong?

I’ve followed the instruction and Joomla installed correctly on CentOs 6, but I cant change global configuration!

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
May 5, 2014

@Asterix: Joomla’s root directory needs to be writable by www-data in order to upgrade. If you change the file permissions to 666, change them back after the upgrade is done as that allows all users to write to the files. The suggested permissions are 755 for directories and 644 for files.

My Joomla installation works fine but when I try to use Joomla Update I get file permission errors.

When I tried to update Joomla from 3.2.3 to3.2.4 with Joomla Update and Installation method “Write files directly” I get ERROR: Could not open /home/myuser/public_html/joomla root directory/LICENSE.txt for writing. When I do sudo chgrp -R www-data /home/myuser/public_html/joomla root directory/LICENSE.txt and change permissions to 666 on LICENSE.txt it obviously works for that file. But to make the whole update work I guess I need to run sudo chgrp -R www-data /home/myuser/public_html/joomla root directory/ and maybe change file permissions on all files?

Is that the correct way?

I don’t have any FTP server (and I don’t want to have) so I can only use the direct method.

I use nginx php-fpm Ubuntu 12.04 LEMP

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
April 28, 2014

@brandytanner84: Does the file “/var/www/html/configuration.php” exist?

I followed step by step in this tutorial, in the final step when I enter http://my-ip or http://my-domain and get : No configuration file found and no installation code available. Exiting…

Even I tried with the lastest joomla verson ! somebody can help me? thanks

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
October 5, 2013

I am using nginx.

So, let me know the necessary changes to be made in the above steps for installing joomla in nginx.

Thanks in advance.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel