Open edX Native Installation

Reza
3 min readOct 8, 2020
Photo by Annie Spratt on Unsplash

This installation is based on these references and discussions.

The first thing to do is to get a Ubuntu 16.04 server with at least 2 cores, 8 GB of RAM and 100 GB of storage. I got mine on AWS which is a t2.large instance.

Prepare your server by updating, upgrading and doing a reboot:

$ sudo apt update
$ sudo apt upgrade
$ sudo reboot

To make life easier I like to install mosh:

$ sudo apt install mosh

Make sure locales are set right:

$ sudo locale-gen en_US en_US.UTF-8
$ sudo dpkg-reconfigure locales
$ sudo dpkg --configure -a

Define the base of your learning management system (LMS) and content management system (CMS) by creating the file config.yml:

$ vi config.yml

Insert these lines. Please use your own values for the domain names:

EDXAPP_LMS_BASE: "example.com"
EDXAPP_CMS_BASE: "studio.example.com"

Save the file.

Make sure locale variables are set:

$ export LC_ALL="en_US.UTF-8"
$ export LC_CTYPE="en_US.UTF-8"

Choose the Open edX version you will be installing:

$ export OPENEDX_RELEASE=open-release/juniper.master

Bootstrap the Ansible installation:

$ wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/ansible-bootstrap.sh -O -| sudo -H bash

Randomize passwords:

$ wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/generate-passwords.sh -O -| bash

Install the Open edX software:

$ nohup $SHELL <<EOF &
> wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/native.sh -O -| bash > install.out
> EOF

The install will take around an 1.5 hours to complete so make yourself a nice cup of coffee.

Monitor the installation by doing a:

$ tail -f install.out

Your install is done when you see:

Installation finished at yyyy–mm–dd hh:mm:ss

Make sure all the services are running:

$ sudo /edx/bin/supervisorctl status
Open edX Services
Open edX Services

Create an an account with staff/admin and superuser privileges and set its password:

$ sudo su edxapp -s /bin/bash
$ cd
$ source edxapp_env
$ /edx/bin/python.edxapp /edx/bin/manage.edxapp lms manage_user user user@example.com --staff --superuser --settings=production
$ cd /edx/app/edxapp/edx-platform
$ ./manage.py lms --settings production changepassword user

Specify SameSite=Lax so that cookies shall not be sent in cross-site requests (for further information read this). Edit the file common.py:

$ vi /edx/app/edxapp/edx-platform/lms/envs/common.py

And change:

DCS_SESSION_COOKIE_SAMESITE = 'None'

To:

DCS_SESSION_COOKIE_SAMESITE = 'Lax'

Save the file and exit:

$ exit

Restart services:

$ sudo /edx/bin/supervisorctl restart all

Now check whether every site is running properly.

The LMS at http://example.com:

Open edX LMS

The CMS/Studio at http://example.com:18010:

Open edX Studio

The Django Admin at http://example.com/admin:

Open edX Django Admin

Enjoy!

--

--