How to Install Nvidia Drivers on Ubuntu 24.04, 22.04, or 20.04

Nvidia Drivers are pivotal in leveraging the full potential of Nvidia GPUs, catering to various computational needs, from gaming to professional graphics work and artificial intelligence research. These drivers ensure seamless integration with the operating system, providing an optimized computing experience through enhanced performance, stability, and compatibility.

Key highlights of Nvidia Drivers include:

  • Enhanced Performance: Unlock superior graphics and computational capabilities, ensuring smooth and efficient processing.
  • Advanced Features: Access to cutting-edge technologies like ray tracing, deep learning super sampling (DLSS), and AI-driven applications.
  • Energy Efficiency: Improved power management for longer battery life and lower energy consumption.
  • Robust Stability: Regular updates and patches ensure compatibility with the latest games and applications.
  • Broad Compatibility: Support a wide range of Nvidia GPUs, from older models to the latest releases.
  • Optimized Graphics: Crisp, clear visuals for gaming, professional graphics work, and video streaming.
  • Customizable Settings: Users can tailor their experience to their performance or quality preferences.
  • Developer Support: Extensive resources and tools for developers to harness the power of Nvidia GPUs in their projects.

Let’s install these drivers to ensure your system is fully equipped to meet your graphics and computational demands.

Prerequisites for Installing NVIDIA Drivers

To successfully install NVIDIA drivers on Ubuntu, ensure you meet the following requirements:

System Requirements and Supported Ubuntu Versions

Processor2 gigahertz (GHz) or faster dual-core processor
RAM4 GB or more
Disk Space25 GB of free space
GraphicsNVIDIA GPU supported by the driver
NetworkBroadband internet connection
Supported VersionsUbuntu 24.04 (Noble), Ubuntu 22.04 (Jammy), Ubuntu 20.04 (Focal)

Additional Requirements

Internet ConnectionRequired to download NVIDIA drivers and updates.
Terminal ConventionsAll terminal commands should be run as a regular user with sudo privileges.
CLI CommandsUse the Command Line Interface (CLI) for installation and setup.
DKMSDynamic Kernel Module Support (DKMS) is recommended for managing kernel modules.

Remove Previous NVIDIA Installations

If you’ve previously installed NVIDIA drivers using a specific method and wish to reinstall using a different approach mentioned here, be cautious. Mixing multiple NVIDIA repositories can disrupt your drivers. You should revert the Mesa drivers first and then install the NVIDIA drivers.

Note: You can bypass this section if you haven’t installed any NVIDIA drivers yet.

Method 1: APT Method Removal of NVIDIA Drivers

First, use a blanket command to remove any traces of NVIDIA installation on your system. This command searches for any NVIDIA-related packages and purges them from your system:

sudo apt autoremove nvidia* --purge

Method 2: Removing Runfile NVIDIA Driver Installations

Suppose you have installed the NVIDIA drivers using the “.run” file method (which is not recommended due to better alternatives like the NVIDIA CUDA repository). In that case, you need to remove them using a different approach.

To remove the runfile type of installation, use the following command:

sudo /usr/bin/nvidia-uninstall

Method 3: Removing NVIDIA CUDA Toolkit Runfile Installations

If you have installed the CUDA toolkit using the runfile method, you must also remove it. To do so, execute the following command:

sudo /usr/local/cuda-X.Y/bin/cuda-uninstall

Replace X.Y with the version number of your installed CUDA toolkit.

These methods should remove any existing NVIDIA drivers from your Ubuntu system, allowing you to proceed with a fresh installation.

Pre-installation Steps For NVIDIA Drivers Installation

Before installing the NVIDIA drivers, it is essential to perform some pre-installation checks to ensure a smooth installation process. This section will guide you through the necessary steps.

Update Ubuntu Before Nvidia Drivers Installation

Updating your system ensures that all packages are up-to-date, reducing the likelihood of conflicts during the installation. This is particularly important when installing packages such as new kernels and graphics card drivers.

First, update the package list:

sudo apt update

Next, upgrade any outdated packages:

sudo apt upgrade

Determine Your Graphics Card

It is essential to determine if your older NVIDIA graphics card is supported. Users with brand-new cards can skip this step, as they will undoubtedly be supported.

First, find your graphics card module using the following command:

lspci | grep -e VGA

This command will display information about your graphics card. An example output is shown below:

03:00.0 VGA compatible controller: NVIDIA Corporation TU117 [GeForce GTX 1650] (rev a1)

If you use an older card, research it on the NVIDIA website to check if the latest drivers support it. In some cases, you may need to install legacy drivers instead.

Method 1: Install NVIDIA Drivers via CLI Terminal

The command line is the first option for installing NVIDIA drivers on your Ubuntu system. While advanced users may prefer command-based methods, even beginners can easily follow this approach.

Identify Your Graphics Card and Recommended Driver

Open your terminal by pressing CTRL+ALT+T and find information about your graphics card using the following command:

ubuntu-drivers devices

In the example output, the graphics card model is “TU117 [GeForce GTX 1650]”, and the recommended NVIDIA driver is “nvidia-driver-545-open”. Remember that your NVIDIA graphics card model may differ, so look for the recommended driver option in your output.

Install the Recommended Driver or Choose Another Version

You can install the recommended driver package using one of the two methods below.

If you are satisfied with the recommended version, use this command to install it automatically:

sudo ubuntu-drivers autoinstall

If you prefer to install a specific driver version, use the appropriate command from the list below. Remember that these version numbers are examples and will change over time.

The commands below are just common examples. Remember, Nvidia releases newer versions constantly. This guide may not be updated for each command, but it will still exist.

sudo apt install nvidia-driver-550
sudo apt install nvidia-driver-545
sudo apt install nvidia-driver-535
sudo apt install nvidia-driver-530
sudo apt install nvidia-driver-525
sudo apt install nvidia-driver-520
sudo apt install nvidia-driver-515
sudo apt install nvidia-driver-510

Reboot Your System

Once the driver installation is complete, reboot your Ubuntu system by entering the following command:


After the system restarts, your NVIDIA drivers should be successfully installed and ready for use.

Method 2: Install NVIDIA Drivers via Desktop GUI

The second solution for installing NVIDIA drivers on your Ubuntu system is using the graphical user interface (GUI) method. This approach is especially recommended for Linux beginners.

Open “Additional Drivers” Application

First, go to your application menu and open the “Additional Drivers” application. For users new to Ubuntu, you can find it by following these steps:

  1. Click “Activities” in the top-left corner of the screen.
  2. Type “Additional Drivers” in the search bar.
  3. Select the “Additional Drivers” application from the search results.

Choose the NVIDIA Driver to Install

The “Software & Updates” window will appear, displaying a list of available drivers for your NVIDIA graphics card. The number of drivers listed may vary depending on the age and popularity of your graphics card.

Select the NVIDIA driver you wish to install and click the “Apply Changes” button. Depending on your system and its resources, the installation process will take 2 to 3 minutes.

Reboot Your System

Once the driver installation is complete, reboot your system. You can do this immediately by typing the following command in your terminal:


Method 3: Install NVIDIA Drivers using “graphics-drivers/ppa”

The following method involves installing NVIDIA drivers from the graphics-drivers/ppa repository, which is known for providing the most up-to-date proprietary NVIDIA drivers. This approach is recommended for users who want to update their graphics drivers regularly.

Install Required Dependencies

First, you need to install the required dependencies by executing the following command:

sudo apt install software-properties-common -y

Add the graphics-drivers PPA

Next, add the graphics-drivers/ppa repository to your system using the following command:

sudo add-apt-repository ppa:graphics-drivers/ppa -y

Refresh Package Cache

With the PPA now added to your system, update the package list by running:

sudo apt update

Check Recommended Nvidia Drivers

Now, enter the following command to display the recommended drivers for your graphics card:

ubuntu-drivers devices

The output will differ from the one you received using the standard Ubuntu APT repository. In the list, you will see a third-party recommended driver.

Install NVIDIA Drivers via APT Command from the PPA

To install the driver, choose one of the following options:

If you are satisfied with the recommended version, use this command:

sudo ubuntu-drivers autoinstall

Alternatively, if you want to install a specific driver version, use one of the commands below:

sudo apt install nvidia-driver-550
sudo apt install nvidia-driver-545
sudo apt install nvidia-driver-535
sudo apt install nvidia-driver-530
sudo apt install nvidia-driver-525
sudo apt install nvidia-driver-520
sudo apt install nvidia-driver-515
sudo apt install nvidia-driver-510
sudo apt install nvidia-driver-470
sudo apt install nvidia-driver-450
sudo apt install nvidia-driver-390

Reboot Your System

Once the installation is complete, reboot your system using the following command:


After the restart, the newly installed NVIDIA drivers from the graphics-drivers/ppa repository will be active on your system.

Method 4: Install NVIDIA Drivers on LTS releases via CUDA PPA

This section only applies to Ubuntu 24.04, 22.04, and 20.04 LTS releases. Short-term releases cannot use this method.

Install the Required Packages To Install Nvidia Drivers from CUDA PPA

The last method of installing NVIDIA drivers involves using the NVIDIA CUDA repository, which is frequently updated and supports Debian, Ubuntu, RHEL, and other popular Linux distributions.

First, make sure to install the following packages, which might already be installed on your system:

sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https dkms curl -y

Import NVIDIA Repository GPG Key

Next, import the GPG key for your distribution version:

Noble Numbat: Ubuntu 24.04:

curl -fSsL | sudo gpg --dearmor | sudo tee /usr/share/keyrings/nvidia-drivers.gpg > /dev/null 2>&1

Jammy Jellyfish: Ubuntu 22.04:

curl -fSsL | sudo gpg --dearmor | sudo tee /usr/share/keyrings/nvidia-drivers.gpg > /dev/null 2>&1

Focal Fossa: Ubuntu 20.04:

curl -fSsL | sudo gpg --dearmor | sudo tee /usr/share/keyrings/nvidia-drivers.gpg > /dev/null 2>&1

Add NVIDIA CUDA Repository

Now, add the NVIDIA repository for your system, ensuring you import the correct one to match your Ubuntu distribution version:

Noble Numbat: Ubuntu 24.04:

echo 'deb [signed-by=/usr/share/keyrings/nvidia-drivers.gpg] /' | sudo tee /etc/apt/sources.list.d/nvidia-drivers.list

Jammy Jellyfish: Ubuntu 22.04:

echo 'deb [signed-by=/usr/share/keyrings/nvidia-drivers.gpg] /' | sudo tee /etc/apt/sources.list.d/nvidia-drivers.list

Focal Fossa: Ubuntu 20.04:

echo 'deb [signed-by=/usr/share/keyrings/nvidia-drivers.gpg] /' | sudo tee /etc/apt/sources.list.d/nvidia-drivers.list

Refresh APT Package Index

Update your sources list to reflect the newly added repository:

sudo apt update

Search and Install Nvidia Drivers VIA Nvidia PPA

Next, install the latest Nvidia drivers. You can use the APT search command to view the complete list of available drivers:

apt search nvidia-driver-*

This tutorial demonstrates how to install the latest version currently available. Depending on your preference, replace 545 with 530, 525, 520, 515, etc.

For the best compatibility, install the proprietary version, especially if you are new to Ubuntu. Open-source drivers may cause issues with certain graphics cards.

Advanced users can easily switch between open-source and proprietary drivers as needed.

  • Install NVIDIA Drivers 550.xx without CUDA support (proprietary):
sudo apt install nvidia-driver-550
  • Install NVIDIA Drivers 550.xx with CUDA support (proprietary):
sudo apt install nvidia-driver-550 cuda-drivers-550 cuda
  • Install NVIDIA Drivers 550.xx without CUDA support (open-source):
sudo apt install nvidia-driver-550-open
  • Install NVIDIA Drivers 550.xx with CUDA support (open-source):
sudo apt install nvidia-driver-550-open cuda-drivers-550 cuda

If the above drivers do not work, try using version 545, 530, 520, 515, etc., or use the search command mentioned earlier to find other versions.

Install Nvidia Headless Drivers

For non-desktop users and those running servers with specialized software, it is often best to install NVIDIA drivers directly from the CUDA repository. The instructions are the same as for desktop users, but you need to add “headless” to the command.

Proprietary NVIDIA 545 headless drivers

sudo apt install nvidia-headless-545

Open-source NVIDIA 545 headless drivers

sudo apt install nvidia-headless-545-open

For more options, use the APT search command in your terminal to locate specific packages:

apt search nvidia-headless*

Additionally, you can add CUDA and any other required packages. Desktop users should not install headless drivers.

Confirming Nvidia Drivers Installation

Once you have successfully installed the Nvidia drivers and rebooted your system, verifying that the installation was successful is essential. This section will guide you in confirming the installation using the command line and the graphical user interface (GUI).

Check Nvidia Drivers via Terminal

You can use the command line to verify the installation. This command will display information about your Nvidia GPU, such as the driver version, GPU usage, temperature, and more.


Access Nvidia Settings GUI

You can launch the Nvidia settings GUI if you prefer a graphical interface. To do this, follow the steps below:

Open the terminal and enter the following command:


Alternatively, you can access the Nvidia settings through the application menu:

Go to Activities > Show Applications > NVIDIA X Server Settings.

After opening the Nvidia settings GUI, you can see your GPU’s configuration, information, and other settings that can be customized.


In wrapping up, this guide walked you through installing Nvidia Drivers on Ubuntu, showing you the ropes with a few straightforward methods. Remember, keeping your drivers updated ensures your Nvidia GPU runs smoothly, giving you the best performance for whatever you tackle, whether work, gaming, or creative projects. Don’t hesitate to revisit these steps or check for updates to keep things running optimally.

Useful Links

Here are some helpful links related to installing NVIDIA drivers:

  • Graphics Drivers PPA: Access the latest NVIDIA drivers from the Ubuntu graphics drivers PPA. This repository often has the most up-to-date drivers available.
  • NVIDIA Unix Drivers: Visit NVIDIA’s official page for Unix drivers to download the latest drivers directly from NVIDIA.
  • NVIDIA CUDA Toolkit: Learn about and download the CUDA Toolkit, which includes drivers and tools for GPU-accelerated computing.
  • NVIDIA Tesla Driver Documentation: Read the documentation for NVIDIA Tesla drivers, providing detailed information on driver branches and updates.
  • NVIDIA Forums: Join the NVIDIA community forums to discuss issues, share solutions, and get support from other NVIDIA users.
Joshua James
Follow me
Latest posts by Joshua James (see all)