A runlevel is a predefined operating state of a UNIX or Linux system that determines what services and processes are available after boot.

What Is Runlevel?
A runlevel is a concept in UNIX and Linux operating systems that defines a specific state of the machine by determining which processes, services, and system resources are active. It acts as a framework for controlling the startup and shutdown of the system, allowing administrators to manage the environment according to operational needs. Each runlevel corresponds to a particular mode, such as system maintenance, text-based multi-user operation, or full graphical interface availability.
When the system boots, it enters a default runlevel defined in its configuration, and the init process ensures that the correct set of services is started or stopped based on that level. By changing the runlevel, administrators can quickly adapt the system to different tasks, such as troubleshooting in single-user mode, running without networking for security, or enabling full networked and graphical services for regular use. This mechanism provides a standardized and efficient way of managing the systemโs behavior without requiring manual intervention for each individual service.
Different Linux Runlevels
Hereโs a structured table of the traditional Linux SysV runlevels and their purposes:
| Runlevel | Description | Typical use case | 
| 0 | Halt (shutdown) | Powers off the system safely. | 
| 1 | Single-user mode | Maintenance or emergency mode with root access only, no networking. | 
| 2 | Multi-user mode without networking | Provides multiple user logins but disables network services (varies by distribution). | 
| 3 | Full multi-user mode with networking | Standard text-based, non-graphical mode with all services and networking enabled. | 
| 4 | Undefined / user-definable | Rarely used; available for custom configuration. | 
| 5 | Multi-user mode with networking and GUI | Boots into graphical desktop environment with full networking. | 
| 6 | Reboot | Restarts the system safely. | 
What Is Runlevel Used For?
Runlevels are used to control the operational state of a Linux or UNIX system by defining which services, processes, and system resources should be active at any given time. They allow administrators to manage the systemโs behavior during startup, shutdown, or transitions between different modes of operation.
For example, a system can be placed into single-user mode for troubleshooting, switched to multi-user mode for normal server operations, or booted into a graphical interface for desktop use. By setting or changing the runlevel, administrators can quickly enable or disable groups of services, conserve system resources, perform maintenance tasks, or ensure the machine runs in the most appropriate configuration for its intended role. This structured approach helps maintain consistency, security, and efficiency across different environments.
How to Check Runlevel?
You can check the current runlevel on a Linux system by using commands that report the systemโs operational state. On traditional SysVinit systems, the runlevel command displays the previous and current runlevels, while the who -r command shows the current runlevel in more detail.
On modern systemd-based distributions, which replace runlevels with targets, the equivalent command is systemctl get-default to see the default target, and systemctl isolate <target> to switch to another. Additionally, systemctl list-units --type=target provides information about active targets, which map to runlevels such as multi-user.target or graphical.target.
How to Change Runlevel in Linux?

Changing the runlevel in Linux depends on whether the system uses the older SysVinit framework or the modern systemd init system.
SysVinit-Based Systems
The runlevel can be changed temporarily with the init or telinit command followed by the runlevel number. For example, running init 3 switches the system to multi-user mode without a graphical interface, while init 5 starts the graphical desktop environment. To make the change permanent, the default runlevel must be modified in the /etc/inittab file, where the system reads which runlevel to boot into by default.
Systemd-Based Systems
Runlevels are replaced with targets. To switch to another target temporarily, you use systemctl isolate <target>, such as systemctl isolate multi-user.target to enter text mode or systemctl isolate graphical.target to start the GUI. To change the default for future boots, you run systemctl set-default <target>, which updates the symbolic link for the default system target.
Why Is Runlevel Important?
Hereโs a list of reasons why runlevels are important in Linux and Unix systems:
- System control. Runlevels define which services and processes should run, giving administrators precise control over the systemโs operational state.
- Flexibility. They allow quick switching between different modes, such as single-user mode for maintenance or graphical mode for desktop use.
- Troubleshooting. Administrators can boot into minimal environments (like runlevel 1) to fix configuration errors or recover from failures.
- Resource management. By disabling unnecessary services in certain runlevels, the system can conserve CPU, memory, and power.
- Security. Lower runlevels can restrict access to users and services, useful when isolating the system during maintenance or suspected compromise.
- Consistency. They provide a standardized structure for system states across different Unix-like systems, simplifying administration.
- Automation. Scripts and configurations tied to runlevels streamline startup, shutdown, and transitions, reducing manual work.
Runlevel Issues
Hereโs an overview of common runlevel issues and why they matter:
- Misconfigured default runlevel. If the systemโs default runlevel (or systemd target) is set incorrectly, the machine may boot into an unwanted state, such as graphical mode on a server, or a non-networked mode on a workstation, leading to wasted resources or limited usability.
- Failure to load critical services. At a given runlevel, certain daemons are expected to start automatically. If configuration errors prevent them from launching, the system may lack networking, display services, or even essential login capabilities, leaving it partially or fully unusable.
- Inability to switch runlevels. Problems with init scripts or service dependencies can stop the system from changing modes dynamically. For example, switching from runlevel 3 (text-based multi-user) to runlevel 5 (graphical) may fail if the display manager is misconfigured or missing.
- Boot loops or crashes. An incorrect or broken runlevel configuration may cause the system to repeatedly attempt to load incompatible services, resulting in continuous reboots or kernel panics. This often happens when the default runlevel points to a mode requiring unavailable hardware or software.
- Inconsistent behavior across distributions. Not all Linux distributions treat runlevels the same way. For instance, some use runlevel 2 as the default multi-user mode, while others use runlevel 3 or 5. This can create confusion and misconfigurations when administrators work across multiple systems.
- Transition to systemd targets. Modern Linux systems have largely replaced runlevels with systemd targets. While they serve a similar purpose, the differences in terminology and commands can cause issues for administrators accustomed to SysVinit, leading to mistakes in service management and system recovery.
What Is the Difference Between Target and Runlevel?
Hereโs a comparison table that explains the difference between runlevels and targets in Linux:
| Aspect | Runlevel (SysVinit) | Target (systemd) | 
| Definition | A predefined numeric state (0โ6) that determines which services and processes start. | A named unit in systemd that groups services and defines the systemโs state. | 
| Format | Identified by numbers (e.g., runlevel 3 = multi-user without GUI). | Identified by descriptive names (e.g., multi-user.target, graphical.target). | 
| Configuration file | Controlled via /etc/inittab. | Managed with unit files under /etc/systemd/system/ and /lib/systemd/system/. | 
| Flexibility | Fixed states with limited customization (mostly 7 runlevels). | Highly flexible, allowing custom targets and dependencies. | 
| Default state | Set in /etc/inittab. | Set with systemctl set-default <target>. | 
| Change command | Changed temporarily with init <runlevel> or telinit <runlevel>. | Changed temporarily with systemctl isolate <target>. | 
| Extensibility | Not easily extensible; tied to legacy SysVinit. | Fully extensible; administrators can create new targets for specific needs. | 
| Current status check | Checked with runlevel or who -r. | Checked with systemctl get-default or systemctl list-units --type=target. |