How to self-host Judge0 API on your PC locally | All you need to know

Denis Hoti
5 min readAug 2, 2022

In this article, you will find everything you need to know to self-host Judge0 API locally on your PC. We also cover the part of setting up a Linux Distributor, installing Docker on your PC, and hosting Judge0 API in your Virtual Box.

# Introduction

Judge0 (pronounced like “judge zero”) is a robust, scalable, and open-source online code execution system. You can use it to build a wide range of applications that need online code execution features. Some examples include competitive programming platforms, e-learning platforms, candidate assessment and recruitment platforms, online code editors, online IDEs, and many more.

Judge0 supports more than 60+ programming languages, helped by rich and understandable documentation.

Judge0 offers a wide range of plans when it comes to using their API, what we will cover in this article is the Self-Hosted Plan, which allows you infinite submissions(code executions) for free.

Step 1: Install Docker

To install Docker on your Windows device, the version of Windows also plays a role. So, if you have Windows 10 Pro/Enterprise or Education with the 1511 November update or later, the installation process of Docker for you it’s easier because Docker supports these versions. But if you have Windows 10 Home, we have to do some more steps but again don’t worry, we have you covered.

# Installation on Windows 10 Pro/Enterprise or Education

  1. Download Docker
  2. Double-click InstallDocker.msi to run the installer.
  3. Follow the Install Wizard: accept the license, authorize the installer, and proceed with the installation.
  4. Click Finish to launch Docker.

To verify your installation, on CMD(or on any Windows terminal) run: docker --version .

Installing a Linux Distributor

NOTE: Make sure your windows 10 version is 2004 or later

NOTE: This step is required for both Windows 10 Home and Windows 10 Pro/Enterprise or Education

  1. Search for ‘’Turn Windows features on or off in your search bar on the bottom left of your screen
  2. Enable both ‘Virtual Machine Platform’ and ‘Windows Subsystem for Linux
  3. Restart your computer

Let’s install Ubuntu 22.04 LTS from Microsoft Store, a Linux distributor.

Once the Ubuntu App has been installed, start it up.

After you launch Ubuntu for the first time, it requires you to create a username and password. (make sure you remember the password)

# Make sure that you are using WSL2 to run Ubuntu

  1. Let’s make WSL2 your default architecture, run this command:wsl --set-default-version 2
  2. You can check if you have successfully switched to WSL2 by running: wsl -l -v

# Installing Docker on Windows 10 Home

  1. Download the latest release of Docker Desktop
  2. Follow the usual installation instructions to install Docker Desktop, and Start Docker Desktop App
  3. From the Docker menu, select Settings > General
  4. Make sure that ‘Use the WSL 2 based engine’ is selected

5. Then go to Settings > Resources > WSL Integration in Docker Desktop and select Ubuntu 22.04

Now that we successfully installed Docker on your PC and also a Linux Distributor we are ready to host the Judge0 API.

Step 2: Host Judge0 API Locally

Note: Judge0 has only been tested on Linux and macOS, and might not work on Windows, thus Judge0 doesn’t provide support for it.

  1. Now we should open Ubuntu 22.04 LTS app

2. Run this command:

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

3. Then after you successfully have installed this .zip file run:

Note: If you don’t have unzip installed run this: sudo apt install unzip

unzip judge0-v1.13.0.zip

4. Run ls to list information about directories, then run cd judge0-v1.13,0 to navigate to the Judge0 folder.

5. Run these commands to initialize all services:

Note: These commands may take some time, because it requires about 11GB of data to download

docker-compose up -d db redis
sleep 10s
docker-compose up -d

After these commands end, your instance of Judge0 CE v1.13.0 is now available at : http://0.0.0.0:2358 or http://localhost:2358 .

In the Docker Desktop App, > Containers you can see the server running:

If you click on judge0-v1130 > judge=-v1130_server_1, you can directly open the server in the browser.

Helping links:

For any questions please use the Comment section or reach out to me.

If you end up here, I want to say, thank you for reading this article! 🎉

--

--

Denis Hoti

Data Science Student | Full-stack Developer | Backend Developer| PHP, Laravel, MySql, HTML5, CSS3, JavaScript, WordPress, Shopify …