Overview
Discover what makes Judge0 CE powerful
Judge0 CE is a **self‑hostable, high‑performance code execution engine** that exposes a RESTful API for compiling and running source code in over 60 languages. The system is designed to be lightweight yet scalable, making it ideal for embedding into competitive‑programming platforms, e‑learning tools, AI‑powered code assistants, or any service that requires on‑demand execution of arbitrary user code. The core service runs in a sandboxed environment, leveraging operating‑system isolation (e.g., Docker or systemd-nspawn) to enforce strict resource limits and prevent malicious code from affecting the host.
API Gateway
Worker Daemon
Message Queue
Result Store
Overview
Judge0 CE is a self‑hostable, high‑performance code execution engine that exposes a RESTful API for compiling and running source code in over 60 languages. The system is designed to be lightweight yet scalable, making it ideal for embedding into competitive‑programming platforms, e‑learning tools, AI‑powered code assistants, or any service that requires on‑demand execution of arbitrary user code. The core service runs in a sandboxed environment, leveraging operating‑system isolation (e.g., Docker or systemd-nspawn) to enforce strict resource limits and prevent malicious code from affecting the host.
Architecture
The stack follows a modular micro‑service pattern:
- API Gateway (
judge0-api): A FastAPI application written in Python 3.10 that validates requests, forwards them to the worker pool, and streams results back to clients. It also serves the comprehensive Swagger/OpenAPI docs hosted at/docs. - Worker Daemon (
judge0-worker): A Rust‑based engine responsible for creating isolated containers, compiling source files with language‑specific compilers (GCC, Clang, Rustc, etc.), and executing binaries under cgroups‑based CPU/memory limits. The use of Rust ensures low overhead and high reliability during concurrent executions. - Message Queue (
RabbitMQ): Acts as a broker between the API and workers, guaranteeing at‑least‑once delivery of execution jobs. Workers poll the queue, process tasks, and push results back to a Redis cache. - Result Store (
Redis): Stores execution metadata (stdout, stderr, exit code, timing) for quick retrieval via the API. Results are kept in memory for a configurable TTL (default 5 min) before purging. - Database (
PostgreSQL): Persists audit logs, user profiles, and language metadata. This allows for fine‑grained analytics and optional persistence of long‑running job histories.
The system is container‑first: each execution runs inside a dedicated Docker image built from a minimal base (alpine) with only the required compiler binaries, ensuring fast startup times and minimal surface area for security exploits.
Core Capabilities
- Language Support: 60+ languages including C, C++, Java, Python, Go, Rust, Node.js, Ruby, and many niche compilers.
- Multi‑file Execution: Upload arbitrary archives (
.zip,.tar.gz) to compile projects with multiple source files. - Custom Flags: Pass compiler options, command‑line arguments, and runtime parameters via JSON payloads.
- Resource Constraints: Enforce per‑execution CPU time, memory usage, and wall‑clock limits; sandboxed processes are terminated if they exceed thresholds.
- Webhooks: Register HTTP callbacks that fire upon job completion, enabling real‑time integrations with CI/CD pipelines or chatbots.
- Verbose Output: Detailed JSON responses containing
stdout,stderr, compilation logs, exit status, and resource usage statistics. - Extensible Language Registry: Add new compilers by extending the language definition JSON; no code changes required for the API layer.
Deployment & Infrastructure
Judge0 CE can be deployed on any Linux host with Docker support. The provided docker-compose.yml orchestrates all services (API, worker, RabbitMQ, Redis, PostgreSQL) in a single network. For production environments:
- Horizontal Scaling: Spin up multiple worker containers behind the same RabbitMQ queue to handle high request throughput.
- High Availability: Use a Kubernetes cluster; deploy each component as a Deployment/StatefulSet with persistent volumes for Redis and PostgreSQL.
- CI/CD: The project ships a GitHub Actions workflow that builds the Rust worker binary, pushes Docker images to GHCR, and deploys to a target cluster.
- Resource Allocation: The worker’s container limits can be tuned per language to match typical runtime characteristics (e.g., allocate more CPU for Go, less for Python).
Integration & Extensibility
- SDKs: Official SDKs in Python, JavaScript (Node), and Go simplify client integration; they wrap the REST API with retry logic and type safety.
- Webhook API: Exposes
POST /webhooksto register callbacks; supports filtering by language or status. - Plugin System: Developers can write custom middleware in the API layer (FastAPI) to add authentication, rate‑limiting, or custom logging without modifying the core.
- Language Registry: The
languages.jsonfile can be overridden at runtime via environment variables, allowing on‑the‑fly addition of new compilers or modification of flags.
Developer Experience
- Documentation: The OpenAPI spec is auto‑generated and hosted at
/docs; the developer portal contains example payloads, error codes, and best‑practice guidelines. - Community: Active GitHub discussions, a dedicated Slack channel, and a contributor guide lower the barrier to entry for new contributors.
- Testing: A comprehensive test suite (unit, integration) runs against the Docker stack; CI verifies that new language definitions do not break existing behavior.
- Licensing: MIT license ensures unrestricted use, modification, and redistribution—critical for enterprise deployments.
Use Cases
| Scenario | Why Judge0 CE fits |
|---|---|
| Competitive Programming Platform | Fast, deterministic execution with strict resource limits; supports multi‑file projects. |
| ** |
Open SourceReady to get started?
Join the community and start self-hosting Judge0 CE today
Related Apps in development-tools
Hoppscotch
Fast, lightweight API development tool
code-server
Self-hosted development-tools
AppFlowy
AI-powered workspace for notes, projects, and wikis
Appwrite
All-in-one backend platform for modern apps
PocketBase
Lightweight Go backend in a single file
Gitea
Fast, lightweight self-hosted Git platform
Weekly Views
Repository Health
Information
Explore More Apps
Node-RED
Low‑code event‑driven programming for real‑time data
HomeServerHQ
All‑in‑one home server, secure and simple
phpList
Open Source Email Marketing & Newsletter Management Platform
Zoraxy
Your Home Lab Reverse Proxy & Network Toolbox
OpenEMR
Free, open‑source medical records and practice management
Passbolt
Secure, collaborative password manager for teams
