2

I want to install Joomla on Ubuntu with Apache webserver. How I can do this? What's the correct process?

I installed latest Ubuntu 24.04 after this I watch some video how to install apache2 and it works. But now, I don't know, how to install php and mysql perfectly. After this I want install Joomla but every tutorial is so different and sometimes just don't work.

Can someone tell me how to do this?

sotirov
  • 4,379

1 Answers1

2

Install Apache

sudo apt install apache2

Install and configure MySQL

  1. Install MySQL

    sudo apt install mysql-server
    sudo mysql_secure_installation
    sudo service mysql restart
    
  2. Connect to the server

    sudo mysql -u root
    
  3. Once you're logged in, you can create a new database, a new user and grant privileges. Replace your_database, your_user and your_password with what you want to use.

    CREATE DATABASE your_database;
    CREATE USER 'your_user'@'localhost' IDENTIFIED BY 'your_password';
    GRANT ALL PRIVILEGES ON your_database.* TO 'your_user'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;
    

Install PHP and required modules

Ubuntu 24.04 php package installs php8.3, which is the recommended version by Joomla requirements for Joomla 5.x:

sudo apt install php

Acouring to the Joomla requirements, for Joomla 5.x you need to install these PHP modules - json, simplexml, dom, zlib, gd, mysqlnd or pdo_mysql or pdo_pgsql:

sudo apt install php-json php-xml php-zip php-gd php-mysql
sudo service apache2 restart

Install Joomla

At the time of writing this, the latest version of Joomla is 5.1 and all my examples are for it.

  1. By default your Apache webserver public directory is /var/www/html, so go there and remove the default index.html:

    cd /var/www/html
    sudo rm index.html
    
  2. Download Joomla from https://downloads.joomla.org/:

    cd /var/www/html
    sudo wget https://downloads.joomla.org/cms/joomla5/5-1-0/Joomla_5-1-0-Stable-Full_Package.zip
    
  3. Extract the files. You may need to install unzip.

    sudo apt install unzip
    

    cd /var/www/html sudo unzip Joomla_5-1-0-Stable-Full_Package.zip

    sudo rm Joomla_5-1-0-Stable-Full_Package.zip

  4. Change the ownership of /var/www/html.

    sudo chown -R www-data:www-data /var/www/html
    
  5. Finish the installation by opening the Joomla Installer. It should be accessible by opening http://your_server_ip_address/. For example http://192.168.0.244/ if your server IP address is 192.168.0.244.

sotirov
  • 4,379