Ishan Sheth (imsheth)

The Hows - Open edX Nutmeg with Tutor 14 on Ubuntu 20

The Hows - Open edX Nutmeg with Tutor 14 on Ubuntu 20

Jun 29, 2022

The motivation for writing this post is in the hope that it helps others save lots of time, energy instead of going through various links but hitting dead ends due to lack of community support, broken features, features lacking updates and improper documentation prevailing around the topic.

This post is focused on how to setup Open edX Nutmeg with Tutor 14 on Ubuntu 20

Ubuntu 20.x.x

  1. Check the machine operating system, it should be Ubuntu 20.x.x
  2. Our test machine operating system details (Ubuntu 20.04.2 LTS (Focal Fossa))
cat /etc/os-release
  1. It is recommended to use the LTS version but not necessary

  2. This completes Ubuntu check

python 3.8.10

  1. Install python 3.8.10 and required packages
sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get install software-properties-common && sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget libyaml-dev && sudo apt install python3.8 && sudo apt-get install python3-dev && python3.8 --version
  1. Verify python 3.8.10 installation path
whereis python
  1. Set environment/path/alias variables for python 3.8.10 & pip 22.1.2
echo 'export PATH=$PATH:"/usr/bin/python3.8"' >> ~/.bashrc && echo 'alias python="python3.8"' >> ~/.bashrc && echo 'export PATH=$PATH:"/home/ubuntu/.local/bin"' >> ~/.bashrc && echo 'alias pip="pip3"' >> ~/.bashrc && source ~/.bashrc && echo $PATH && python --version
  1. pip 22.1.2
cd /tmp && curl -o && python && pip install --upgrade pip --user && pip --version
  1. This completes python and pip installation

Docker 20.10.17

  1. Install docker 20.10.17
cd /tmp && curl -fsSL -o && sh && docker --version
  1. Enable docker remote API on docker host (comments section)
sudo vim /lib/systemd/system/docker.service
# Comment the original line for backup to revert if needed
#ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecStart=/usr/bin/dockerd -H fd:// -H --containerd=/run/containerd/containerd.sock
  1. Reload - restart daemon and verify docker remote API response
sudo systemctl daemon-reload
sudo service docker restart
curl http://localhost:2375/images/json
  1. Install docker compose 1.29.2
sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose && docker-compose --version
  1. Run docker without sudo
sudo groupadd docker && sudo usermod -aG docker ${USER}
  1. This completes docker 20.10.17 and docker compose 1.29.2 installation and setup

Tutor 14.0.2

  1. Install Tutor 14.0.2
pip install "tutor[full]" && tutor --version
  1. Set environment/path variables for Tutor 14.0.2
echo 'export PATH=$PATH:"/home/ubuntu/.local/bin/tutor"' >> ~/.bashrc && source ~/.bashrc
  1. Setup Tutor 14.0.2 with interactive shell
tutor local quickstart
  1. Assign static/elastic IP to the instance

  2. Add domain mappings to the static/elastic IP

A openedx x.x.x.x 600s
CNAME *.openedx 60m
  1. We have our openedx running

  2. We have our openedx studio running

  3. We have our openedx admin running

  4. View logs from all containers (as per need)

tutor local logs --tail=100 -f
  1. Local deployment reloading settings (as per need)
tutor local restart
  1. Creating a new user with staff and admin rights (works with studio and admin portals, can also be used on the learner portal) [pass1234 is the password entered on the prompt here]
tutor local createuser --staff --superuser imsheth
  1. Importing the demo course
tutor local importdemocourse
  1. This completes Tutor 14.0.2 and Open edX Nutmeg installation and setup

Open edX APIs

  1. Enable API access config at admin

  2. API access config is enabled at admin

  3. Fill the API access request form at api-admin

  4. Submit the API access request form at api-admin

  5. Your API access request is available at admin

  6. Approve and save your API access request at admin

  7. Your API access request is approved at admin

  8. Fill the form to generate API access credentials at api-admin

  9. Your API access credentials are generated and available at api-admin

  10. Get CSRF token from account registration endpoint response headers

  11. Use it in headers in access token endpoint

  12. Get JWT token from access token endpoint in response using client_id and client_secret generated in step 9 above

  13. Most of the GET endpoints are open and do not need authentication like account registration form endpoint

  14. Use JWT token in "Authorization" key and CSRF token in "X-CSRFToken" key in header and hit account registration endpoint

  15. Hit account registration endpoint with proper body attributes by referring to API documentation at

  16. Above approach worked fine to fix CORS issues, but the below links didn't work in the same case

Customizing Settings

  1. Turning off rate limiting
tutor config save --set RATELIMIT_ENABLE=False
  1. Turning on debugging
tutor config save --set DEBUG=True
  1. Using Google SMTP
tutor config save --set RUN_SMTP=false
tutor config save \
--set \
--set SMTP_PORT=587 \
--set SMTP_USE_SSL=false \
--set SMTP_USE_TLS=true \
--set \
--set SMTP_PASSWORD=gmailidpassword
  1. Applying settings
tutor local restart

#openedx #openedxnutmeg #tutor #tutor14.0.2 #docker #docker20.10.17 #python #python3.8.10 #pip #pip21.1.2 #ubuntu #ubuntu20.04.4lts #tech #edtech #lms #learningmanagementsystem

Edit this page on GitHub