A plug-and-play Dynamic Kernel Module Support (DKMS) package for Apple File System (APFS) on Linux.
This repository provides a pre-configured .deb package that builds the APFS kernel module directly into your Linux kernel. Unlike userspace FUSE drivers (apfs-fuse), this kernel-level integration allows seamless mounting and unmounting of APFS drives directly through standard GUI file managers (like GNOME Files/Nautilus) without throwing udisks2 errors.
This project packages the incredible C source code from the linux-apfs-rw repository. All credit for the underlying filesystem driver and reverse-engineering goes to the original authors. This repository simply wraps their work into an automated DKMS Debian package for easy desktop integration.
If you just want to install the driver and mount your drives seamlessly:
-
Download the latest
.debpackage from thereleases/folder (or the GitHub Releases tab). -
Install it using
dpkg: -
sudo apt update sudo apt install dkms linux-headers-generic build-essential sudo dpkg -i apfs-dkms.deb
Note: Installation takes a few moments as DKMS will compile the module against your active kernel in the background.
-
Plug in your APFS formatted drive and click it in your file manager. It will mount natively.
If you want to modify the DKMS configuration or rebuild the .deb package yourself, follow these steps.
Ensure your system has the necessary build tools and kernel headers:
sudo apt update
sudo apt install dkms linux-headers-generic build-essential-
Clone this repository:
-
cd ~/Desktop git clone https://github.com/nodefive/apfs_dkms.git cd apfs_dkms/apfs-dkms
-
Build the Debian package. The
--root-owner-groupflag is required to ensure the files inside the.debare owned byroot, preventing permission errors on the target system.dpkg-deb --root-owner-group --build . apfs-dkms.deb -
The built package will be named
apfs-ubuntu-dkms.deband placed in the parent directory.
sudo apt install apfs-dkmssudo lsmod | grep apfsTo completely remove the driver and DKMS build from your system:
sudo apt remove apfs-dkmsThis guide covers the installation and digital signing of the driver. This is required for Linux systems with Secure Boot enabled to prevent "module verification failed" errors and ensure the driver loads successfully.
Ensure you have the necessary tools installed for building and signing modules:
sudo apt update
sudo apt install openssl kmod mokutil zstd dkmsInstall the APFS driver from the .deb package.
-
Download the latest
.debfrom apfs_dkms. -
Install the package:
sudo apt install ./apfs-dkms_1.0_all.deb
-
Confirm DKMS has installed the module:
dkms status
You must create a Machine Owner Key (MOK) that your computer's BIOS/UEFI will trust.
-
Generate the Key Pair:
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=APFS Driver/" -
Import the Key:
sudo mokutil --import MOK.der
Create a temporary password when prompted. Keep this password for future uses!
-
Reboot and Enroll:
- Restart your PC.
- At the blue "Perform MOK management" screen, select Enroll MOK.
- Select Continue and then Yes.
- Enter the password you created and reboot.
Modern Linux distributions compress modules with .zst. To avoid corrupting the file, you must decompress it, sign it, and re-compress it.
-
Find the module path:
MOD_PATH=$(modinfo -n apfs) -
Decompress:
sudo zstd -d --rm "$MOD_PATH" -
Sign the Binary:
# The file is now at the same path without the .zst extension RAW_KO="${MOD_PATH%.zst}" sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der "$RAW_KO"
-
Re-compress:
sudo zstd --rm "$RAW_KO"
Tell the kernel to update its database and load the signed driver.
-
Update Dependencies:
sudo depmod -a
-
Load the Module:
sudo modprobe apfs
-
Verify Success:
- Check for the signer:
modinfo apfs | grep -E "signer|sig_key" - Verify it is active:
lsmod | grep apfs - Check logs for errors:
sudo dmesg | tail -n 10 | grep apfs
- Check for the signer:
If you update your Linux kernel, you will need to repeat Step 3 and 4 (resign and reactivate) to sign the module for the new kernel version, so KEEP your .priv key!
MOK.priv (The Private Key): Every time your system downloads a Linux kernel update, DKMS will automatically rebuild a fresh, unsigned version of the APFS module for that new kernel. You will need this .priv file to sign the new module. If you delete it, you will have to generate a completely new key, reboot, and go through the blue-screen BIOS enrollment process all over again.
MOK.der (The Public Key): This key is already safely injected into your motherboard's firmware. While you don't strictly need it to sign future modules, you should keep it in case you ever want to cleanly remove (un-enroll) this specific key from your BIOS using mokutil --delete.
MOK.priv is literally the master key to bypass your computer's Secure Boot. If a malicious script or attacker gets ahold of that file, they can sign a stealthy rootkit, and your kernel will happily load it. So keep this file in a safe place!