Skip to main content

Installation

The service can be installed through the Portainer web interface. 

Learn about creating a new stack.

Docker Compose

Use the following code to install the service:

---
services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - /srv/wordpress/db:/var/lib/mysql
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=
      - MYSQL_DATABASE=wordpress
      - MYSQL_USER=${DB_USER}
      - MYSQL_PASSWORD=${DB_PASSWORD}
    expose:
      - 3306

  wordpress:
    image: wordpress:latest
    ports:
      - 8080:80
    restart: always
    depends_on:
      - db
    volumes:
     - /srv/wordpress/html:/var/www/html
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=${DB_USER}
      - WORDPRESS_DB_PASSWORD=${DB_PASSWORD}
      - WORDPRESS_DB_NAME=wordpress

 

Environment

Use the following environment to configure the service using the values prepared earlier:

# Database Configuration
DB_USER=wordpress_admin

# Passwords
# After the initial setup, the passwords should be saved elsewhere and stack should be re-deployed with these settings deleted.

# Database Passwords
DB_PASSWORD=