How to Install Judge0 on WSL and Linux – Step-by-Step Guide for Developers


Judge0 is robust, scalable, and open-source code execution platform. Which enable us to create large and scalable softwares for competetive-programming, online IDEs,, online code editors, programming assessments, etc.
It contains support for 60+ languages.
Installating judge0
We are going to install judge0-v1.13.1
on our PCs.
System Requirements
Judge0 has been tested only for linux platforms that’s why there is no official support for installations in other platforms.
Note:- We are going to see how to install judge0
in Windows and Linux.
Prerequisites
A Laptop or desktop PC with Wndows or Linux .
A stable internet connection.
With the above prequisites lets proceed for the installation
Preinstallations
Windows WSL
For installation of WSL we need to enable some features in out windows machine.
Enabling WSL and Virtual Machine platform'
Press
🪟 + r
and type optionalfeatures.exe click onOK
.Allow for permission.
Mark check for enabling
Virtual Machine Platform
andWindows Subsystem For Linux
and press ok.Wait for checking requirements.
Click on restart.
Installing wsl
Open powershell.
Install wsl package
wsl.exe --install
- Check installation using
wsl -v # or wsl --version
- Install Ubuntu
# wsl --install <Distro_name>
wsl --install # it will install latest version of Ubuntu 24.04 as a default
- Using ubuntu using WSL
wsl -d Ubuntu # For using any other distro of linux replace Ubuntu with the Name of Distribution
Ubuntu (Linux platform)
- Use
sudo
to open file/etc/default/grub
sudo nano /etc/default/grub
- Add
systemd.unified_cgroup_hierarchy=0
in the value ofGRUB_CMDLINE_LINUX
variable.
GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=0"
If the line already contains other parameters, ensure you add this parameter within the quotes, separated by a space. For instance:
GRUB_CMDLINE_LINUX="quiet splash systemd.unified_cgroup_hierarchy=0"
- Apply the changes:
sudo update-grub
- Restart your server:
sudo reboot
Common Installation
Step 1: Open Linux CLI
Step 2: Update your System
sudo apt update -y && sudo apt upgrade -y
Step 3: Download Docker
and Docker Compose
(Skip If you have already installed)
sudo apt install docker.io && sudo apt install docker-compose
Step 4: Install unzip
Package
sudo apt install unzip
Step 5: Download the judge0’s release archive
wget https://github.com/judge0/judge0/releases/download/v1.13.1/judge0-v1.13.1.zip
Step 6: Extract the judge0’s release archive
unzip judge0-v1.13.1.zip
Step 7: Go into judge0-v1.13.1
extracted folder
cd judge0-v1.13.1
Step 8: Update the variable REDIS_PASSWORD
in the judge0.conf
file.
nano judge0.conf
Instead of YourPassword use generated password for both REDIS_PASSWORD
and POSTGRES_PASSWORD
.
Passwords can be different(prefer) or same
Write and Save
press ctrl + o and save as same name
To come out the file :
press ctrl + x
‼️Do not modify
docker-compose.yml
, modify it only if you know what are you doing 💀.
Step 9: Run these commands to initialize redis
and postgres
:
docker-compose up -d db redis # use sudo for smooth experience
wait for initialization of redis
and postgres
.
Step 10: Run these commands to initialize workers
and server
:
docker-compose up -d # use sudo for smooth experience
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
don’t worry your installation is working if you are getting empty white-page.
Helping links:
Judge0 Dummy Client Page - go to directory ‘/dummy-client.html’
you can try here dummy code executions
Judge0 Languages Page - go to directory ‘/languages’
Judge0 Documentation Page - go to directory ‘/docs’
From WSL to Docker-Desktop (for windows users)
From the Docker menu, select Settings > General
Make sure that ‘Use the WSL 2 based engine’ is selected
Then go to Settings > Resources > WSL Integration in Docker Desktop and enable Ubuntu.
Now you can see containers running in the
docker-desktop
.
Message: 'No such file or directory @ rb_sysopen - /box/script.js',
This may or may not work for your operating system due to some architecture issues over operating system or machines
Step 1 : Go to ~/.docker/desktop/settings-store.json
cd ~/.docker/desktop/settings-store.json # not use settings.json
Step 2: Append “DeprecatedCgroupv1”: true
in settings-store.json file or not use settings.json
{
“DeprecatedCgroupv1”: true
}
Step 3: Restart docker
How to re run the judge0 container?
Step 1: Open the judge0 folder with files (docker-compose.yml
and Jude0.conf
).
Step2: Open the terminal and use
docker-compose up -d
References
Suggestion
- If you are somehow failed to install/config judge 0 try reinstalling from start.
Subscribe to my newsletter
Read articles from Sagar Kumar Jha directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
