Running Joomla! in Docker on Ubuntu Server

What is Joomla?

Joomla! is a free and open-source content management system (CMS) for publishing web content. Over the years Joomla! has won several awards. It is built on a model–view–controller web application framework that can be used independently of the CMS that allows you to build powerful online applications. -https://www.joomla.org/about-joomla.html

Installing Docker

  1. Log into the Linux host and run the following commands in a terminal window
    # update software respositories
    sudo apt update
    # install available software updates
    sudo apt upgrade -y
    # install prerequisites
    sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
    # add docker gpg key
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    # add docker apt repository
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    # install docker
    sudo apt install docker-ce docker-compose containerd.io -y
    # add the current user to the docker group
    sudo usermod -aG docker $USER
    # reauthenticate for the new group membership to take effect
    su - $USER

Running Joomla Container

  1. Continue with the following commands in a terminal window
    # create working directories
    mkdir ~/docker/joomla -p && mkdir ~/docker/mariadb -p
    # set owner of working directories
    sudo chown "$USER":"$USER" ~/docker -R
    # create containers network
    docker network create containers
    # run the mariadb docker container
    docker run -d --name mariadb -e MYSQL_ROOT_PASSWORD=r00tp@$$ -e MYSQL_USER=joomla_rw -e MYSQL_PASSWORD='J00mla!!' -e MYSQL_DATABASE=joomla -v ~/docker/mariadb:/var/lib/mysql --network containers mariadb:latest
    # run the joomla docker container
    docker run -d --name joomla -p 8080:80 -e JOOMLA_DB_HOST=mariadb -e JOOMLA_DB_USER=joomla_rw -e JOOMLA_DB_PASSWORD='J00mla!!' -e JOOMLA_DB_NAME=joomla -v ~/docker/joomla:/var/www/html --network containers joomla:latest
  2. Open a web browser and navigate to http://DNSorIP:8080
  3. The Joomla! setup screen should be displayed
  4. Select a Language and set the site title > Click Setup Login Data
  5. Create an admin/super user account > Click Setup Database Connection
  6. Enter the database configuration as follows:

    Database Type: MySQLi
    Host Name: mariadb
    Username: joomla_rw
    Password: J00mla!!
    Database Name: joomla
    Table Prefix: jmla_

  7. Click the Install Joomla button
  8. When the installation completes, click on the Completed & Open Site button
  9. Welcome to Joomla!

Source: https://hub.docker.com/_/joomla