Setting Up WSL, Docker, and Judge0 on Windows (Complete Guide) 🖥️🚀

Vikram KumarVikram Kumar
4 min read
  • If you're a developer or coding enthusiast looking to create a lightweight development environment on Windows, setting up WSL, Docker, and Judge0 is a great option.
    In this blog, I'll guide you step-by-step to install and configure everything smoothly.

🛠️ Step 1 : Install WSL and Ubuntu

  • First, we'll set up Windows Subsystem for Linux (WSL) and install Ubuntu as our Linux distribution.

1. Install WSL

  • Open PowerShell as Administrator and run:
wsl --install
  • This command installs WSL along with the latest version of Ubuntu automatically.

2. Restart Your Computer

  • Once WSL installation completes, you’ll be prompted to restart your computer.
    Restart to apply the changes and complete WSL setup.

3. Complete Ubuntu Setup

  • After restarting, search for Ubuntu in the Start menu and open it.

  • It will ask you to create a UNIX username and password — just follow the prompts.

4. Update Ubuntu Packages

  • Keeping your packages updated is essential. Run:
sudo apt update && sudo apt upgrade -y
  • This updates your Ubuntu system and upgrades all existing packages silently (without asking confirmation).

5. (Optional) Adjust cgroup Settings better Docker compatibility

  • For better Docker compatibility, you can tweak your cgroup settings:
  1. Open the GRUB configuration file:

     sudo nano /etc/default/grub
    
  2. Find the line starting with GRUB_CMDLINE_LINUX and change it to:

     GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=0"
    
  3. Save and exit (Ctrl + O → Enter → Ctrl + X).

  4. Update GRUB and reboot:

     sudo update-grub
     sudo reboot
    

Note: If you don’t find the line inside GRUB, don't worry — just close the file (Ctrl + X) without making changes.


🐳 Step 2: Install Docker and Docker Compose

  • Now let’s install Docker and Docker Compose inside Ubuntu (WSL).

1. Install Docker

  • Run the following command:
sudo apt install -y docker.io
  • This installs Docker without asking for any confirmation.

2. Install Docker Compose

  • Then install Docker Compose:
sudo apt install -y docker-compose
  • Docker Compose helps you manage multi-container Docker applications easily.

⚙️ Step 3: Install and Set Up Judge0

  • Judge0 is an open-source API that can compile and run code in multiple languages — perfect for coding platforms or automated evaluation systems.

1. Download and Extract Judge0

. Download the latest release:

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

. Then unzip it:

unzip judge0-v1.13.1.zip

2. Set Up Secure Passwords

  • Navigate to the extracted folder:
cd judge0-v1.13.1
  • Open the configuration file:
nano judge0.conf
  • Replace REDIS_PASSWORD and POSTGRES_PASSWORD values in judge0.conf with the generated passwords.

  • Save and exit (Ctrl + O → Enter → Ctrl + X).

3. Start Judge0 Services

  • Make sure you're inside the Judge0 folder:

      cd judge0-v1.13.1
    
  • Check if necessary files are present:

ls
  • If you see two main files/folders, it’s perfect.

4. Start the DB and Redis services:

  • Navigate to the Judge0 folder:

      cd judge0-v1.13.1
    
  • Start the database and Redis services:

sudo docker-compose up -d db redis
  • Wait a few seconds:
sleep 10s
  • Now start the remaining services:
docker-compose up -d
  • Wait a few more seconds:
sleep 5s

5. Verify the Installation

Open your browser and visit:

http://localhost:2358/docs
  • You should see the Judge0 API documentation page. 🎉

  • That means your Judge0 instance is running perfectly!


4. To stop the judge0

  1. get running container ID's

     docker ps -a
    
    • it will give some result like below
    root@root:~/leetlab/judge0-v1.13.1$ docker ps
    CONTAINER ID   IMAGE                  COMMAND                  CREATED          STATUS          PORTS                                       NAMES
    20f5666940cf   judge0/judge0:1.13.1   "/api/docker-entrypo…"   31 minutes ago   Up 30 minutes   2358/tcp                                    judge0-v1131_workers_1
    6564759cb244   judge0/judge0:1.13.1   "/api/docker-entrypo…"   31 minutes ago   Up 30 minutes   0.0.0.0:2358->2358/tcp, :::2358->2358/tcp   judge0-v1131_server_1
    085b059c5e77   postgres:16.2          "docker-entrypoint.s…"   48 minutes ago   Up 48 minutes   5432/tcp                                    judge0-v1131_db_1
    de2553f708ad   redis:7.2.4            "docker-entrypoint.s…"   48 minutes ago   Up 48 minutes   6379/tcp                                    judge0-v1131_redis_1
  1. run stop cmd to stop the container

     docker stop 20f5666940cf 6564759cb244 085b059c5e77 de2553f708ad
    
  2. To restart the jude0

    • make sure you are correct directory

    • Navigate to the Judge0 folder:

        cd judge0-v1.13.1
      
  • start the redis db
    docker-compose up -d db redis
  • start the judge0
    docker-compose up -d
  • Open your browser and visit:
    http://localhost:2358/docs

You should see the Judge0 API documentation page, meaning your Judge0 instance is running successfully!🎉

1
Subscribe to my newsletter

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

Written by

Vikram Kumar
Vikram Kumar

Hi, I'm Vikram Kumar, a passionate frontend developer and coding enthusiast. 🚀 I'm currently exploring web development, full-stack technologies, and building real-world projects. I love solving problems, learning new skills, and sharing knowledge with the tech community. I'm focused on growing as a developer every day and aim to create solutions that make a real impact. In my free time, you’ll find me building projects, solving DSA problems, and staying updated with the latest tech trends! 🌟