{"id":795,"date":"2025-02-21T14:09:57","date_gmt":"2025-02-21T19:09:57","guid":{"rendered":"https:\/\/waterloobae.com\/?p=795"},"modified":"2025-08-20T13:29:48","modified_gmt":"2025-08-20T17:29:48","slug":"running-moodle-from-docker-image","status":"publish","type":"post","link":"https:\/\/waterloobae.com\/blog\/2025\/02\/21\/running-moodle-from-docker-image\/","title":{"rendered":"[Moodle] Running Moodle from Docker Image"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Bitnami provide docker image for Moodle and it can be found in <a href=\"https:\/\/hub.docker.com\/r\/bitnami\/moodle\">https:\/\/hub.docker.com\/r\/bitnami\/moodle<\/a>. In fact Bitnami provides a variety of Docker images, but I am not that familiar with this company. It looks solid though. docker-compose.yml file can be downloaded from their repository on GitHub. <a href=\"https:\/\/github.com\/bitnami\/containers\/tree\/main\/bitnami\/moodle\">https:\/\/github.com\/bitnami\/containers\/tree\/main\/bitnami\/moodle<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can copy docker compose yaml file and starts container out of it. docker-compose.yml file looks like below and Dockerfile is not needed since all Docker images are pulled from Docker hub.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\"># Copyright Broadcom, Inc. All Rights Reserved.\n# SPDX-License-Identifier: APACHE-2.0\n\nservices:\n  mariadb:\n    image: docker.io\/bitnami\/mariadb:latest\n    environment:\n      # ALLOW_EMPTY_PASSWORD is recommended only for development.\n      - ALLOW_EMPTY_PASSWORD=yes\n      - MARIADB_USER=bn_moodle\n      - MARIADB_DATABASE=bitnami_moodle\n      - MARIADB_CHARACTER_SET=utf8mb4\n      - MARIADB_COLLATE=utf8mb4_unicode_ci\n    volumes:\n      - 'mariadb_data:\/bitnami\/mariadb'\n  moodle:\n    image: docker.io\/bitnami\/moodle:4.5\n    ports:\n      - '80:8080'\n      - '443:8443'\n    environment:\n      - MOODLE_DATABASE_HOST=mariadb\n      - MOODLE_DATABASE_PORT_NUMBER=3306\n      - MOODLE_DATABASE_USER=bn_moodle\n      - MOODLE_DATABASE_NAME=bitnami_moodle\n      # ALLOW_EMPTY_PASSWORD is recommended only for development.\n      - ALLOW_EMPTY_PASSWORD=yes\n    volumes:\n      - 'moodle_data:\/bitnami\/moodle'\n      - 'moodledata_data:\/bitnami\/moodledata'\n    depends_on:\n      - mariadb\nvolumes:\n  mariadb_data:\n    driver: local\n  moodle_data:\n    driver: local\n  moodledata_data:\n    driver: local<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once docker-compose.yml file is saved. You can start the container by typing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">docker compose up -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When Moodle site starts, you can login by using credentials of <strong>user <\/strong>for user name and <strong>bitnami<\/strong> for password. Your Moodle will be hosted in your local machine on port 80. It can be accessed by http:\/\/localhost. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bitnami provide docker image for Moodle and it can be found in https:\/\/hub.docker.com\/r\/bitnami\/moodle. In fact Bitnami provides a variety of Docker images, but I am not that familiar with this company. It looks solid though. docker-compose.yml file can be downloaded from their repository on GitHub. https:\/\/github.com\/bitnami\/containers\/tree\/main\/bitnami\/moodle You can copy docker compose yaml file and starts [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,19],"tags":[],"class_list":["post-795","post","type-post","status-publish","format-standard","hentry","category-it-tips","category-moddle"],"_links":{"self":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/comments?post=795"}],"version-history":[{"count":3,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/795\/revisions"}],"predecessor-version":[{"id":901,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/795\/revisions\/901"}],"wp:attachment":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/media?parent=795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/categories?post=795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/tags?post=795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}