// Tutorial //

How To Install Joomla on a Virtual Server Running Ubuntu 12.04

Published on September 26, 2012
Default avatar
By Etel Sverdlov
Developer and author at DigitalOcean.
How To Install Joomla on a Virtual Server Running Ubuntu 12.04

Status: Deprecated

This article covers a version of Ubuntu that is no longer supported. If you are currently operate a server running Ubuntu 12.04, we highly recommend upgrading or migrating to a supported version of Ubuntu:

Reason: Ubuntu 12.04 reached end of life (EOL) on April 28, 2017 and no longer receives security patches or updates. This guide is no longer maintained.

See Instead:
This guide might still be useful as a reference, but may not work on other Ubuntu releases. If available, we strongly recommend using a guide written for the version of Ubuntu you are using. You can use the search functionality at the top of the page to find a more recent version.

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 Ubuntu 12.04.

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 the 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

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/configuration.php
sudo chmod 777 /var/www/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 apache2 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/installation/
sudo chmod 755 /var/www/configuration.php

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

By Etel Sverdlov

If you’ve enjoyed this tutorial and our broader community, consider checking out our DigitalOcean products which can also help you achieve your development goals.

Learn more here

About the authors
Default avatar
Developer and author at DigitalOcean.

Still looking for an answer?

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!

on LAMP on Ubuntu 14.04 to be able to login with juser I had to set password with this syntax SET PASSWORD FOR ‘juser’@‘localhost’ = PASSWORD(‘password’);

@eyes.com: What version of Ubuntu are you running? You might need to replace /var/www/index.html with /var/www/html/index.html on newer versions of Ubuntu.

Hello, I installed Joomla backup using Akeeba, Its restore it but I am only able to access Joomla backend admin page, but on frontend I am not see my site, It shows URL not found, What will be the cause ?

I fixed it by below comands :

  • chown -R www-data:www-data /var/www/html but i’m not sure that’s good solution ?

I have issue after install joomla 3.4.5, it’s I can’t install any extensions . When I check system information in admin then I notice that all folder is unwritable

You can see here : http://screencast.com/t/GMeDl9BCqx , how can I fix that ?

For now permission of all folder is 755, of all file is 664 but it still can’t install any extensions

Hey , I got an error when try setting password for user , here is error I get

“1064 (42000) : You have an error in your sql syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘SET PASSWORD FOR myuser = PASSWORD(“mypasword”)’ at line 2”

How can I fix that ?

This comment has been deleted

@damola49 try running “rm /var/www/index.html” - does that fix it? I have the same problem ,and when running this command I got:

rm: cannot remove ‘/var/www/index.html’: No such file or directory

Actually, I just tried chown www-data for everything, for now. What should I make owned by root, for security purposes? Everything works as is, but I am very aware how insecure this is

I was having trouble installing plugins, did what was suggested in the comments, and was able to successfully install the “Install from Web” plugin, but then nothing else. I am baffled beyond belief. www-data is the owner of my temp and my plugins, and root is the owner of everything else. Permissions are set to 755 for the entire folder, except configuration.php (444). The site is not publicly known yet, so I am safe, however, there is the strong possibility that my Joomla will be used by hundreds in the coming months.