Skip to main content
The Linux kernel manages hardware resources, orchestrates processes, and provides the foundational services that all Linux-based software depends on. Whether you’re building kernel modules, writing device drivers, tuning a production system, or contributing patches upstream, this documentation covers what you need.

Build the Kernel

Compile and boot your first custom kernel from source

Contribute a Patch

Learn the patch submission process and community guidelines

Kernel Internals

Explore memory management, scheduling, networking, and filesystems

Driver Development

Write device drivers using the kernel’s device model and APIs

Who are you?

New Kernel Developer

Start with coding style, patch workflow, and development tools

System Administrator

Configure kernel parameters, sysctl tuning, and module management

Security Researcher

Explore LSMs, seccomp, and kernel self-protection features

Hardware Vendor

Integrate new hardware with the driver model and bus frameworks

Quick start

1

Get the source

Clone the Linux kernel repository from the official mirror:
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux
2

Install build dependencies

Install the required tools for your distribution:
# Debian/Ubuntu
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev

# Fedora/RHEL
sudo dnf install gcc make ncurses-devel bison flex openssl-devel elfutils-libelf-devel
3

Configure and build

Use your current running kernel’s config as a starting point:
cp /boot/config-$(uname -r) .config
make olddefconfig
make -j$(nproc)
4

Install and reboot

sudo make modules_install
sudo make install
sudo reboot

Explore the API

Memory Allocation

kmalloc, vmalloc, and the slab allocator APIs

Locking Primitives

Spinlocks, mutexes, RW semaphores, and lockdep

Workqueue API

Deferred and concurrent work execution in the kernel

RCU Mechanism

Read-Copy-Update for high-performance concurrent access
The Linux kernel is licensed under GPLv2. All contributions must comply with the Developer Certificate of Origin (DCO). See the contributing guide for details.

Build docs developers (and LLMs) love