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.
Your computer
| Guide | |
|---|---|
| Memory | 8 GB works. 16 GB is comfortable |
| OS | Windows (WSL2), macOS, Linux |
| Tools | Docker (with docker compose), git, make |
With Docker (recommended)
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.
Ifmakeorgitis missing, install them withsudo apt install make git. - macOS: install Docker Desktop or similar.
xcode-select --installgives youmakeandgit. - Linux: install Docker Engine and the Compose plugin.
2. Get it and build it
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 usemake 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_PORTSindocker-exment/.env(e.g.8080) andAPP_URLinexment-boilerplate/.env(e.g.http://localhost:8080).
From the second time
make mysql-up # start
make down # stop
make php # a shell in the php container
make logs # show the logsmake 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.
| Software | Version |
|---|---|
| PHP | 8.2 or later (Exment's CI tests 8.2 to 8.4) |
| Composer | 2 |
| Database | MySQL 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 serveor a web server. - To change Exment itself: keep the Exment repository on your computer and load it with a Composer
pathrepository. 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-boilerplatefolder, and the classes invendor/exceedone/exment(such asPluginPageBase) 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.
- Add this to
docker/php/Dockerfile:dockerfileRUN pecl install xdebug && docker-php-ext-enable xdebug - Add this to
docker/php/volumes/php.ini:iniWith Docker Engine on Linux, also addxdebug.mode=debug xdebug.start_with_request=yes xdebug.client_host=host.docker.internal xdebug.client_port=9003extra_hosts: ["host.docker.internal:host-gateway"]tophpindocker-compose.yml. - Run
make down, then rebuild withdocker compose -f docker-compose.yml -f docker-compose.mysql.yml up -d --build. - Install the PHP Debug extension in VS Code and use a
launch.jsonlike this. The.vscode/launch.jsonof 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 theexment-boilerplatefolder.
Checking the code
These are checks that Exment's CI uses. You can use them for plugins too.
# 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=1GAn example phpstan-plugin.neon (put it in exment-boilerplate):
includes:
- ./vendor/larastan/larastan/extension.neon
parameters:
level: 1
paths:
- storage/app/plugins/HelloExmentWhen 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
| Way | Good for |
|---|---|
| Make a zip and upload it on the plugin screen | Always. Upload again this way when you change config.json |
| Edit the folder of the uploaded plugin directly | Small, repeated changes to PHP or Blade |
| Edit it with [Edit Plugin] on the plugin's edit screen | Small changes with only a browser |
- An uploaded plugin is stored in
exment-boilerplate/storage/app/plugins/(plugin name)/(when the file storage is the defaultlocal). - 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
| Problem | Fix |
|---|---|
| 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 mail | Add 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 effect | Run php artisan config:clear |
| It stops answering after a while | On Windows, Docker stops when WSL stops. Start it again with make mysql-up |
| You want to see the error | Look at exment-boilerplate/storage/logs/laravel.log |
