This tutorial is about installing the Content Management System (CMS) Joomla! and the Database system MySQL on Ubuntu. Joomla! is one of the most popular CMS nowadays. It provides an easy way to set up web pages and to publish content in the internet. Joomla! is a typical CMS while other software like WordPress is more focused on providing blogs.
MySQL is the database system and keeps the information stored which is displayed by Joomla!. Another component which is used in out setup is the Apache2 web server. The web server handles the http requests from internet browsers and basically sends the Joomla! content to the visitors computer.
An other compounded which needs to be installed is PHP. Joomla is mainly written in PHP and therefor a bunch of Linux packages related to PHP need to be installed as well.
1. Install Software
As a first step we need to install some Ubuntu packages like MySQL, Apache2 and PHP . They are all in the standard repositories and the installation should not cause problems. Execute this commands in a Terminal or Shell:
sudo apt-get --yes install mysql-server apache2 sudo apt-get --yes install libapache2-mod-php php-mbstring sudo apt-get --yes php-xml php-intl php-mysql sudo a2enmod php7.4
2. Create the MySQL Database
Since MySQL is installed already we can just enter the MySQL Command Line Interface (CLI) with the following command:
sudo mysql -u root -p
Now we are in the MySQL CLI and we need to create the database for Joomla!
mysql> CREATE DATABASE joomla;
As the next step, we need to create a user, grant the necessary permissions to the user and at the same time we are setting a password:
mysql> GRANT ALL PRIVILEGES ON joomla.* TO joomla@localhost IDENTIFIED BY 'secpasswd';
…and quit then:
mysql> FLUSH PRIVILEGES; mysql> quit
3. Download Joomla! to the right Directory
Now we need to download and extract Joomla! in a terminal/shell with these commands:
sudo mkdir /var/www/html/joomla cd /var/www/html/joomla sudo wget https://downloads.joomla.org/cms/joomla4/4-2-4/Joomla_4-2-4-Stable-Full_Package.zip sudo unzip Joomla_4-2-4-Stable-Full_Package.zip
The “unzip” command extracts the compressed ZIP file. Notice that the version 4.2.4 is the newest as I am writing this blog post. In a few weeks a new version will be released.
5. Modifications in the File System
To not run into an error during the next steps, the ownership for the Joomla! directory has to be set. On my Ubuntu system the “www-data” user and the “www-data” group have to be the owner of the directory structure. Run the following command:
chown -R www-data:www-data /var/www/html/joomla
6. Install and Configure Joomla!
Next, open an internet browser and connect to “http://localhost/joomla”. So far so good!.
The rest is a quite simple process:
Enter a site name and click on “Setup Login Data”. Then set a Super User name and a password. Provide an email address. Click on “Setup Database Connection”. On the page “Database Configuration” the data from the step above is needed:
The host should stay “localhost”.
Then click on “Install Joomla” and wait a few moments.
Then you see “Open Site” and “Open Administrator”.
The most critical step is probably the 5. step “Modifications in the File System”. It took me a few minutes to resolve some permission and server errors. If you follow my instructions it will work.
But now you can log in with the user “user” and the “secpasswd” which you set during the installation procedure.
Other web apps like WordPress and MediaWiki are installed in the same way. You find my MediaWiki blog post here.
Feel free to comment this blog post!