Skip to content

Deployment Overview of Joomla on Server

Prerequisites and Basic Requirements

  • Operating System: Ubuntu (implied by installation tasks)

  • Privileges: Root or sudo access is required to manage Docker and system services.

  • Domain Configuration: The application is configured to use the hostkey.in zone with a specific prefix.

  • Networking: Docker Engine must be installed and running.

  • Ports:

    • Port 8080: Internal Joomla service port.

    • Port 443: External HTTPS access.

    • Port 3306: Internal MySQL service port (bound to the host).

FQDN of the Final Panel

The application is accessible via the following Fully Qualified Domain Name (FQDN) format, where SERVER_ID is replaced by the unique server identifier:

joomla.hostkey.in:443

File and Directory Structure

The deployment utilizes specific directories for configuration, data storage, and proxy management:

  • Nginx Configuration Directory: /root/nginx

    • Contains the Docker Compose file for the proxy stack.
  • Nginx User Configuration: /data/nginx/user_conf.d

    • Stores specific site configuration files, such as joomla<SERVER_ID>.hostkey.in.conf.
  • Nginx Secrets: Mounted from the external volume nginx_secrets located at /etc/letsencrypt within the container.

  • Data Volumes:

    • MySQL data is stored in the named Docker volume mysql_data mapping to /var/lib/mysql inside the container.

    • Joomla data is stored in the named Docker volume joomla_data mapping to /var/www/html inside the container.

Application Installation Process

The application is deployed using Docker containers. The following images and versions are used:

  • Joomla Image: joomla:latest

  • MySQL Image: mysql:8.0

The deployment involves running two primary containers:

  1. MySQL Container:

    • Name: joomla_db

    • Database: joomla

    • User: joomla_user

    • The container is configured with a restart_policy of always.

  2. Joomla Container:

    • Name: joomla

    • Linked to the MySQL container as mysql.

    • The container is configured with a restart_policy of always.

    • Port mapping exposes internal port 80 to host port 8080.

Docker Containers and Their Deployment

The application stack consists of three Docker services managed via specific configurations.

Database Container:

  • Name: joomla_db

  • Image: mysql:8.0

  • Environment Variables:

    • MYSQL_ROOT_PASSWORD: Set to the SSH password of the host.

    • MYSQL_DATABASE: joomla

    • MYSQL_USER: joomla_user

    • MYSQL_PASSWORD: Set to the SSH password of the host.

  • Volumes: mysql_data mounted to /var/lib/mysql.

  • Ports: Host port 3306 mapped to container port 3306.

Application Container:

  • Name: joomla

  • Image: joomla:latest

  • Environment Variables:

    • JOOMLA_DB_HOST: joomla_db

    • JOOMLA_DB_NAME: joomla

    • JOOMLA_DB_USER: joomla_user

    • JOOMLA_DB_PASSWORD: Set to the SSH password of the host.

  • Volumes: joomla_data mounted to /var/www/html.

  • Ports: Host port 8080 mapped to container port 80.

  • Links: Connected to joomla_db with alias mysql.

Proxy Container Stack: The Nginx proxy with Certbot support is managed via a Docker Compose file located at /root/nginx/compose.yml.

Parameter Value
Service Image jonasal/nginx-certbot:latest
Restart Policy unless-stopped
Network Mode host
Email for Certbot [email protected]
Environment File /data/nginx/nginx-certbot.env
Secrets Volume nginx_secrets mapped to /etc/letsencrypt
User Config Volume /data/nginx/user_conf.d mapped to /etc/nginx/user_conf.d

Proxy Servers

Nginx is deployed as a reverse proxy with automatic SSL certificate management via Certbot.

  • Proxy Target: The proxy forwards traffic to the internal Joomla service at http://127.0.0.1:8080.

  • Configuration File: The site-specific configuration is located at /data/nginx/user_conf.d/joomla<SERVER_ID>.hostkey.in.conf.

  • Routing:

    • Incoming requests to the FQDN on port 443 are routed to the Nginx container.

    • The Nginx container proxies requests to the Joomla container on port 8080.

    • SSL termination is handled by the Nginx container using certificates stored in the nginx_secrets volume.

Databases

  • Connection Method: The Joomla container connects to the database via the internal Docker network using the service name joomla_db (referenced as mysql via container link).

  • Storage Location: Database persistence is handled by the named Docker volume mysql_data, which maps to /var/lib/mysql within the joomla_db container.

  • Connection Settings:

    • Host: joomla_db

    • Database: joomla

    • User: joomla_user

    • Password: Matches the host's SSH password.

Permission Settings

  • Nginx Directory: /root/nginx is owned by root:root with permissions 0755.

  • Compose File: /root/nginx/compose.yml is owned by root:root with permissions 0644.

  • Container Ownership:

    • The Nginx container volumes are mounted from the host root or data directories.

    • Internal file permissions within the Joomla and MySQL containers are managed by their respective default configurations.

Available Ports for Connection

Port Service Description
443 Nginx Secure HTTPS access to the Joomla application.
8080 Joomla Internal service port (not directly accessible from external networks without proxy).
3306 MySQL Internal database port (bound to the host for container communication).

Starting, Stopping, and Updating

Joomla and MySQL Containers: These containers are managed individually via Docker CLI commands on the host.

  • Start: docker start joomla and docker start joomla_db

  • Stop: docker stop joomla and docker stop joomla_db

  • Restart: docker restart joomla and docker restart joomla_db

  • Update Images: docker pull joomla:latest and docker pull mysql:8.0

Proxy Stack (Nginx/Certbot): The proxy stack is managed via Docker Compose in the /root/nginx directory.

  • Start/Update: docker compose up -d (executed in /root/nginx)

  • Stop: docker compose down (executed in /root/nginx)

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×