Install and configure Joomla on your LAMP server - Ubuntu
Time: 10 minutes
Joomla is an open source content management system (CMS) that helps you build websites and online applications. Joomla is a flexible platform boasting more than 10,000 addons, used for sites of all types - ranging from simple blogs to large-scale business sites. Currently the 2nd most popular CMS in the industry, Joomla sits on top of a robust PHP codebase that is used with a backend database such as MySQL.
To use this article, you need to have a LAMP stack installed on your server.
We also recommend setting up an Apache virtual host for the domain name you want to use, which includes pointing your domain name to it.
Before you can install Joomla, there are a few things you need to do to prep your server.
Install Git and PHP extensions
- Update your server's software:
sudo apt-get update
- Install Git:
sudo apt-get install git php5-mysql
- Make sure Apache and MySQL are running:
sudo service apache2 startsudo service mysql start
Download Joomla to your web root
- Navigate to your virtual host directory for the domain name:
cd your domain's Apache virtual host directory
Note: If you didn't set up a virtual host directory, you can use
- Download Joomla:
sudo git clone -b master https://github.com/joomla/joomla-cms.gitThis command will automatically download to the
mvto move these files to your web root:sudo mv joomla-cms/* /your domain's Apache virtual host directory
- Change directory permissions of your Apache web root so that it can properly run the install:
sudo chown -R www-data:www-data your domain's Apache virtual host directory
Set up the MySQL database
Next, we will set up the MySQL database, username, and password that you will use with your Joomla application. Make sure you note them because Joomla requires you to enter the credentials to complete the installation.
- Login to MySQL:
sudo mysql -u root -p
- When prompted, enter the MySQL root password that you set during the MySQL installation.
- Create a new MySQL database:
CREATE DATABASE your joomla database;
- Create a new MySQL user:
CREATE USER your joomla user@localhost;
- Set the password for this user:
SET PASSWORD FOR your joomla user@localhost= PASSWORD(your joomla password);
- Grant all privileges to this new user:
GRANT ALL PRIVILEGES ON your joomla database.* TO your joomla user@localhost IDENTIFIED BY 'your joomla password';
- Confirm that the changes to this user are properly applied:
your joomla user@localhost;If the changes worked, you should see output that looks something like this:GRANT USAGE ON *.* TO 'joomlauser'@'localhost' IDENTIFIED BY PASSWORD '*36F5DACB9CB45B4C150F4DCDCAF9A50D5A1C2D07'If the changes did not apply properly, refresh the MySQL cache and try again:
GRANT ALL PRIVILEGES ON `joomla`.* TO 'joomlauser'@'localhost'FLUSH PRIVILEGES;
- Once you confirm that the changes worked, exit MySQL:
Configure Apache and PHP
Now that we have the database set up, the last thing we need to do before installing Joomla is tweak the Apache and PHP configuration to optimize it for Joomla.
- Open your
php.inifile:sudo vim /etc/php5/apache2/php.ini
- Uncomment the following line by removing the
;from the beginning of the line:cgi.fix_pathinfo=1
- Change the
Off:output_buffering = OffJoomla recommends disabling PHP output buffering for better performance.
- Save and close the file::wq!
- Restart Apache:sudo service apache2 restart
You are now ready to use your browser to install Joomla.
- In your browser, navigate to http://your domain name or IP address. You will see the Joomla installation page.
- Enter the Main Configuration information for your website. This will include the administrator login credentials you want to use for running Joomla. Once all this information has been entered, click Next.
- Enter the Database configuration details. These are the MySQL credentials you created earlier in the guide. For the Database Type, use MySQLi. Once all information has been entered, click Next.
- Choose a Sample Data option. If you are an experienced developer, you may simply wish to use the bare framework. If you are learning to use the Joomla platform, you will probably want to use either the Learn Joomla English or Default English options.
- Once you have selected and confirmed all other final options, click Install
- Joomla will finish installing; it usually only takes a matter of seconds.
- Once this is finished, click Remove Installation Folder. This must be done before you will be able to use Joomla.
Joomla is now finished installing! You can log in to your administrator page by navigating to http://your domain name or IP address/administrator, and using the admin credentials you created during the install.
Now that you have finished setting up your Joomla application, you should take a look at some of the starter guides at Joomla.org. Joomla boasts and extensive community site and knowledge base to help you find the answers you need for both site development and ongoing administration.
- Change the