Setting Up Ubuntu and Judge0 on Windows: A Complete Guide for Developers ๐ฅ๏ธ๐


Prerequisites โ๏ธ
Before we dive into the installation steps, I request you to install warp terminal => link Trust me, youโll thank me later.
- ๐ง Why install Warp?
With Warp, you can debug your errors directly inside the terminal, improving your development workflow!
1. Installing Ubuntu on Windows with WSL ๐ง๐ป
To begin, youโll need to install Ubuntu on your Windows machine using Windows Subsystem for Linux (WSL).
Enable WSL
Open PowerShell as Administrator and run
Run this command
wsl --install
This command will install WSL along with the default Ubuntu distribution.
After installation, restart your system to complete the setup.
Set Up Ubuntu
Open the Ubuntu terminal from the Start menu and follow the prompts to create a UNIX username and password.
Update Ubuntu
Once Ubuntu is set up. update all the installed packages by running the following commands :
sudo apt update
upgrade the installed packages:
sudo apt upgrade -y
Now, Youโre all set to start working on Ubuntu within Windows! ๐
Now that Ubuntu is up and running, letโs move on to installing Docker and Docker Compose to manage containers efficiently.
2. Installing Docker and Docker Compose ๐ณ๐ฆ
Make sure you are in the ubantu terminal
Install Docker
After updating, run this command to install Docker:
sudo apt install -y docker.io
Install Docker Compose
Once Docker is installed, run the following command to install Docker Compose:
sudo apt install -y docker-compose
Docker and Docker Compose are now ready for use on your Ubuntu environment! ๐
3. Installing Judge0 on Your Local Server โ๏ธ๐ก
Letโs install Judge0, a powerful online code execution API, on your local machine. Follow these steps carefully.
Download Judge0
First, run the following command to download the Judge0 release archive:
wget https://github.com/judge0/judge0/releases/download/v1.13.1/judge0-v1.13.1.zip
Extract Judge0
After the download is complete, run the following command to unzip the archive:
unzip judge0-v1.13.1.zip
NOTE => you will get an error here, so firstly you have to install unzip in your terminal. In such situations, warp terminal makes your life easy
Set Up Secure Passwords
Visit random.org password generator and copy two random passwords.
Open the
.env
configuration file by running:nano judge0-v1.13.1/.env
Update password with the generated passwords, you will find these fields when you scroll down
REDIS_PASSWORD
POSTGRES_PASSWORD
Save the file and exit => follow the instruction on there
Start Judge0 Services
Navigate to the Judge0 folder where you downloaded and extracted the files:
cd judge0-v1.13.1
Now all the things will take place in this directory itself
Start the database and Redis services by running:
docker-compose up -d db redis
Wait for a few seconds:
sleep 10s
start the remaining services:
docker-compose up -d
Wait for a few more seconds:
sleep 5s
Judge0 should now be up and running on your local server! ๐ฏ
4. Verifying the Installation โ ๐
To make sure everything is set up correctly, follow these steps:
Check Judge0 API Docs
Open your browser and go to:
http://localhost:2358/docs
You should see the Judge0 API documentation page. This confirms that the installation was successful
If you go to dummy client then a dummy client will appear, you can play in here
Make sure the server is running when you are using this, How to make sure this works
- simple in the warp terminal , ask to check for judge0 server running in your system
sudo docker ps | grep judge0
Connect with Me ๐
Feel free to reach out or follow me on my social media platforms:
Subscribe to my newsletter
Read articles from Gaurav Kumar Maurya directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
