CourseLit
Published in

CourseLit

Running CourseLit On A Free AWS Plan

In this post, I will show you how to launch your own online teaching platform for free by running CourseLit on a free AWS plan.

Hosting CourseLit LMS On AWS For Free

For the uninitiated, Amazon Web Services (AWS) is a cloud hosting provider which provides a generous free plan for beginners where one can play around with various services they offer.

The free plan includes certain services which the new users can use for the next 12 months after signing up. One of those services is EC2 which is what we are going to use to host CourseLit.

Before We Begin

You will need a domain name before starting the setup as CourseLit needs to acquire a SSL certificate for enabling HTTPS on your new site and that is only possible if the domain name can be resolved to an actual web host i.e. the EC2 instance in our case.

The Process

Step 1. Get A Free AWS Account

Let’s start by signing up for a free AWS account.

Step 2. Create a t2.micro instance

Once you are in the AWS Management Console, look for EC2 and create an instance. For this tutorial, we have used a t2.micro instance which qualifies for the AWS free tier.

By now, you will have a .pem file which you can use to securely login to your instance via SSH using a command like the following. Let’s call this key.pem.

ssh -i key.pem your-user@your-compute-address.compute.amazonaws.com

Step 3. Making sure our instance is reachable

Our instance will not be reachable from the outside world by default. We need to tie an elastic IP to our instance for that. You can easily do that from the same dashboard. Make sure your elastic IP is attached to a running instance otherwise you may be billed.

Once you have the elastic IP, you can set up a A record into the DNS section of your hosting provider so that you can type in your-domain.com to reach the AWS instance.

You are required to wait for sometime after this step as DNS propagation takes time.

Additionally, we have to add a new security group to our instance and under the inbound rules section we have to enable HTTPS as shown below otherwise the instance won’t be reachable via HTTPS as CourseLit, by default is served over HTTPS.

AWS Security Group

Step 4. Install Ansible

We have to install Ansible on our local machine as the deployment script we talked about is an Ansible script. Follow a relevant guide for your operating system and make sure you are able to run ansible-playbook command.

Step 5. Add your instance information to Ansible hosts file

We need to make an entry to the Ansible host file (etc/ansible/hosts on Linux) detailing the instance address and login credentials. Mine look like the following.

[aws]
my-domain.com ansible_host=my-domain.com ansible_user=ubuntu ansible_ssh_private_key_file=/path/to/instance/key.pem

Step 6. Clone CourseLit’s Repo

We have to fetch the CourseLit repository from GitHub as it contains the deployment script.

git clone https://github.com/codelitdev/courselit.git

CD to the courselit directory.

Step 7. Deploy CourseLit

Now all the pre-planning is complete and we can finally deploy our own learning platform. Execute the following command to deploy.

ansible-playbook deployment/install.yml -l <your-ansible-host-entry> -e 'ansible_python_interpreter=/usr/bin/python3'

Make sure to change the <your-ansible-host-entry> to the value you set in Step 6.

The installer will ask a few questions about your domain name, database username and password etc., and it will do the rest. By the end you will have fully working website available at https://your-domain.com.

If you are still facing some problem, come chat with me with the official Discord chat.

Follow the publication for more juicy tips and updates regarding CourseLit LMS.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rajat Saxena

Rajat Saxena

Software Engineer; Builds Internet Based Businesses & Apps; Solopreneur