Install an open source CMS with Joomla!

Today we will install joomla! Joomla is an open source content management system (CMS) for creating and managing websites. It allows users to edit website content and adjust the design without requiring programming skills.

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

It is installed on an OracleCloud instance using Docker. It could be installed on the old Wappy’s WADAX. So you can also install it with Plesk. This one was easy to install, just download the file, unzip it and configure the database. This article will explain how to install using docker, which is relatively easy since there is an official Joomla image.
First, start it up with a simple command. To examine the inside of the container.

docker run --name test -d joomla

However, it does not start, so check the logs.

docker logs test

error: missing JOOMLA_DB_HOST and MYSQL_PORT_3306_TCP environment variables
Did you forget to –link some_mysql_container:mysql or set an external db
with -e JOOMLA_DB_HOST=hostname:port?

It appears that you need the database information to get up and running. Remove the container.

docker rm test

Add the database information and enter the command

docker run \
 --name test \
 -e JOOMLA_DB_HOST=10.0.0.107:3306 \
 -e JOOMLA_DB_NAME=joomla \
 -e JOOMLA_DB_USER=mamushi \
 -e JOOMLA_DB_PASSWORD=testpass \
 -d joomla

At this time, if the database information is incorrect, the container will stop midway. It seems that it is trying to connect to the database. Now that the container is up and running, we can investigate inside the container.

docker exec -ti test bash

The location of the files and directories were as follows. Also remember that www-data is the owner of the document root.

/etc/apache2 -> web server configuration file
/usr/local/etc/php -> PHP related
/var/www/html -> document root

Copy these files from the container to the host. This is so that you can edit the files without entering the container.

docker cp test:/usr/local/etc/php /root/joo-php/
docker cp test:/etc/apache2 /root/joo-apache2/
docker cp test:/var/www/html /root/joomla/

Fix the document root ownership change to root by copying the files.

chown -R www-data:www-data /root/joomla

Now that the necessary files are on the host, stop the container and delete them.

docker stop test
docker rm test

Now Joomla is ready for operation. Enter the command with additional options to mount it.

docker run \
 --name jcms \
 -p 8881:80 \
 -v /root/joo-php:/usr/local/etc/php \
 -v /root/joo-apache2:/etc/apache2 \
 -v /root/joomla:/var/www/html \
 -e JOOMLA_DB_HOST=10.0.0.107:3306 \
 -e JOOMLA_DB_NAME=joomla \
 -e JOOMLA_DB_USER=mamushi \
 -e JOOMLA_DB_PASSWORD=testpass \
 -d joomla

Allow traffic on the host port.

ufw allow 8881/tcp

Access with a browser.

http://IP address:8881/

Japanese language files can also be downloaded and installed from the administration panel.

Please share if you like it!
TOC