Installing Judge0 in MacOS(Silicon)

Karan ChoudharyKaran Choudhary
3 min read

In this blog, we will guide you through the process of installing and running a local instance of Judge0 on MacOS (Silicon).

Also, we will talk about troubleshooting its Errors(for MacOS, Silicon)

Prerequisites: Docker Desktop Application should be installed

Step 1: Access the Judge0 GitHub Page

Visit the Judge0 Official GitHub page to get started.

Step 2: Install wget via Homebrew

Ensure you have wget installed. You can install it using Homebrew.

brew install wget

Step 3: Download and Unzip Judge0

Run the following command to download and unzip Judge0:

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

Step 4: Navigate to the Judge0 Directory

Navigate to the judge0-v1.13.1 directory:

cd judge0-v1.13.1
ls

Step 5: Edit the Configuration File

Open the judge0.conf file using your preferred text editor. You can use code for VS Code or nano if code doesn’t work:

code judge0.conf

OR

nano judge0.conf

Step 6: Generate and Set Passwords

Visit this website to generate random passwords. Generate two passwords for REDIS and POSTGRES.

  1. Update the REDIS_PASSWORD variable in the judge0.conf file with the generated password.

  2. Update the POSTGRES_PASSWORD variable in the judge0.conf file with the generated password.

Step 7: Start the Judge0 Container

Run these commands to start the Judge0 container:

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

Troubleshooting

'No such file or directory @ rb_sysopen - /box/script.js'

Step 1: Open Docker Settings
In the terminal, run the command to open the Docker settings.

code ~/Library/Group\ Containers/group.com.docker/settings-store.json

It will look like this :

{
  "AutoStart": false,
  "DiskSizeMiB": 262144,
  "DisplayedOnboarding": true,
  "DockerAppLaunchPath": "/Applications/Docker.app",
  "EnableCLIHints": true,
  "EnableDockerAI": false,
  "LicenseTermsVersion": 2,
  "MemoryMiB": 12288,
  "SettingsVersion": 42,
  "ShowInstallScreen": false,
  "SwapMiB": 2048,
  "UpdateInstallTime": 0,
  "UseContainerdSnapshotter": false
}

Step 2: Modify the JSON Object

Add "DeprecatedCgroupv1": true, to the JSON object in the settings.

"DeprecatedCgroupv1": true,

Step 3: Save Changes

Save the changes you made to the settings.

Step 4: Verify Settings

Check the settings again by running the command to ensure it contains "DeprecatedCgroupv1": true,.

code ~/Library/Group\ Containers/group.com.docker/settings-store.json

It should contain "DeprecatedCgroupv1": true,:

{
  "AutoStart": false,
  "DeprecatedCgroupv1": true,
  "DiskSizeMiB": 262144,
  "DisplayedOnboarding": true,
  "DockerAppLaunchPath": "/Applications/Docker.app",
  "EnableCLIHints": true,
  "EnableDockerAI": false,
  "LicenseTermsVersion": 2,
  "MemoryMiB": 12288,
  "SettingsVersion": 42,
  "ShowInstallScreen": false,
  "SwapMiB": 2048,
  "UpdateInstallTime": 0,
  "UseContainerdSnapshotter": false
}

Step 5: Stop the Judge0 Container

Stop the running Judge0 container.

cd judge0-v1.13.1
docker-compose down

Step 6: Restart Docker Desktop

Quit Docker Desktop and restart it after 10 seconds.

Step 7: Re-run the Docker Container

Start the Docker container again to apply the changes.

docker-compose up -d
0
Subscribe to my newsletter

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

Written by

Karan Choudhary
Karan Choudhary