Crun: A Fast, Low-Memory OCI Runtime for Linux Containers
Crun is a fast, low-memory OCI container runtime written in C and also usable as a library. This guide explains how crun compares with runc, how to install and run it, and when its library mode, cgroup support, CRIU and WASI features matter. We also cover the published benchmark, the 512 KB memory example, and the cases where runc remains the safer default.
View 2 referencesAllow the functional cookie to save your likes. Privacy details
What is crun?
Crun is a fast, low-memory-footprint OCI container runtime written entirely in C. It conforms to the Open Container Initiative runtime specification, so it can execute the same container bundles as other compliant runtimes while using less memory and starting containers faster.
The official crun repository describes it as a fully featured OCI runtime and C library. It is a low-level execution component, not a container platform: you still need an engine such as Podman, CRI-O, or containerd to build images and manage containers, with crun doing the actual process launch.
Why is crun written in C instead of Go?
Crun's author argues that C is a better fit than Go for a low-level tool such as a container runtime. The README points out that runc, the most widely used OCI implementation, is written in Go yet re-executes itself and uses a C module to set up the environment before the container process starts.
Writing the runtime in C removes that split and allows a smaller binary with fewer runtime dependencies. The tradeoff is a C build toolchain and system libraries at compile time, rather than the simpler distribution story of a single Go binary.
How much faster is crun than runc?
The crun README publishes a simple benchmark: running 100 containers that each execute /bin/true sequentially took 0:01.69 with crun versus 0:03.34 with runc, a 49.4% reduction in elapsed time. The author reports the measurement from his own machine, so it is a directional result rather than a controlled comparison.
The practical consequence is greatest where containers are short-lived and numerous — CI jobs that spawn many ephemeral containers, or dense Kubernetes nodes. For a single long-running container, startup time is a much smaller share of total cost.
Can crun run with tighter memory limits?
Yes. The README demonstrates a Podman command with a 4 MB memory limit: runc fails with an OCI runtime error, while crun at 512 KB prints "it works". This illustrates the lower memory footprint claimed for crun rather than a guaranteed limit for every workload.
The example is useful because it shows where the difference shows up in practice: constrained devices and high-density hosts where the runtime's own overhead competes with the workload. Always test your actual image and limits instead of relying on a synthetic echo command.
What does it mean that crun is also a library?
Crun is designed to be included as a C library, so programs can manage OCI containers directly without launching an external process. This is the feature that distinguishes it from runtimes that only expose a command-line interface, and it is the one that most changes how you would design a tool around it.
For tool builders, that means container lifecycle operations can be embedded in orchestration software, edge agents, or custom runtimes. The cost is that you link against libcrun and take responsibility for its lifecycle, rather than shelling out to a stable CLI contract.
How do you install and run crun?
Crun is packaged by major distributions, so installation is usually a package manager command rather than a source build. On Fedora use sudo dnf install crun, on Ubuntu or Debian use sudo apt-get install crun, and on Alpine use apk add crun.
Once installed, you can run a container bundle directly or select crun as the runtime in Podman:
podman --runtime /usr/bin/crun run -it fedora /bin/bash
To list running containers, use crun list. Building from source follows the standard autotools flow of ./autogen.sh, ./configure, make, and sudo make install.
When should you choose crun over runc?
Choose crun when startup latency, memory footprint, or library-style embedding matters more than maximum ecosystem familiarity. It is a strong fit for resource-constrained hosts, CI systems with many short-lived containers, and tooling that needs programmatic control over OCI containers. That combination is the main reason teams replace runc with it.
Keep runc when you want the reference implementation and the broadest compatibility with existing OCI tooling and documentation. Crun is Linux-only and is a runtime rather than a full container platform. It is also a better fit when workloads are short-lived and numerous, and it does not provide scheduling, image management, or cluster orchestration by itself.
Frequently asked questions about crun
These answers cover the questions that come up when choosing a low-level runtime: compatibility with runc, WebAssembly support, how Kubernetes reaches crun, and where to get verified binaries. They keep the scope clear, since a runtime answers different questions from a container platform.
Is crun a drop-in replacement for runc?
For most OCI workflows yes: both implement the OCI runtime specification and can be selected through Podman or CRI-O configuration. The main differences are implementation language, resource use, and crun's ability to be linked as a library, not the container format.
Does crun support WebAssembly containers?
Crun includes handlers for WebAssembly workloads, allowing Wasm images to run through an OCI-compatible flow with runtimes such as WasmEdge or Wasmtime. This is an advanced feature that needs the right image preparation and host support, so verify it in your environment before adopting it.
Is crun used by Kubernetes?
Crun can serve as the OCI runtime underneath a Kubernetes container runtime interface, commonly through CRI-O or containerd. Kubernetes does not call crun directly; you configure the lower-level runtime in the node's container engine.
Where can I find the source and release artifacts?
The source, documentation, and signed release artifacts are in the containers/crun repository on GitHub. The project is open source under the GPL-2.0 license.