Create Your Own LeetCode with Judge0

Setting up Judge0 for Windows and Mac users to build your own coding platform

C

Codestruk

3 min read

deploy your own leetcode
On this page

💻 Create Your Own LeetCode with Judge🔥

What is Judge0?

Judge0 is an open-source online code execution engine that supports over 60 programming languages. It allows you to compile and run code remotely via a REST API, making it perfect for building coding platforms, online judges, or interview preparation tools like LeetCode, HackerRank, or Codeforces. Whether you're running C++, Python, JavaScript, or Go — Judge0 handles it all in a secure, sandboxed environment.

How to Setup Judge0?

I recommend using Linux especially Ubuntu-20.04, but you can also setup this on Mac.

For Windows Users Special Steps

Install WSL in your Windows, run this command in your PowerShell terminal:

Installing WSL

Bash
wsl --install

Then setup your Unix username and password. After this restart your PC then run this command to install Ubuntu-20.04:

Bash
wsl --install -d Ubuntu-20.04

Then login to Ubuntu with this command:

Bash
wsl -d Ubuntu-20.04

Your terminal will change like this:

WSL Terminal


Then run command:

Bash
sudo apt update
# Enter the password which you set in the Unix login

After this:

Bash
sudo apt upgrade
sudo reboot

After rebooting the Ubuntu it will be closed so then restart with:

Bash
wsl -d Ubuntu-20.04

Then again it will be like this:

WSL Terminal After Reboot


Then run again:

Bash
sudo apt update
# Enter the password

Then open the grub file in nano with command:

✅ Fixing GRUB Syntax Error in Ubuntu

🔧 Step 1: Open the GRUB config file

Bash
sudo nano /etc/default/grub

It'll ask for your password — type it and press Enter.

🧾 Step 2: Paste the following into the file

Note: (if you have empty grub file then do this if not paste only last line):

Bash
GRUB_DEFAULT=0
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=systemd.unified_cgroup_hierarchy=0

Use Ctrl + Shift + V to paste (if you're on a standard terminal).

Make sure there are no extra characters or spaces after any line.

💾 Step 3: Save and Exit

Press Ctrl + O (to write/save the file)

Press Enter (to confirm)

Press Ctrl + X (to exit the editor)

🔄 Step 4: Update GRUB

Bash
sudo update-grub

📋 If a popup appears, select the 2nd option (usually your system disk), then press OK. If no popup, it will just update silently — that's fine too.

✅ Step 5: Reconfigure and clean up

Run this to finish up:

Bash
sudo dpkg --configure -a
sudo apt install -f

This should fix the broken grub-pc and grub-gfxpayload-lists issues.

After this everything is on Judge0 GitHub documentation link: https://github.com/judge0/judge0/blob/master/CHANGELOG.md

But here's simple steps to do it:

Download Docker and Docker-compose with this command:

Bash
sudo apt install docker
# This will install Docker
sudo apt install docker-compose
# This will install Docker-compose

Getting Judge0 File

Note: Mac users can follow this from here

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

Installing Unzip

Bash
sudo apt install unzip
# This will install unzip

Unzip the Judge0 file

Bash
unzip judge0-v1.13.1.zip

Setting Up Password

Then go to Judge0 file with cd command:

Bash
cd judge0-v1.13.1/
ls
# ls will show you these files docker-compose.yml judge0.conf

Then set the REDIS_PASSWORD and POSTGRES_PASSWORD and judge0.conf of your choice.

I recommend using this website to generate passwords.

Bash
sudo nano judge0.conf
# Then set the password

Press Ctrl + O (to write/save the file)

Press Enter (to confirm)

Press Ctrl + X (to exit the editor)

Running DB and Docker

After lets run db and redis this will take time:

Bash
sudo docker-compose up -d db redis
sleep 10s
sudo docker-compose up -d
sleep 5s

Then check if containers are running or not with command:

Bash
sudo docker-compose ps
# It will show the four status are up
Docker Containers Status


Then go to http://localhost:2358/docs if it's open your setup done and you can go to http://localhost:2358/dummy-client.html to run the code.

For Restarting the Program

If you want to start the setup just run these command in Windows terminal:

Bash
# Mac and Linux users skip WSL command
wsl -d Ubuntu-20.04
sudo docker-compose up -d
# It will run everything again






🎯 Conclusion

Now you have your own Judge0 setup running locally! You can build your own coding platform, create online judges, or develop interview preparation tools. The Judge0 API gives you the power to execute code in over 60 programming languages securely.

Happy coding! 🚀

#leetcode#judge0#dsa#dev

Last updated

Building something similar?

Talk to our team about your SaaS, web or mobile product. We reply within one business day.

Get a free consultation
CHATCALL