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 (includeswp-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:
-
System Preparation: The system updates the APT package cache and installs essential utilities including
lsb-release,apt-transport-https,vim,htop, andzip. -
Plugin Setup:
-
The WooCommerce plugin (version 8.7.0) is downloaded from WordPress.org.
-
The plugin is unzipped in a temporary directory.
-
The extracted
woocommercefolder is moved to/data/wordpress/wp-content/plugins/. -
Docker Deployment:
-
Docker and the necessary proxy configurations are installed.
-
A configuration file for Nginx is generated in
/data/nginx/user_conf.d/. -
The deployment directory
/root/wordpressis created. -
A
compose.ymlfile is generated to orchestrate the application services. -
The containers are started using Docker Compose.
Access Rights and Security¶
-
File Permissions:
-
WordPress data in
/data/wordpressis owned by user33(standard for web services) with mode0755. -
Configuration files in
/root/wordpressare owned byrootwith mode0640. -
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:
-
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:
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_secretsvolume.
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:
-
Stop the application: