Installation of SuiteCRM v8.8.1 in Docker Desktop

Hihi, a newbie to SuiteCRM, trying to deploy a fully customizable SuiteCRM in Docker Desktop.

Below is some information of my docker’s implementation:

Dockerfile:

FROM php:8.2-apache

# Apache: point DocumentRoot at /public and enable rewrites (required)
RUN a2enmod rewrite headers && \
    sed -ri 's#DocumentRoot /var/www/html#DocumentRoot /var/www/html/public#g' /etc/apache2/sites-available/000-default.conf && \
    sed -ri 's#<Directory /var/www/>#<Directory /var/www/html/public/>#g' /etc/apache2/apache2.conf && \
    sed -ri 's#AllowOverride None#AllowOverride All#g' /etc/apache2/apache2.conf && \
    echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf && a2enconf servername

# PHP extensions used by SuiteCRM
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
    install-php-extensions ldap mysqli pdo_mysql intl gd zip mbstring xml soap imap opcache

# Useful PHP limits
RUN printf "upload_max_filesize=32M\npost_max_size=32M\nmemory_limit=512M\n" > /usr/local/etc/php/conf.d/uploads.ini

# Composer (for dev package)
RUN php -r "copy('https://getcomposer.org/installer','composer-setup.php');" \
 && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
 && rm composer-setup.php

# Node + Yarn (front-end build)
RUN apt-get update && apt-get install -y curl ca-certificates gnupg && \
    curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
    apt-get install -y nodejs && \
    corepack enable && corepack prepare yarn@stable --activate

WORKDIR /var/www/html
# We bind-mount the source; no COPY here.

**docker-compose.yml**:
version: "3.8"

services:
  db:
    image: mariadb:10.6
    container_name: anraduscrm_db
    restart: unless-stopped
    environment:
      MARIADB_ROOT_PASSWORD: "XXXXXXXXX"
      MARIADB_DATABASE: "AnradusCrm"
      MARIADB_USER: "XXXXX"
      MARIADB_PASSWORD: "XXXXXXXXX"
    command: ["mysqld","--character-set-server=utf8mb4","--collation-server=utf8mb4_unicode_ci"]
    volumes:
      - "D:/AnradusCRM-8.8.1/db:/var/lib/mysql"

  app:
    build:
      context: "D:/AnradusCRM-8.8.1"
      dockerfile: "Dockerfile"
    container_name: anraduscrm_app
    restart: unless-stopped
    depends_on: [db]
    ports:
      - "8080:80"   # http://localhost:8080
    volumes:
      # Editable source
      - "D:/AnradusCRM-8.8.1/code:/var/www/html"
      # Keep composer/yarn outputs inside Linux (faster, avoids NTFS perf issues)
      - anradus_vendor:/var/www/html/vendor
      - anradus_node_modules:/var/www/html/node_modules
      # Persist runtime data
      - "D:/AnradusCRM-8.8.1/appdata/upload:/var/www/html/public/legacy/upload"
      - "D:/AnradusCRM-8.8.1/appdata/custom:/var/www/html/public/legacy/custom"
      - "D:/AnradusCRM-8.8.1/appdata/var_cache:/var/www/html/var/cache"
      - "D:/AnradusCRM-8.8.1/appdata/var_log:/var/www/html/var/log"
      # Persist config files
      # - "D:/AnradusCRM-8.8.1/appdata/config/config.php:/var/www/html/public/legacy/config.php"
      # - "D:/AnradusCRM-8.8.1/appdata/config/config_override.php:/var/www/html/public/legacy/config_override.php"
      # For these 2 lines above, commented as it is already persist in external mount
volumes:
  anradus_vendor:
  anradus_node_modules:

After building up the container and installing the necessary backend/frontend dependencies, I face issue in the SuiteCRM Installation part using CLI, below are screenshot of the output after executing the install command in terminal, install.log:

Terminal output:

/code/logs/install.log:

I have been trying to use AI to solve the installation issue and still not successful. Not sure how to proceed further, hopefully to get some advices here. Thanks!

I think you’re missing quite a few PHP extensions, here’s a quick copy-paste from what I usually install in Ubuntu:

sudo apt install php8.2-common php8.2-mysql php8.2-xml php8.2-xmlrpc php8.2-curl php8.2-gd php8.2-imagick php8.2-cli php8.2-dev php8.2-imap php8.2-mbstring php8.2-opcache php8.2-soap php8.2-zip php8.2-intl php8.2-ldap -y

I also install xdebug in dev environments.

Hi pgr, thanks for your response :grinning:

For these PHP extensions, should I update it to my Dockerfile under this section and re-create the instance to try?

Yes (I guess).

The extension names may vary according to your PHP version and flavor of Linux. If you don’t have a particular reason to use something else, I recommend the latest Ubuntu, or at least something debian-based.

1 Like

Hello Carls,

I’ve been using:

FROM php:8.3-apache

Other than that - it’s mostly about setting up your environment to match the installation manual, you’re on the right track there.

Afterwards:

docker compose build --no-cache
docker compose up --force-recreate
1 Like

Hi Bastian,

Thanks for your reply.

Instead of deployment the system from the Github package ( SuiteCRM‑8.8.1‑dev.zip), I have switched to use SuiteCRM v8.8.1 docker image to perform the deployment.

The installation setup is magically settled by the docker image and the system is up at last.

Now I am stuck in doing some customization like adding custom button, I will post my question in the Development Help’s thread.

Thanks!