A script that sets up a Moodle development environment in Ubuntu
Disclaimer: This is only meant for use on development and testing environments. Do NOT use this for production environments!
-
Download and install Ubuntu Desktop.
- If you're setting up an Ubuntu virtual machine using VirtualBox, follow these instructions.
-
Open a terminal and install
gitsudo apt update && sudo apt install -y git -
Clone this repository.
git clone https://github.com/junpataleta/moodle-ubuntu.git cd moodle-ubuntu- Note: If you're using VirtualBox, this is a good point to take a snapshot of the machine first, so it would be easier to reset in case you need to reinstall when the setup script gets updated in the future.
-
Copy
config-dist.shtoconfig.shand edit the Git-related or MDK-related settings inconfig.sh. -
Run the script
./setup.sh
-
Grab some coffee, walk the dog, cook your lunch, do the laundry, or whatever.😛
After the installation, you should have the following:
-
Apache server
-
PHP versions supported by the lowest security-supported version of Moodle and the next major Moodle version (
main).-
PHP versions supported by currently supported versions:
- PHP 7.4
- PHP 8.0
- PHP 8.1
- PHP 8.2
- PHP 8.3
- PHP 8.4
-
To switch PHP versions, open a terminal and run
~/apps/switchphp.sh PHPVERwherePHPVERis any of the installed PHP version numbers. e.g. to switch to PHP 8.2~/apps/switchphp.sh 8.2
-
-
PostgreSQL server version supported by your Ubuntu distribution.
- Username:
postgres - Password:
moodle
- Username:
-
MySQL server version supported by your Ubuntu distribution.
-
MDK
- Two instances are created by MDK during setup:
- A
moodle.gitinstance based on themainbranch:http://localhost/stable_main - An
integration.gitinstance based on themainbranch:http://localhost/integration_main
- A
- Default
adminpassword for both instances istest. - Default database engine is
pgsql.
- Two instances are created by MDK during setup:
-
Behat-related stuff:
- moodle-browser-config
- Chromedriver
- Geckodriver
- Selenium
- Just run the command
selto start the Selenium server.
- Just run the command
-
Docker with Docker compose
-
Ngrok
-
Adminer:
http://localhost/adminer.php
Enjoy!