Installing NVIDIA Proprietary Driver on Ubuntu with Secure Boot (MOK)

This guide shows how to install the official NVIDIA driver (the .run installer from Nvidia.com) on Ubuntu 24.04/25.04 with Secure Boot enabled, sign the kernel modules, enroll the MOK key, and verify that the driver is actually being used (not falling back to llvmpipe). TL;DR Download the driver from Nvidia.com chmod +x NVIDIA-Linux-x86_64-<version>.run Stop the display manager (e.g., gdm3) and switch to a TTY Run the installer with module signing (supplies key + cert or lets the installer create them) Enroll the cert with mokutil --import ... Reboot and Enroll MOK on the blue screen Add nvidia-drm.modeset=1 to GRUB, rebuild initramfs, reboot Verify with nvidia-smi and glxinfo Prerequisites Ubuntu 24.04/25.04 (GNOME) Secure Boot enabled in BIOS/UEFI Internet access build-essential, kernel headers, and basic tools: sudo apt update sudo apt install -y build-essential dkms linux-headers-$(uname -r) mokutil curl wget mesa-utils Tip: If you previously installed NVIDIA via apt, either purge it or ensure there’s no conflict. Mixing .run and apt packages can cause headaches. ...

August 17, 2025