Linux From Scratch: Build Your Own Linux System from Source Code

Linux From Scratch (LFS) provides step-by-step instructions for building a custom Linux system entirely from source code. The project includes subprojects like Beyond Linux From Scratch (BLFS) for extending the base system, Automated Linux From Scratch (ALFS) for automation, Multilib (MLFS) for 32-bit support, and Gaming (GLFS) for gaming software. Additional resources include Hints, Patches, and a Museum of old versions.

Linux From Scratch (LFS) is a project that provides you with step-by-step instructions for building your own custom Linux system, entirely from source code.
  1. rando103747202

    LFS takes the wrong approach in my opinion. I did it once manually over a couple of days. I suppose I hoped enduring the pain of waiting for the packages to compile would somehow make me smarter. It didn’t. I didn’t learn much. It was like following a baking recipe. I know I need to add eggs and sugar in the ratio it says but I’d be damned if I could tell you why that specific ratio works.

    It’s just too much to take in at once. You start by building a cross compilation toolchain but… why? And you add the bootloader dead last, even though it’s the first thing you see when you boot a Linux machine?

    I reckon a better approach would be to build it step by step, only adding new things once you’ve discovered a need for them. First you get the bootloader working, then you get it to actually load the initramfs and kernel, etc… you could even create your own extremely simple initramfs first before adding dracut, etc…

    This gets you to a system you can boot and play with asap. And then you can slowly start to discover why you actually need all these things through exploration and experimentation.

  2. lukeify

    You can tell it's written by real Linux users because the landing page UX doesn't make it immediately obvious where to even start reading.

  3. phlipski

    About 4 years after beating my head against the wall trying to learn all about embedded linux builds and reading through yocto docs, I found a course on Udemy titled, "Embedded Linux Step by Step Using Beaglebone Black" It was perfect for walking me through the kernel, file-systems, boot-loaders, etc... It was a bit dated even then and thus required a little leg work to find the proper source versions of linux for the beagle board but I got it all working and cross-compiled a linux distro from scratch for the beagle board, flashed it, booted it and talked to it via serial port. I highly recommend the course.

  4. nobleach

    For me, BSD and Portage was my intro to "you're gonna need to learn how to compile stuff". But Gentoo Stage 1 was my real intro into how to bootstrap Linux. I had been using it for about 6 years at that point. (RedHat/Mandrake/TurboLinux/Caldera/Slackware/Debian-based stuff) Starting at nothing but a partitioned disk felt crazy. But I learned so much that not much in the Linux realm scares me these days. It made installing Arch back in 2011 a walk in the park.

  5. tugback

    That was a weekend project once, absolutely grueling but you learn so much about the OS internals.

  6. bmenrigh

    For a long time (probably 2002-2010) I really wanted to do LFS. But I've been on Gentoo since 2004 which, over the last ~22 years, has probably exposed me to almost everything LFS would have, plus a lot more it wouldn't have. I still wish I'd did it way back when. I probably would stumbled through fewer issues had I.

  7. Marchant_hq

    Still remember the first time LFS booted. Felt like a true wizard, even if it was just a shell.

  8. cmrx64

    I kept an LFS system going for a few months (on a wretchedly awful by modern standards celeron “net top”) until eventually making a mess I couldn’t figure out how to untangle during a system upgrade. this gave me the sheer force of will necessary to later do things like own the multiplatform build system for an ocaml based distributed system (mina)

More from this day

2026-09-15