How to Install NVIDIA Drivers on Ubuntu 24.04 (Step-by-Step Guide)
The short version: ask Ubuntu which driver fits the graphics card, install the one it recommends, reboot, and check the result with one command. Run ubuntu-drivers devices to see the options, sudo ubuntu-drivers install to install the recommended branch, then nvidia-smi to confirm the driver loaded.
The step that breaks most installs is not the install itself. It is Secure Boot. On a machine with Secure Boot on, the driver kernel modules must be signed with a key the computer trusts, and Ubuntu asks you to enrol that key on a blue screen during the first reboot. Skip that screen, or turn Secure Boot on later without enrolling the key, and the driver silently refuses to load. This guide covers that screen step by step, how to pick the right branch, and a way back if the screen goes black. It targets Ubuntu 24.04 LTS, the version most existing installs run. Ubuntu 26.04.1 LTS is now the current LTS release, and the flow here is the same there.
Before you start: what you need and what to check first
You need a working Ubuntu 24.04 LTS install, an NVIDIA graphics card, an internet connection, and the administrator password. The driver comes from Ubuntu’s own repositories, so there is nothing to download from a website. If Ubuntu is not installed yet, install it first with our guide to installing Ubuntu 24.04 LTS step by step.
First, confirm the graphics card Ubuntu sees. Open a terminal with Ctrl plus Alt plus T and run this command.
lspci | grep -i nvidia
The output names the card, for example a GeForce RTX 4060. If nothing appears, the card may not be seated properly, or the machine may use integrated graphics only.
Next, check whether Secure Boot is on. This decides whether the key enrolment step later in this guide applies to you.
mokutil --sb-state
If it reports SecureBoot enabled, keep the Secure Boot section open during the install. If it reports SecureBoot disabled, the key enrolment step does not apply. Either way, update the system first, so the driver installs against the newest kernel.
sudo apt update && sudo apt upgrade
Reboot after the update, so the new kernel is running when the driver installs. A driver installed against a kernel about to be replaced often works once, then stops after the next reboot.
Step 1: ask Ubuntu which driver branches fit your card
Ubuntu keeps several NVIDIA driver branches in its repositories at once, and not every branch supports every card. Ask Ubuntu what it offers for the card in the machine, instead of picking a version number from a forum post.
ubuntu-drivers devices
The output shows the card model, then one line per driver, like nvidia-driver-580, nvidia-driver-580-open, and nvidia-driver-570. One line carries the word recommended: the branch Ubuntu thinks fits the card best. Only install a branch that appears in this list, because Ubuntu only offers branches that declare support for the card’s PCI device ID.
| Branch | Who it is for | What to know |
|---|---|---|
| 535 | Older cards | Still offered for cards it supports |
| 550 | Recent generations | Widely used on 24.04 |
| 570 | Recent cards, RTX 40 series | Current feature support |
| 580 | Recent cards; last branch for older cards | Last branch for pre-Turing cards |
| 590 | Newer cards | Added as Ubuntu publishes it |
The list grows as Ubuntu adds newer branches, so the numbers on your screen may go further than the table. What matters is the recommended tag, not the highest number. On an older card, such as a GTX 10 series card, expect the list to stop at 580, the last branch for pre-Turing cards.
Step 2: understand the open and proprietary kernel module choice
The driver list usually shows each branch twice: once plain, such as nvidia-driver-580, and once with open on the end, such as nvidia-driver-580-open. The difference is only in the kernel module, the piece that talks directly to the Linux kernel. The libraries, the control panel, and nvidia-smi are identical in both versions.
The proprietary module is the closed kernel module NVIDIA has shipped for years, and the open module is the source-published one for newer cards. Since the 560 driver series, the open modules are the default and recommended flavour, and Ubuntu prefers the open variant where it fits. In Additional Drivers, the open version carries the words open kernel in its label.
Whether the open module fits depends on the card generation. Cards from Turing onward, GTX 16 series, RTX 20 series, and anything newer, can use it. Older cards, Maxwell, Pascal, and Volta, such as the GTX 10 series, cannot, and stay on the proprietary module. This is a hardware limit, not a setting to work around.
For most readers, the rule is simple: take the branch marked recommended and let Ubuntu pick the flavour. Only choose by hand for a concrete reason, such as a CUDA workload that names a specific branch. Ubuntu documents the branches and the open kernel option in its install guide at Ubuntu Desktop documentation: Install NVIDIA drivers.
Step 3: install the recommended driver
With the list checked, install the recommended branch with one command. It detects the card and installs the branch Ubuntu marked recommended, kernel modules and user-space tools included. On Ubuntu 24.04, the older command sudo ubuntu-drivers autoinstall does the same thing, but install is the current command name.
sudo ubuntu-drivers install
Enter the administrator password when asked. The install downloads the user-space metapackage for the branch, such as nvidia-driver-580, and the matching kernel modules package, such as linux-modules-nvidia-580-generic. The kernel modules package is separate on purpose: it lets Ubuntu ship pre-built, signed modules that work with Secure Boot. While the packages install, the terminal may ask for a password for the Secure Boot key. Read the next section before rebooting.
To install a specific branch instead, name it in the command, using a version number from the devices list. For example, for the 570 branch, run sudo ubuntu-drivers install nvidia:570. Only do this with a reason to depart from the recommendation.
If the terminal is not comfortable, use the mouse instead. Open Software and Updates, go to the Additional Drivers tab, wait for the list to load, pick the driver marked recommended, or the most recent one with the proprietary, tested label, then click Apply Changes and enter the password. The app uses the same detection logic as ubuntu-drivers, so the result is the same. Avoid the entries labelled Server, which are built for servers rather than desktop use. Reboot when the install finishes.
Step 4: enrol the Secure Boot key on the blue screen
This step decides whether the driver works at all. Secure Boot only lets the kernel load modules signed with a trusted key. Ubuntu’s packages handle the signing, but the key must be enrolled into the trusted list on a blue screen called the MOK manager, short for Machine Owner Key manager, during the first reboot.
During the install, the terminal asks for a password for the key. It is temporary: it is used once, on the blue screen, to prove the enrolment is yours. Pick something short, since there is no password manager and no way to paste on that screen, and write it down before rebooting.
- Reboot after the driver install finishes.
- On the first reboot, the blue MOK manager screen appears before Ubuntu starts. Do not let it time out.
- Select Enroll MOK and press Enter.
- Select Continue and press Enter.
- Select Yes when it asks whether to enrol the key, and press Enter.
- Type the password the terminal asked for during the install, and press Enter.
- Select Reboot and press Enter.
What to do when no blue screen appears
Sometimes the blue screen never shows. It may have timed out while the screen was off, or Secure Boot may have been turned on after the driver was installed, so no enrolment was ever queued. The driver then fails to load. The fix is to queue the key by hand and reboot.
First, confirm Secure Boot is on with mokutil –sb-state. If it reports SecureBoot enabled and the driver is not loading, run this command. It queues Ubuntu’s signing key, stored at /var/lib/shim-signed/mok/MOK.der, for enrolment. Set a password when asked, write it down, then reboot.
sudo mokutil --import /var/lib/shim-signed/mok/MOK.der
On reboot, the blue screen appears. Follow the same steps: Enroll MOK, Continue, Yes, type the password, then Reboot. If it still does not appear, turn fast boot off in the firmware setup, since some machines hide the MOK prompt while fast boot is on. Turning Secure Boot off is a last resort: it lets unsigned modules load, but it weakens the protection Secure Boot provides.
Step 5: check the driver loaded with nvidia-smi
After the reboot and the key enrolment, check that the driver is running.
nvidia-smi
A working install shows the card name, the driver version, and a table of processes using the graphics card. If the driver version matches the branch installed, the install worked. If the command reports that it cannot communicate with the NVIDIA driver, or that no devices were found, the kernel module did not load. On a Secure Boot machine, that almost always means the key was not enrolled, so go back to the Secure Boot section and queue the key with mokutil. The version can also be checked with cat /proc/driver/nvidia/version.
Two quick checks confirm the desktop uses the new driver. Open Settings, then About: the graphics entry should name the NVIDIA card rather than the basic display driver. Then open NVIDIA X Server Settings from the applications menu. If it opens and shows the card details, the driver stack works end to end.
If the screen goes black after installing the driver
A black screen after the reboot is recoverable. It usually means the new driver loaded but the display setup did not, or the wrong branch was installed. Note the driver branch first, because that decides what to reinstall. Then get back to a working desktop with nomodeset, a boot option that holds off loading the graphics driver until the desktop is up.
Boot once with nomodeset to reach the desktop
- Restart the computer and highlight the Ubuntu entry in the GRUB menu. If the menu does not appear, hold Shift during boot on a BIOS machine, or press Esc repeatedly on a UEFI machine.
- Press E to edit the boot entry. A text editor opens showing the boot commands.
- Find the line starting with linux and ending with quiet splash, then add nomodeset at the end of it, with a space before it.
- Press Ctrl plus X or F10 to boot with that one-time change. The file on disk is untouched.
- Ubuntu should reach the desktop, using the basic display driver.
Remove the broken driver and reinstall it
Once the desktop is up, open a terminal and remove the driver completely with this command. Note the branch installed before running it, so the reinstall picks the right one.
sudo apt purge nvidia-*
If matching kernel module packages remain, remove those too, for example sudo apt purge linux-modules-nvidia-580-generic, using the branch number installed. Then reboot, and the desktop should come up on the built-in nouveau driver. Run ubuntu-drivers devices again and install the recommended branch, exactly as in the earlier steps. If the same branch fails twice, try the next branch down.
If the purge and reinstall still leaves a black screen, a clean reinstall of Ubuntu from a bootable USB is the last resort. Our guide to creating a bootable Ubuntu USB on Windows covers making the install media.
Updating the driver and switching branches later
Once installed through ubuntu-drivers, the driver updates with the rest of the system. Running sudo apt update and sudo apt upgrade installs newer packages in the same branch as Ubuntu publishes them, and a reboot loads them. When a new kernel arrives, the modules are rebuilt or replaced for it automatically, because they come from Ubuntu packages rather than a manual build. Ubuntu documents this packaged flow, including the manual module steps for custom kernels, in its server driver guide at Ubuntu Server documentation: NVIDIA drivers installation.
To move to a different branch later, list the options again with ubuntu-drivers devices, then install the chosen branch with sudo ubuntu-drivers install nvidia:570. Ubuntu removes the old branch before installing the new one. A reboot and, on a Secure Boot machine, the same key enrolment check complete the switch. Avoid the .run file on NVIDIA’s website or an unofficial PPA unless a specific workload names one of those routes: packages from outside Ubuntu’s repositories can overwrite Ubuntu’s driver files and break Secure Boot.
Common problems and quick fixes
Most NVIDIA driver trouble on Ubuntu 24.04 falls into a small set of patterns, matched to cause and fix in the table below.
| Symptom | Most likely cause | Fix |
|---|---|---|
| nvidia-smi reports it cannot communicate with the driver | The module did not load; the Secure Boot key was not enrolled | Queue the key with mokutil, enrol it, reboot |
| The driver worked, then stopped after a kernel update | The modules were not rebuilt for the new kernel | Reboot into the new kernel, then reinstall the branch |
| Additional Drivers shows no NVIDIA entry | The card is not detected, or the list has not loaded | Check lspci, update the package lists, reopen Additional Drivers |
| Black screen after install | The driver loaded but the display setup failed | Boot with nomodeset, purge, reinstall the recommended branch |
| Games or apps run slowly after install | The desktop still uses the built-in nouveau driver | Check nvidia-smi and the graphics entry in Settings, About |
Installing the NVIDIA driver blacklists the built-in nouveau driver automatically, so there is no need to edit any configuration file by hand. Older guides describe that step because older installs needed it. On Ubuntu 24.04, the packaged driver handles it.
Install the driver Ubuntu recommends, enrol the Secure Boot key on the blue screen when it appears, and check the result with nvidia-smi. Those three moves cover almost every NVIDIA install on Ubuntu 24.04, and the recovery steps above cover the rest. Keep the key password written down until the first successful boot.
- How to Install NVIDIA Drivers on Ubuntu 24.04 (Step-by-Step Guide) - December 1, 2026
- How to Fix Windows Update Error 0x80070005 [Fix] - November 30, 2026
- How to Fix Windows Update Error 0x80070002 [Fix] - November 29, 2026
