In this article
- What does the APT-based approach offer?
- Which systems does the script support?
- Download and start the script deliberately
- Stable, Backports or CUDA: Which option fits?
- Understand kernel headers, DKMS and Secure Boot
- Verify the installation after reboot
- What data and connections are involved?
- Frequently asked questions
- Start with an installation you can follow
- Sources and technical basis
Installing an NVIDIA driver on Debian involves more than downloading a file. Package sources, kernel headers, DKMS and sometimes Secure Boot need to fit together. Mixing instructions for different distributions makes that harder to follow.
My NVIDIA installation script for Debian 12 and 13 guides you through an APT-based workflow. The normal installation path uses Debian packages. Its menu lets you choose Stable, already configured Backports or driver-removal options. The CUDA Toolkit is a separate choice.
What does the APT-based approach offer?
The driver and its dependencies remain visible to the package manager, making later updates and installation troubleshooting easier to follow. The normal APT path adds no extra NVIDIA repository and does not force a switch from Wayland to Xorg.
- Check prerequisites: Debian version, architecture, an NVIDIA graphics device and package sources are checked before the menu action.
- Prepare required components: The script installs DKMS and available kernel headers, among other dependencies.
- Make choices explicit: Stable, Backports and CUDA are selected deliberately.
- Keep a troubleshooting record: Output is also written to
/var/log/nvidia-optimizer.log.
Despite the log filename, this is not an automatic FPS optimisation tool. Its benefit is the guided installation workflow. Performance and compatibility still depend on the GPU, driver version, application and system.
Which systems does the script support?
It supports Debian 12 Bookworm and Debian 13 Trixie on amd64 or arm64. The script expects a detected NVIDIA PCI graphics device and root privileges. It is not a general installer for Ubuntu, Arch Linux or other distributions.
Passing the architecture check does not establish that the selected Debian driver supports every graphics card. Check that your GPU belongs to the supported driver branch before installing. Older cards in particular may need a different branch.
Your Debian sources need the required main, contrib, non-free and non-free-firmware components. The script checks both classic .list files and deb822 .sources files. Missing components produce guidance; your sources are not rewritten automatically.
Download and start the script deliberately
First read the instructions and script in the repository. The tool installs and removes system packages and updates the initramfs. Back up important data and allow time for a reboot. If an NVIDIA .run installer was used previously, resolve that existing installation first.
With Git installed, download the project:
git clone https://github.com/dennishilk/nvidia-driver.git
Enter the project directory:
cd nvidia-driver
After reading the script, start it with root privileges:
sudo bash ./install-nvidia-cuda.sh
If APT or dpkg is already running, the script waits for a limited time and may stop. It does not kill package managers or delete lock files. Let an existing package installation finish before starting again.
Stable, Backports or CUDA: Which option fits?
| Option | Purpose | Prerequisite |
|---|---|---|
| Debian Stable | The script's normal APT installation path | A supported GPU and available Debian packages |
| Debian Backports | A driver available there that your hardware needs | Backports for your Debian release already configured |
| CUDA Toolkit | Developing or compiling with CUDA | Optional; the package nvidia-cuda-toolkit must be available |
| Nouveau / removal | Leave the NVIDIA package path | Review the removal list and consequences first |
An ordinary desktop does not automatically need the full CUDA Toolkit. Some applications bundle suitable runtime libraries; consult their documentation. Installing the optional Debian package does not promise that a particular application accepts every CUDA version.
The menu also includes an advanced .run option for amd64. It leaves the normal Debian package workflow and can conflict with APT installations. For the workflow described here, use the APT options.
Understand kernel headers, DKMS and Secure Boot
DKMS builds the required kernel module, which needs matching kernel headers. The script attempts to install the architecture's header metapackage and the exact running kernel's headers where available.
If only headers for a newer Debian kernel are available, you may first need to reboot into that kernel. Display your currently running kernel with:
uname -r
Check the DKMS build state with:
dkms status
With Secure Boot enabled, an untrusted kernel module may be prevented from loading even though its packages are installed. The script provides MOK-enrolment guidance but does not perform enrolment automatically. Check your system's DKMS instructions and whether the expected certificate exists. If mokutil is installed, this command shows Secure Boot status:
mokutil --sb-state
Required enrolment then involves a deliberate step in MOK Manager during reboot. Completing the package installation alone does not confirm that step.
Verify the installation after reboot
Reboot after installation and check the driver:
nvidia-smi
If you installed the CUDA Toolkit, check its compiler too:
nvcc --version
A missing nvcc when the driver works does not automatically indicate a driver problem. The driver and toolkit are different components. If nvidia-smi reports an error, compare the kernel, DKMS state, Secure Boot and installation log before mixing in another installation method.
What data and connections are involved?
The script includes no diagnostic-upload workflow or cloud analysis of your system data. APT does contact your package sources and download packages. The advanced .run path also retrieves metadata and an installer from NVIDIA. Running locally therefore does not mean running offline.
The local log may contain system and hardware details. Share only reviewed, relevant excerpts when asking about an error. The Bash source is available, so you can inspect the workflow before running it.
Frequently asked questions
Does it always install the newest NVIDIA driver?
The APT path installs the available candidate from the chosen Debian sources. That is not necessarily the newest release on NVIDIA's website.
Does it configure Backports automatically?
No. The Backports option expects suitable configured sources. The required package must also be available there for your architecture.
Can I return to Nouveau?
The menu offers removal of installed nvidia-* packages and enabling Nouveau. Review the displayed package list. This is not a complete rollback of every earlier manual graphics change.
Start with an installation you can follow
The NVIDIA Debian project contains the script, prerequisites and troubleshooting guidance. If you are preparing for Linux, start with the Windows-to-Linux checklist and test your hardware before installation.
Sources and technical basis
This guide describes the workflow currently present in the repository. Reviewed on 6 October 2026.