Moodle: https://moodle.org/ Lando: https://docs.devwithlando.io/ Docker: https://docs.docker.com/
-
Run docker on your machine. I use the "Docker for Mac" desktop app.
-
Get lando running on your machine. Follow these directions. It's pretty quick. https://docs.devwithlando.io/installation/installing.html
-
Set up a
moodledatadirectory somewhere you can find it. You will need to know its location relative to your home directory on your machine, as later we'll have to tell the docker image where to find it in its docker world.
$ cd /Users/jebacal/landolanding/
$ mkdir mynewlandomoodle
$ cd mynewlandomoodle
$ mkdir moodledata- Now - to get Moodle to be able to write into the moodledata directory at the start of things, you have to do this. We'll change it back later.
$ chmod -R 0777 moodledata- Now go to wherever you like to have your local moodle codebases. I keep mine under sites/moodles. Make a new Moodle. I'm using CLAMP Moodle.
$ cd sites/moodles
$ mkdir mynewlandomoodle
$ cd mynewlandomoodle
$ git clone https://github.com/CLAMP-IT/moodle.git
$ cd moodle- Maybe you want to check out a certain branch. Go ahead. Now its time to get a lando file in here. If you want to just get something running and all the latest and greatest versions are good for you, then just do this.
$ lando initand then go to #7.
Otherwise, If you need to mess with the recipe, then go to #6.5
6.5 Going to try just putting in a customized recipe lando file without running lando init. In my case I need to run a version of Moodle that does not like PHP 7.1 so I will try this :
# inside /moodle
$ touch .lando.yml
and then put this in that file:
name: threeone
recipe: lamp
config:
webroot: .
php: '5.6'and then try lando start and then lando info
- Now you have a fun chance to choose a preset Lando recipe. Arrow down and choose LAMP. Now things will happen by magic.
$ lando start
$ lando info-
Collect this information. You will need it soon.
-
Visit the link that looks like
http://mynewlandomoodle.lndo.site:8000 -
Moodle wants some info to start up the installation. The one you need to change is the data directory. It should be the one you created way up at the top but under /data. This is all about matching a location in the docker container. So in this case it would be:
/user/landolanding/mynewlandomoodle/moodledata -
Click through until it is time to add your database credentials. The stuff you need is in the output of
lando info. In this case it is:
- Database host:
database.mynewlandomoodle.internal - user:
lamp - database:
lamp - password:
lamp
-
It's all clicking from here. Your local Moodle should be running.
-
Need some other php extensions? MariaDB? Different credentials? Other stuff? Your .lando.yml file can be leveraged to do all kinds of amazing things that I don't even know the half of. Read about it here: https://docs.devwithlando.io/started.html
-
Go back and fix permissions on that
moodledatadirectory
$ cd /Users/jebacal/landolanding/mynewlandomoodle
$ chmod -R 0770 moodledata