Docker-based development environment for SuiteCRM 8.x with PHP 8.3, Apache, and MySQL.
- Clone this repository:
git clone <repository-url>
cd suitecrm-docker- Run the installation script:
./install.shThe script will start the containers, verify bug fixes, and guide you through the installation.
- Clone this repository:
git clone <repository-url>
cd suitecrm-docker- Start the containers:
docker compose up -dNote: The entrypoint script automatically fixes known SuiteCRM 8.4.0 bugs on startup.
- Complete the installation:
docker compose exec php bin/console suitecrm:app:install \
-U root \
-P root \
-H mysql \
-Z 3306 \
-N root \
-u admin \
-p admin \
-S localhost \
-d no \
-W true- Access SuiteCRM at http://localhost
- Username: admin
- Password: admin
SuiteCRM 8.4.0 contains multiple bugs when running on PHP 8.3:
Bug #1: Duplicate Static Variable in AOW_WorkFlow
- File:
public/legacy/modules/AOW_WorkFlow/aow_utils.php - Issue: Static variable
$sfhis declared twice (lines 438 and 644) - Error:
Fatal Compile Error: Duplicate declaration of static variable $sfh - Symptoms: Database failure error on initial load
- Fix: Remove line 644
Bug #2: Duplicate Static Variable in InlineEditing
- File:
public/legacy/include/InlineEditing/InlineEditing.php - Issue: Static variable
$sfhis declared twice (lines 146 and 294) - Error:
Fatal Compile Error: Duplicate declaration of static variable $sfh - Symptoms: "Error while fetching data" when trying to login or access GraphQL API
- Fix: Remove line 294
Bug #3: Incorrect RewriteBase in .htaccess
- File:
public/legacy/.htaccess - Issue: RewriteBase is set to
localhostlegacy/instead of/legacy/ - Error:
RewriteBase: argument is not a valid URL - Symptoms: 500 Internal Server Error when accessing legacy pages
- Fix: Correct the RewriteBase path
All three fixes are automatically applied by the entrypoint script when the container starts. The fixes are idempotent - they only run if the bugs are detected and won't break already-fixed installations.
If you have an existing SuiteCRM installation that wasn't started with the updated entrypoint, you can manually apply the fixes:
# Fix bug #1: Duplicate static variable in AOW_WorkFlow
docker compose exec php sed -i '644d' public/legacy/modules/AOW_WorkFlow/aow_utils.php
# Fix bug #2: Duplicate static variable in InlineEditing
docker compose exec php sed -i '294d' public/legacy/include/InlineEditing/InlineEditing.php
# Fix bug #3: Incorrect RewriteBase in .htaccess
docker compose exec php sed -i 's|RewriteBase localhostlegacy/|RewriteBase /legacy/|' public/legacy/.htaccess
# Clear cache and restart
docker compose exec php bash -c "rm -rf cache/prod/* public/legacy/cache/*"
docker compose restart phpIf the installation fails or is interrupted, you may need to unlock the installer:
docker compose exec php sed -i "s/'installer_locked' => true/'installer_locked' => false/" public/legacy/config.phpThen retry the installation command from step 4.
To manually install or reinstall SuiteCRM:
docker compose exec php bin/console suitecrm:app:install [options]-U, --db_username: Database username (default: root)-P, --db_password: Database password (default: root)-H, --db_host: Database host (default: mysql)-Z, --db_port: Database port (default: 3306)-N, --db_name: Database name (default: root)-u, --site_username: Admin username-p, --site_password: Admin password-S, --site_host: Site host (default: localhost)-d, --demoData: Install demo data (yes/no)-W, --sys_check_option: Ignore system check warnings (true/false)
docker compose exec php bin/console suitecrm:app:install \
--db_username=root \
--db_password=root \
--db_host=mysql \
--db_port=3306 \
--db_name=root \
--site_username=admin \
--site_password=MySecurePassword123 \
--site_host=localhost \
--demoData=no \
--sys_check_option=true-
php: PHP 8.3 with Apache and required SuiteCRM extensions
- Port: 80
- Volume:
./volumes/suitecrm→/var/www/html - Xdebug pre-configured (disabled by default)
-
mysql: MySQL database
- Port: 3306
- Root password: root
- Database: root
- Volume:
./volumes/mysql/data→/var/lib/mysql
Create a .env file or set in docker-compose.yml:
VERSION_SUITECRM: SuiteCRM version to download (default: v8.8.0)XDEBUG_CONFIG: Xdebug configurationTZ: Timezone (default: America/Sao_Paulo)
# Start services
docker compose up -d
# Stop services
docker compose down
# View logs
docker compose logs -f php
# Rebuild PHP container
docker compose build php
# Access PHP container shell
docker compose exec php bash# MySQL CLI
docker compose exec mysql mysql -uroot -proot root
# External connection
mysql -h localhost -P 3306 -u root -proot root# Run console commands
docker compose exec php bin/console <command>
# Clear cache
docker compose exec php bin/console cache:clear
# List all commands
docker compose exec php bin/console list# Clear Symfony cache
docker compose exec php bash -c "rm -rf cache/prod/*"
# Clear legacy SuiteCRM cache
docker compose exec php bash -c "rm -rf public/legacy/cache/*"
# Restart PHP container
docker compose restart php- Edit
.docker/php/config/php.ini:
xdebug.mode=debug- Rebuild and restart:
docker compose build php
docker compose up -d- Configure your IDE to listen on port 9003
# Application logs
docker compose exec php cat logs/prod/prod.log
# Installation logs
docker compose exec php cat logs/install.log
# Apache logs
docker compose logs phpIf you see "Database failure. Please refer to suitecrm.log":
- Check for the duplicate static variable bug (see Known Issues)
- Verify database connection:
docker compose exec php php -r "new PDO('mysql:host=mysql;port=3306;dbname=root', 'root', 'root'); echo 'OK';"- Clear cache and restart
To completely reset and reinstall:
# Stop containers and remove volumes
docker compose down -v
# Remove SuiteCRM files
sudo rm -rf volumes/
# Start fresh
docker compose up -d
# Apply bug fix and install
# (Follow steps 3-4 from Quick Start)GitHub Actions automatically builds and publishes the Docker image to ghcr.io on:
- Pushes to main/master
- Tag creation (v*)
- Pull requests
SuiteCRM is licensed under AGPLv3. See LICENSE.txt for details.