checkpoint-restore/criu
FreeCheckpoint/Restore tool
FreeFree tier
About checkpoint-restore/criu
CRIU (Checkpoint and Restore in Userspace) is an open-source utility for checkpointing and restoring Linux tasks entirely in userspace. It allows freezing a running application or part of it, saving its state to a collection of files, and later restoring it to continue execution from the exact point it was frozen. CRIU is feature-rich and often used for live migration of containers, especially with Docker, LXC/LXD, and OpenVZ. It also provides standalone libraries: libcompel for parasite code injection and libsoccr for TCP connection checkpoint-restore, as well as a Go-based live migration library (go-criu/phail).
Key Features
Checkpoint and restore running Linux processes to/from files
Primarily implemented in userspace with minimal kernel dependencies
Supports live migration of containers via the phaul Go library
Includes libcompel for parasite code injection into running processes
Includes libsoccr for checkpointing and restoring TCP connections
Integrated with container runtimes like Docker, LXC/LXD, and OpenVZ
Comprehensive documentation and troubleshooting guides available
Pros & Cons
Pros
- Feature-rich and up-to-date with the Linux kernel
- Mainly user-space implementation reduces kernel modification needs
- Actively maintained with a large community and wide distribution
- Proven integration with major container platforms
- Provides standalone libraries for parasite code injection and TCP state saving
Cons
- Must constantly keep up with Linux kernel changes, making maintenance challenging
- Setup and troubleshooting can be complex for beginners
- May not support every kernel feature or exotic hardware state
Best For
Live migration of Linux containers (Docker, LXC, OpenVZ)Debugging and reproducing application statesDisaster recovery and snapshotting long-running processesCheckpointing scientific computations or simulations for later resumptionTesting system behavior by restoring known process states
FAQ
What does CRIU stand for?
CRIU stands for Checkpoint and Restore in Userspace.
How does CRIU work without kernel modules?
CRIU is primarily implemented in userspace and uses techniques like parasite code injection to collect process state, minimizing the need for kernel modifications.
Which container platforms use CRIU?
CRIU is integrated into Docker, LXC/LXD, and OpenVZ for live migration features.
Does CRIU support live migration?
Yes, true live migration is possible using the phaul sub-project, which provides a Go library to handle the complexity.