Skip to content

Deployment Overview of WordPress + WooCommerce plugin on Server

Prerequisites and Basic Requirements

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

  • Operating System: Debian-based Linux distribution.

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

  • Ports:

  • 80 (HTTP)

  • 443 (HTTPS)

  • Dependencies: The system must have internet access to download APT packages, the WooCommerce plugin, and Docker images.

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain generated based on your server ID.

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

File and Directory Structure

The application uses the following directory structure for configuration, data, and system files:

  • /data/wordpress: Main WordPress content directory (includes wp-content/plugins/).

  • /root/wordpress: Contains the Docker Compose deployment files.

  • /data/nginx/user_conf.d/: Stores Nginx configuration files.

  • /data/nginx/nginx-certbot.env: Environment file for the Nginx container.

Application installation process

The installation follows a multi-step process to prepare the environment and deploy the application via Docker:

  1. System Preparation: The system updates the APT package cache and installs essential utilities including lsb-release, apt-transport-https, vim, htop, and zip.

  2. Plugin Setup:

  3. The WooCommerce plugin (version 8.7.0) is downloaded from WordPress.org.

  4. The plugin is unzipped in a temporary directory.

  5. The extracted woocommerce folder is moved to /data/wordpress/wp-content/plugins/.

  6. Docker Deployment:

  7. Docker and the necessary proxy configurations are installed.

  8. A configuration file for Nginx is generated in /data/nginx/user_conf.d/.

  9. The deployment directory /root/wordpress is created.

  10. A compose.yml file is generated to orchestrate the application services.

  11. The containers are started using Docker Compose.

Access Rights and Security

  • File Permissions:

  • WordPress data in /data/wordpress is owned by user 33 (standard for web services) with mode 0755.

  • Configuration files in /root/wordpress are owned by root with mode 0640.

  • Network Security: The Nginx container uses host networking to manage SSL certificates and traffic.

Databases

The application utilizes a MariaDB database managed within a Docker container.

Parameter Value
Database Name wordpress
Database User wordpress
Storage Location Managed via Docker volume mariadb_data

Docker Containers and Their Deployment

The application is deployed using the following containers:

  • mariadb

  • Image: bitnami/mariadb:latest

  • Restart Policy: unless-stopped

  • Volumes: mariadb_data:/bitnami/mariadb

  • Environment Variables:

  • MARIADB_USER=wordpress

  • MARIADB_DATABASE=wordpress

  • MARIADB_PASSWORD (set during installation)

  • MARIADB_ROOT_PASSWORD (set during installation)

  • wordpress

  • Image: docker.io/wordpress:php8.3-fpm

  • Restart Policy: unless-stopped

  • Ports: 127.0.0.1:9000:9000

  • Volumes: /data/wordpress:/var/www/html

  • Environment Variables:

  • MYSQL_ROOT_PASSWORD (set during installation)

  • WORDPRESS_DB_PASSWORD (set during installation)

  • WORDPRESS_DB_HOST=mariadb

  • WORDPRESS_DB_USER=wordpress

  • WORDPRESS_DB_NAME=wordpress

  • nginx

  • Image: jonasal/nginx-certbot:latest

  • Restart Policy: unless-stopped

  • Network Mode: host

  • Environment Variables:

  • [email protected]

  • Volumes:

  • nginx_secrets:/etc/letsencrypt

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

  • /data/wordpress:/var/www/html

Application Update Instructions

To update the main application, navigate to the deployment directory and pull the latest images:

cd /root/wordpress
docker compose pull && docker compose up -d

Location of configuration files and data

  • WordPress Files: /data/wordpress

  • Database Data: Docker volume mariadb_data

  • Nginx Configurations: /data/nginx/user_conf.d/wp{Server_ID_from_Invapi}.hostkey.in.conf

  • SSL Certificates: Managed via the nginx_secrets volume.

Available ports for connection

  • HTTPS: 443 (via Nginx proxy)

Starting and Stopping the application

The application is managed using Docker Compose from the /root/wordpress directory:

  • Start the application:

    docker compose up -d
    

  • Stop the application:

    docker compose down
    

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