Skip to content

Instantly share code, notes, and snippets.

@hunzo
Created October 30, 2025 06:04
Show Gist options
  • Save hunzo/900c5f3d7202046685d2af8558abff38 to your computer and use it in GitHub Desktop.
Save hunzo/900c5f3d7202046685d2af8558abff38 to your computer and use it in GitHub Desktop.

Installing the NVIDIA Container Toolkit

Install Docker

curl -sL https://gist.github.com/hunzo/1c4836ad4aab99bdb31ce9a5b3c09e44#file-install-docker-sh | bash

Install the prerequisites

sudo apt-get update && sudo apt-get install -y --no-install-recommends \
   curl \
   gnupg2

Configure the production repository

curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
  && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update -y

Install the NVIDIA Container Toolkit packages

export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.18.0-1
  sudo apt-get install -y \
      nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
      nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
      libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
      libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}

Config Docker

sudo nvidia-ctk runtime configure --runtime=docker
  • restart
sudo systemctl restart docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment