Via Docker Compose

This guide assumes you already have Docker installed.

This Docker compose creates two services:

  1. Webserver (Apache/PHP) - The UXWizz Webserver image

  2. Database (MySQL) - MariaDB Image

Running UXWizz via docker compose

Copy this compose.yml file locally in a folder named uxwizz and run docker compose up -d

compose.yml
services:
  webserver:
    image: uxwizz/uxwizz-webserver:latest
    container_name: "uxwizz-webserver"
    restart: always
    ports:
      - "8000:80"
      - "4430:443"
    volumes:
      - html:/var/www/html
      - php-config:/usr/local/etc/php/php.ini
      - apache_sites_enabled:/etc/apache2/sites-enabled
      - apache_logs:/var/log/apache2
    environment:
      UXWIZZ_DB_HOST: db
      MYSQL_DATABASE: uxwizz
      MYSQL_ROOT_PASSWORD: temp-root-password-jasdlkz1
    depends_on:
      db:
        condition: service_healthy
  db:
    image: mariadb:11.7.2
    container_name: "uxwizz-db"
    ports:
      - "3306:3306"
    command: --max-allowed-packet=64MB --bind-address=0.0.0.0
    environment:
      MYSQL_ROOT_PASSWORD: temp-root-password-jasdlkz1
      MYSQL_DATABASE: uxwizz
      MARIADB_AUTO_UPGRADE: 1
      MARIADB_INITDB_SKIP_TZINFO: 1
    volumes:
      - mysql_data:/var/lib/mysql
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      start_period: 10s
      interval: 10s
      timeout: 5s
      retries: 3
    restart: always
volumes:
  mysql_data:
  html:
  apache_logs:
  apache_sites_enabled:
  php-config:

To stop the services, you can run docker compose down.

To also delete all UXWizz data/db/volumes, you can run docker compose down -v.

Accessing UXWizz

As shown in the compose file, the ports exported are 8000 (HTTP) and 4430 (HTTPS). You should now be able to access your dashboard at http://localhost:8000

Tip: Using Bind Volumes

If you want to use local folders as bind volumes, instead of named volumes.

You must first populate the html folder from the webserver image, by running this command:

mkdir -p ./html; docker run --rm --entrypoint="" uxwizz/uxwizz-webserver \
tar cf - -C /var/www/html . | tar xf - -C ./html

Then, in compose.yml prepend ./ to all volumes, like this:

services:
...
  webserver:
  ...
    volumes:
      - ./html:/var/www/html
      - ./php.ini:/usr/local/etc/php/php.ini:ro
      - ./sites-enabled:/etc/apache2/sites-enabled
      - ./apache_logs:/var/log/apache2
  db:
  ...
    volumes:
      - ./mysql_data:/var/lib/mysql

Last updated

Was this helpful?