- WSL2 with Distro Ubuntu 24.04
⚠️ Other Distros likely will not work out of the box as of dependency issues. - Docker Desktop
- To resolve any issues with shell scripts (typically ^M errors), disable automatic line ending conversion in git by running:
git config --global core.autocrlf inputThe repo has to be cloned again after this change.
This section will describe how to set up and reset the development environment.
- Enter WSL. This guide will use shell commands and therefore does not work with the Windows console.
- Clone this repository to a place of your choice (eg
/home/<wsl username>/AdlerDevelopmentEnvironment). - continue with the following sections
- Run the
setup.shscript as non-root user.- For using an existing MariaDB database without using Docker, see Using Existing Database
- Plugins: Clone all plugins to their corresponding directory. See the
Adler LMS -> plugins.json for a list of all plugins and Moodle documentation for the target directories
to clone it to. Example command:
git clone <git url> local/adler- Note for playbook_adler: playbooks are subplugins of local_declarativesetup. The plugin directory is
local/declarativesetup/playbook
- Note for playbook_adler: playbooks are subplugins of local_declarativesetup. The plugin directory is
- Run adler playbook
DECLARATIVE_SETUP_MANAGER_PASSWORD='Manager1234!1234' DECLARATIVE_SETUP_STUDENT_PASSWORD='Student1234!1234' php local/declarativesetup/cli/run_playbook.php -p=adler -r=test_users,moodle_dev_env
Note
The PHP built-in server (php -S) is slower compared to a full web server. For better performance, consider using a full web server like Caddy or Apache. See Alternative Web Server Setup for detailed instructions. PHP built-in server was chosen because other servers are more complex to set up and potential require more system modifiacations.
After completing the installation above, start the development server:
cd ~/moodle/moodle && php -S localhost:5080Press Ctrl+C to stop the server.
- After starting the server, Moodle is available at http://localhost:5080
- Default credentials can be taken from .env file.
To reset the environment and start fresh, manually delete the following:
- Create a backup using the provided backup script:
backup_data.sh - Database:
- If using docker (default): Stop and remove Docker containers and volumes:
docker compose down -v - If using another database server: Drop the Moodle database
- Moodle data directories: clear the Moodle data directories:
rm -rf ~/moodle/moodledatarm -rf ~/moodle/moodledata_bhtrm -rf ~/moodle/moodledata_phpu
- Moodle config: delete the Moodle configuration file
config.php
After this cleanup, you can run the setup script again.
- backup_data.sh: Creates a backup of Moodle data and database. Run using ./backup_data.sh.
- restore_data.sh: Restores Moodle from a backup. Use it like ./restore_data.sh /path/to/backup.
The previous steps did just set up the base moodle environment. The following guides will help configuring test and debug tools.
- Setup PHPStorm for debugging
- Windows Firewall Configuration Without this it is not possible for any IDE on Windows to connect to the xdebug server in WSL.
- Debug Code executed in the shell