Skip to content

Deployment Overview of Drupal on Server

Prerequisites and Basic Requirements

To ensure a successful deployment, the following requirements must be met:

  • Operating System: Ubuntu (recommended).

  • Privileges: Root or sudo access is required for package installation and Docker management.

  • Network Ports:

  • 443/TCP: External HTTPS traffic.

  • 8080/TCP: Internal application traffic.

  • 3306/TCP: Database communication (internal network).

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain template based on the server ID.

Parameter Value
Prefix drupal
Domain hostkey.in
Full template drupal{Server_ID_from_Invapi}.hostkey.in

Application installation process

The application is deployed using a combination of system package management and Docker containers:

  1. System Preparation: The server undergoes an automated setup to install the Docker engine and necessary dependencies.

  2. Network Configuration: A dedicated Docker network named drupal-net is created to facilitate secure communication between the application and the database.

  3. Container Orchestration:

  4. The MariaDB database container is initialized with a predefined database name (drupal) and root credentials.

  5. The Drupal application container is deployed, configured to communicate with the MariaDB container via the internal network.

  6. SSL/Proxy Setup: An Nginx instance with Certbot integration is configured in /root/nginx to handle SSL termination and provide secure access via HTTPS.

Docker Containers and Their Deployment

The deployment utilizes two primary application containers running within a dedicated network.

Database Container

  • Image Name: mariadb:latest

  • Container Name: drupal_db

  • Environment Variables:

  • MYSQL_ROOT_PASSWORD: System-generated password.

  • MYSQL_DATABASE: drupal

  • MYSQL_USER: root

  • MYSQL_PASSWORD: System-generated password.

  • Restart Policy: always

  • Network: drupal-net

Application Container

  • Image Name: drupal:latest

  • Container Name: drupal

  • Ports: 8080:80 (Internal port 80 mapped to host port 8080)

  • Environment Variables:

  • DRUPAL_DB_HOST: drupal_db

  • DRUPAL_DB_NAME: drupal

  • DRUPAL_DB_USER: root

  • DRUPAL_DB_PASSWORD: System-generated password.

  • DRUPAL_DB_PORT: 3306

  • Restart Policy: always

  • Network: drupal-net

Proxy Container

  • Image Name: jonasal/nginx-certbot:latest

  • Container Name: Nginx (managed via compose)

  • Network Mode: host

  • Volumes:

  • nginx_secrets:/etc/letsencrypt

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d

  • Restart Policy: unless-stopped

Application Update Instructions

To update the Drupal application, perform the following steps to pull the latest images and restart the services:

docker compose -f /root/nginx/compose.yml pull && docker compose -f /root/nginx/compose.yml up -d

Note: It is recommended to back up your database before performing updates.

Location of configuration files and data

  • Nginx Configuration: /data/nginx/user_conf.d

  • SSL Certificates: Managed via the nginx_secrets Docker volume.

  • Docker Compose (Proxy): /root/nginx/compose.yml

Available ports for connection

Port Service Access Type
443 HTTPS (via Nginx Proxy) External
8080 Drupal Web Interface Internal/Local

Starting and Stopping the application

The containers are configured with restart policies to ensure they start automatically upon system reboot. To manually manage the services, use the following commands:

To stop the proxy service:

docker compose -f /root/nginx/compose.yml down

To start the proxy service:

docker compose -f /root/nginx/compose.yml up -d

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