Skip to content

Recommended development environment ​

How to run Exment on your own computer while you build plugins.
Run a plugin locally first, before you try it on a production Exment.

The big picture ​

We recommend Docker. The parts that run Exment (web server, PHP, database) run in containers, and you open http://localhost in your browser.

Edit the files of a folder with your editor and an AI tool; Exment runs in the Docker containers web, php and mysql; open localhost in the browserYour computerEditorVS Code, etc.AI coding tooloptionalBrowserhttp://localhostDocker (docker-exment)webnginxphpPHP-FPM, Exmentmysqldatabaseexment-boilerplate/a folder on your computer,shared with the containersstorage/app/plugins/uploaded pluginsare stored here

Your computer ​

Guide
Memory8 GB works. 16 GB is comfortable
OSWindows (WSL2), macOS, Linux
ToolsDocker (with docker compose), git, make

Use exceedone/docker-exment. It runs exceedone/exment-boilerplate (a Laravel application with Exment).

1. Install Docker ​

  • Windows: install WSL2 and a distribution such as Ubuntu. For Docker, use Docker Desktop (with the WSL2 backend) or Docker Engine installed inside WSL.
    Run the steps below inside WSL (an Ubuntu terminal). Keep the folders inside WSL (e.g. ~/work); they are much faster there than under /mnt/c.
    If make or git is missing, install them with sudo apt install make git.
  • macOS: install Docker Desktop or similar. xcode-select --install gives you make and git.
  • Linux: install Docker Engine and the Compose plugin.

2. Get it and build it ​

bash
git clone https://github.com/exceedone/docker-exment.git
cd docker-exment
git clone https://github.com/exceedone/exment-boilerplate.git exment-boilerplate
# first time only (makes the containers, runs composer install, prepares .env and the keys)
make mysql-init
  • Keep the folder name exment-boilerplate. The containers mount the folder with this name.
  • For MariaDB use make mariadb-init; for SQL Server use make sqlsrv-init.
  • If other computers can reach the environment, change the passwords in docker-exment/.env.

3. Open it and set it up ​

Open http://localhost in your browser and follow the screens of the initial setting.

  • If another program uses port 80, change EXMENT_DOCKER_HTTP_PORTS in docker-exment/.env (e.g. 8080) and APP_URL in exment-boilerplate/.env (e.g. http://localhost:8080).

From the second time ​

bash
make mysql-up     # start
make down         # stop
make php          # a shell in the php container
make logs         # show the logs

make destroy also deletes the database data. Be careful.

Which Exment version you get ​

make mysql-init installs the Exment that exment-boilerplate requires (a released version).
To try a branch or a tag that is not released yet, use make mysql-init EXMENT_REF=(branch or tag). See the README of docker-exment.

Without Docker ​

Install PHP and the rest directly on your computer.

SoftwareVersion
PHP8.2 or later (Exment's CI tests 8.2 to 8.4)
Composer2
DatabaseMySQL 8.0 or later, MariaDB 10.11 or later (SQL Server also works)
  • To build plugins only: install as usual, with the steps of Manual installation, and open it with php artisan serve or a web server.
  • To change Exment itself: keep the Exment repository on your computer and load it with a Composer path repository. The steps are in docs/development.md.
    Exment 7.3 uses exment-admin-core 2.x; 7.2.x uses 1.x.

Editor ​

  • We recommend VS Code with the PHP Intelephense extension.
  • Open the exment-boilerplate folder, and the classes in vendor/exceedone/exment (such as PluginPageBase) are completed too.

Xdebug (stop and look inside) ​

The PHP image of docker-exment does not have Xdebug (only PCOV, for test coverage). Add it yourself when you need it.

  1. Add this to docker/php/Dockerfile:
    dockerfile
    RUN pecl install xdebug && docker-php-ext-enable xdebug
  2. Add this to docker/php/volumes/php.ini:
    ini
    xdebug.mode=debug
    xdebug.start_with_request=yes
    xdebug.client_host=host.docker.internal
    xdebug.client_port=9003
    With Docker Engine on Linux, also add extra_hosts: ["host.docker.internal:host-gateway"] to php in docker-compose.yml.
  3. Run make down, then rebuild with docker compose -f docker-compose.yml -f docker-compose.mysql.yml up -d --build.
  4. Install the PHP Debug extension in VS Code and use a launch.json like this. The .vscode/launch.json of docker-exment uses port 9000; Xdebug 3 uses 9003, so change it.
    json
    {
      "name": "Listen for Xdebug",
      "type": "php",
      "request": "launch",
      "port": 9003,
      "pathMappings": { "/var/www/exment": "${workspaceFolder}" }
    }
    ${workspaceFolder} works when you opened the exment-boilerplate folder.

Checking the code ​

These are checks that Exment's CI uses. You can use them for plugins too.

bash
# syntax errors (inside the php container)
php -l storage/app/plugins/HelloExment/Plugin.php

# PHPStan (exment-boilerplate has larastan)
./vendor/bin/phpstan analyse -c phpstan-plugin.neon --memory-limit=1G

An example phpstan-plugin.neon (put it in exment-boilerplate):

yaml
includes:
    - ./vendor/larastan/larastan/extension.neon
parameters:
    level: 1
    paths:
        - storage/app/plugins/HelloExment

When you change Exment itself, also use php-cs-fixer, as the CI does (php-cs-fixer fix --dry-run -v --diff ./src). See docs/development.md.

Add an AI coding tool ​

You can use Claude Code, GitHub Copilot, Cursor and others on top of this environment. How to use them and what to watch: Develop with AI coding tools.

Where the plugin is while you develop it ​

WayGood for
Make a zip and upload it on the plugin screenAlways. Upload again this way when you change config.json
Edit the folder of the uploaded plugin directlySmall, repeated changes to PHP or Blade
Edit it with [Edit Plugin] on the plugin's edit screenSmall changes with only a browser
  • An uploaded plugin is stored in exment-boilerplate/storage/app/plugins/(plugin name)/ (when the file storage is the default local).
  • When you change PHP or Blade there, reloading the page is enough (the PHP of docker-exment does not use OPcache).
  • The type, target tables, triggers and other settings in config.json are read on upload. When you change them, upload the zip again.
  • The folder belongs to www-data. It is easier to keep the plugin source in a folder of your own (in Git) and copy it into the container.
    bash
    # in the docker-exment folder
    docker compose -f docker-compose.yml cp ../HelloExment/. php:/var/www/exment/storage/app/plugins/HelloExment/
    docker compose -f docker-compose.yml exec php chown -R www-data:www-data storage/app/plugins/HelloExment

Common problems ​

ProblemFix
The screen shows a 500 error and the log says "Permission denied"Running artisan as root makes root the owner of files. Give them back with docker compose -f docker-compose.yml exec php chown -R www-data:www-data .env storage bootstrap/cache. Run artisan as www-data, e.g. docker compose -f docker-compose.yml exec -u www-data php php artisan ...
"No application encryption key"APP_KEY in .env is empty. Run php artisan key:generate (make mysql-init does it for you)
You do not want to send real mailAdd MAIL_MAILER=log to exment-boilerplate/.env and leave the mail host in the system settings empty. Mail is written to storage/logs/laravel.log
A change in .env has no effectRun php artisan config:clear
It stops answering after a whileOn Windows, Docker stops when WSL stops. Start it again with make mysql-up
You want to see the errorLook at exment-boilerplate/storage/logs/laravel.log

Next ​

Your first plugin in 10 minutes