CourseLit Self Hosting Guide
CourseLit Self Hosting Guide
Before you self-host: Although we believe in the power of hosting your own software, we still think that buying a subscription to CourseLit will save you a lot of time and money compared with maintaining your own CourseLit instance. Check out our pricing.
We distribute Docker images for all our services through Docker Hub.
Hosting on a VPS using Docker
We recommend Docker Compose for hosting CourseLit.
Run the following commands in order.
1. Download the docker-compose.yml file to your system.
curl https://raw.githubusercontent.com/codelitdev/courselit/main/deployment/docker/docker-compose.yml --output docker-compose.yml --silent2. Start the app
SUPER_ADMIN_EMAIL=your@email.com docker compose upThe email you specify here will be set as the super admin of your CourseLit instance.
Troubleshooting: If you run this command multiple times, note that the super admin user will be created only once, using the email address you provided the first time. If you are unable to access the
/dashboardroute, it is most likely because the email you are using is not associated with the super admin account. Try removing the Docker containers by runningSUPER_ADMIN_EMAIL=your@email.com docker compose down, then start again.
3. Test drive your CourseLit school
Visit http://localhost to see your school. There will not be much to see at this point, because you still need to customize it.
4. Log in to your school
Click the top-right icon, then click the login menu item. Enter the email you provided in Step 2 to log in. Since mail is not configured yet, the magic login link will be printed in the docker compose logs. Locate the link and click it, or copy and paste it into your browser to log in.
The login link looks something like http://localhost/login?token=some-long-string.
5. Customise your school
Visit http://localhost/dashboard to customize your school.
Note: This will be a bare-bones instance. Features such as email and file uploads will not work yet. You can follow the rest of this guide to set those up.
Enabling emails
If you want to send emails, including magic login links, with CourseLit, that is easy to set up as well.
- Create an environment file called
.envwith the following content in the same directory as yourdocker-compose.ymlfile, and replace the values as needed.
SUPER_ADMIN_EMAIL=your@email.com
# Email
EMAIL_HOST=host
EMAIL_USER=user
EMAIL_PASS=pass
EMAIL_FROM=from_field- Restart the app
docker compose stop
docker compose upEnabling file uploads
If you want to upload media such as images and videos to your school, you need to configure MediaLit. MediaLit powers CourseLit's media management and optimization. MediaLit provides a Docker image that you can self-host.
To self-host it, follow these steps.
-
Uncomment the block under the
appservice indocker-compose.ymlthat looks like this:# - MEDIALIT_APIKEY=${MEDIALIT_APIKEY} # - MEDIALIT_SERVER=http://medialit -
Uncomment the block titled
MediaLitindocker-compose.yml. -
In your
.envfile, paste the following code under the existing content and change the values to match your environment.# Medialit Server CLOUD_ENDPOINT=aws_s3_endpoint CLOUD_REGION=aws_s3_region CLOUD_KEY=aws_s3_key CLOUD_SECRET=aws_s3_secret CLOUD_BUCKET_NAME=aws_s3_bucket_name S3_ENDPOINT=aws_s3_cdn_endpoint CLOUD_PREFIX=medialit MEDIALIT_APIKEY=key_to_be_obtained_docker_compose_logsTo learn how to configure an AWS S3 bucket for MediaLit, click here.
-
Start the MediaLit service once to generate an API key to use with CourseLit.
docker compose up medialitThe above command will start the MediaLit service and display a fresh API key on the console. The relevant logs will look something like the following.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ API key: testcktI8Sa71QUgYtest @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Copy the API key.
-
Update the
MEDIALIT_APIKEYvalue in your.envfile and restart the service. -
That's it! You now have a fully functioning LMS powered by CourseLit and MediaLit.
Hosted version
If this is too technical for you to handle, CourseLit's hosted version is available at CourseLit.app.
It is managed by the team behind CourseLit. We take care of everything, so you can focus on your team and content.
Stuck somewhere?
We are always here for you. Come chat with us in our Discord channel or send a tweet at @CourseLit.