How to Install Judge0 A Complete Step-by-Step Guide

Chetan RakhejaChetan Rakheja
3 min read

This blog contains steps to install Judge0 on a local machine using Docker, assuming Docker is already installed in the system and up and running, and kind of focused on MAC OS installation, but the same steps will work on Windows as well

Installation using Docker

  1. Download and extract the release files:

     wget https://github.com/judge0/judge0/releases/download/v1.13.1/judge0-v1.13.1.zip
    

Or you can directly open this URL in the browser to download the zip file

  1. Unzip the zip file you downloaded using the command below or any unzipping utility

     unzip judge0-v1.13.1.zip
    
  2. Go inside the folder

     cd judge0-v1.13.1
    
  3. Visit this website to generate a random password or set a complex password.

  4. Use the generated password to update the variable REDIS_PASSWORD in the judge0.conf file.

  5. Visit this website again to generate another random password or set a complex password.

  6. Use the generated password to update the variable POSTGRES_PASSWORD in the judge0.conf file.

  7. Now run DB services using the below Docker command

     docker-compose up -d db redis
    
  8. Wait for a few seconds for to command to get completed and the Postgresql database and Redis to start working

  9. Now, run all services and wait a few seconds until everything is initialised:

    docker-compose up -d
    
  10. Your instance of Judge0 CE v1.13.1 is now up and running; visit the docs at http://localhost:2358/docs or http://<IP ADDRESS OF YOUR SERVER>:2358/docs

Common Issues while Installing on Mac OS

Judge0 Service is not running

  1. Error due to existing Postgresql running on the same port, and judge0 is trying to connect to that

    Can be solved by stopping all other postgres services and deleting the running container

  2. Judge0 started, but you changed the judge0 config, and then it is not starting

    It can be solved by clearing all Docker data, like existing volumes, networks, images, etc.

    You can use the below command to reset all Docker data and remove all unused containers, volumes, networks and images

     docker system prune -a --volumes
    

    WARNING! This will remove:

    • all stopped container

    • all networks not used by at least one container

    • all volumes not used by at least one container

    • all images without at least one container associated to them

    • all build cache

Judge0 Service is running, but getting an error while hitting the API

  message: 'No such file or directory @ rb_sysopen - /box/script.js',
  status: { id: 13, description: 'Internal Error' }

If you are getting this error, this can be due to incompatibility of MAC OS with the build version

Can be fixed by adding the following in settings-store.json / settings.json If you are using an older Docker version

“deprecatedCgroupv1”: true

File path Location

Mac: ~/Library/Group\ Containers/group.com.docker/settings-store.json
Windows: C:\Users[USERNAME]\AppData\Roaming\Docker\settings-store.json
Linux: ~/.docker/desktop/settings-store.json

Additionally Enable Use Rosetta for x86_64/amd64 emulation on Apple Silicon in MAC OS

5
Subscribe to my newsletter

Read articles from Chetan Rakheja directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Chetan Rakheja
Chetan Rakheja