Docker System has not been booted with systemd as init system
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Docker is a popular platform for developing, shipping, and running applications in containers, which are isolated environments that package application code and dependencies. One challenge that many developers face when using Docker on certain systems is the error message: "Docker System has not been booted with systemd as init system." This article delves into the intricacies of this issue, providing an in-depth explanation, examples, and potential solutions.
Understanding the Issue
Systemd is an init system used by many Linux distributions for system and service management. It is responsible for booting the system by initializing all necessary services. Docker, by default, expects the init system to be systemd. However, not all Linux distributions or environments use systemd, leading to compatibility issues.
Key Concepts
- Init System: Essentially, it's the first process started by the kernel during booting. Its main role is to start and manage system services.
- Systemd: A popular init system that provides a standard process for controlling what programs run when a Linux system boots up.
- Docker Daemon: The background process that manages Docker containers and services.
Technical Explanation
When Docker is installed, it expects the machine to boot using systemd. It relies on systemd for service management tasks, such as managing cgroups, which are necessary for container isolation. If the operating system has been configured to use a different init system, Docker may not start correctly.
Alternative Init Systems
- SysVinit: A traditional init system used in older Linux distributions.
- OpenRC: A dependency-based init system used in some Linux distributions like Gentoo.
- Upstart: An event-based init system developed by Canonical for Ubuntu.
Example Error Scenario
Consider a Linux distribution that uses OpenRC instead of Systemd. When attempting to start Docker, the user might encounter an error message:
- Systemd and Cgroups: Understanding that systemd manages cgroups effectively is crucial. Docker leverages cgroups to control and limit the resources containers can use.
- Container Isolation: The primary role of Docker is to isolate application environments, which is crucial for security, dependency management, and scalability.
- Community Solutions: The open-source community often shares patches or modifications for specific distributions, offering creative ways around this issue.
Related reading
- Docker unable to access jar file
- Docker Uses an image, skipping docker-compose
- Docker volume rename or copy operation
- Docker WARNING Published ports are discarded when using host network mode
- Docker with --network host does not allow to access to port of application
- docker.errors.DockerException Error while fetching server API version
- Docker, what is it and what is the purpose
- Docker/Boot2Docker Set HTTP/HTTPS proxies for docker on OS X

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.