Requirements for Sherpa AI Server#
System Requirements#
- OS: Ubuntu 20.04+ is recommended, however, there are generally no issues with other Linux distributions; compatibility has been verified with RedOS, AstraLinux, AltLinux, Debian
- CPU: x86_64 with AVX2
- RAM: 16 GB minimum, 32 GB+ recommended
- Disk: 100 GB+ of free space
- GPU: NVIDIA with CUDA 11.8+ (recommended)
- Network: Stable internet connection
- Access: sudo privileges for installation
Important:
- Installation takes hours due to downloading AI models (10-50 GB)
- After installation, internet is not required
Preparing the Server#
Checking Resources#
The following uses Ubuntu syntax; if the command does not fit, you need to change the syntax according to your OS.
# Check system resources
df -h # Disk space
free -h # RAM
nvidia-smi # GPU (if installed)
💡 Resource Check Comments
df -h - shows disk space usage in human-readable format free -h - shows information about RAM nvidia-smi - shows information about NVIDIA GPU (if installed)
Installing Basic Tools#
# Update the system and install tools
sudo apt update
sudo apt install -y ca-certificates curl tar
💡 Comments on Installing Basic Tools
sudo apt update - updates the list of available packages from repositories sudo apt install -y ca-certificates curl tar - installs necessary tools:
ca-certificates- root certificates for SSL verificationcurl- tool for downloading filestar- utility for working with archives-y- automatic confirmation of installation
Installing Docker (skip if already installed)#
Sherpa AI Server runs in Docker containers.
Installing Docker CE#
# Add the official Docker GPG key
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
💡 Comments on Installing Docker
Adding the GPG key:
sudo install -m 0755 -d /etc/apt/keyrings- creates a directory for keys with the correct permissionssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc- downloads the Docker GPG keysudo chmod a+r /etc/apt/keyrings/docker.asc- sets read permissions for all
Adding the repository:
echo "deb [...]- adds the official Docker repository to the APT sources list- Uses environment variables to determine architecture and Ubuntu version
Installing packages:
sudo apt update- updates the package list after adding a new repositorysudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin- installs Docker and components
Configuration and Verification#
# Add user to the docker group (optional)
sudo usermod -aG docker $USER
# Check installation
docker --version
docker compose version
💡 Comments on Docker Configuration
sudo usermod -aG docker $USER - adds the current user to the docker group
-a- append (adds to existing groups)-G docker- adds to the docker group$USER- variable with the current user's name
docker --version - shows the Docker version docker compose version - shows the Docker Compose version
Expected result: Docker successfully runs a test container.
Expected result: Docker successfully runs a test container.
Installing GPU Support (NVIDIA + Toolkit) (skip if already installed)#
If the server has an NVIDIA GPU, install the drivers and Container Toolkit:
💡 Offline Installation: If the server does not have internet access, use the Offline Installation of GPU Support (NVIDIA) section below.
Installing NVIDIA Drivers#
# Remove old drivers and install new ones
sudo apt purge 'nvidia-*'
sudo apt autoremove
sudo apt install -y nvidia-driver-580
# Reboot the server
sudo reboot
💡 Comments on Installing NVIDIA Drivers
sudo apt purge 'nvidia-*' - removes all NVIDIA packages
purge- removes packages and their configuration files'nvidia-*'- pattern for finding all packages starting with nvidia
sudo apt autoremove - removes unnecessary dependencies sudo apt install -y nvidia-driver-580 - installs NVIDIA drivers version 580
sudo reboot - reboots the system to apply changes
Checking GPU#
# After reboot, check GPU
nvidia-smi
💡 Comments on Checking GPU
nvidia-smi - System Management Interface for NVIDIA GPU
- Shows information about GPU, drivers, processes
- Used for diagnostics and monitoring
Expected output:
NVIDIA-SMI 580.xx.xx
Driver Version: 580.xx.xx
Installing NVIDIA Container Toolkit#
# Add the repository and install the toolkit
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \
sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit.gpg
curl -fsSL 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.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt update
sudo apt install -y nvidia-container-toolkit
# Configure Docker for GPU
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
💡 Comments on Installing NVIDIA Container Toolkit
Adding the NVIDIA Container Toolkit repository:
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey- downloads the GPG keysudo gpg --dearmor- converts the key to binary formatcurl ... nvidia-container-toolkit.list- downloads the repository configurationsed 's#deb https://#deb [signed-by=...] https://#g'- adds key signature to the configuration
sudo apt update - updates the package list sudo apt install -y nvidia-container-toolkit - installs the toolkit
sudo nvidia-ctk runtime configure --runtime=docker - configures Docker runtime for NVIDIA sudo systemctl restart docker - restarts the Docker daemon to apply changes
Offline Installation of GPU Support (NVIDIA)#
If the server does not have internet access, perform the installation of NVIDIA drivers and Container Toolkit offline. Package preparation can be done in parallel with downloading Docker images.
Preparing Packages on an Internet-Connected Machine#
Requirements: A machine with Ubuntu/Debian and internet access.
Important:
- Package preparation can be done on any machine with Ubuntu/Debian (not necessarily on the target server)
- Ensure you have enough disk space (about 1 GB for all packages)
- All commands are executed in one terminal session, keep track of the current directory
On a machine with internet access (Ubuntu/Debian), prepare an archive with NVIDIA packages:
Downloading NVIDIA Drivers
Important: Choose one of two methods - either download the .run file from the NVIDIA website or use .deb packages via apt download.
Method 1: Downloading the .run file from the official NVIDIA website (recommended for beginners)
Go to the official NVIDIA website: https://www.nvidia.com/Download/index.aspx
Select options:
- Product Type: GeForce / Quadro / Tesla (depending on your graphics card)
- Product Series: select the series of your graphics card
- Product: select the specific model
- Operating System: Linux 64-bit
- Download Type: Linux Driver
- Language: English (US)
Click "Search" and download the driver file (e.g.,
NVIDIA-Linux-x86_64-580.XX.XX.run)Create a directory for packages and save the .run file:
mkdir -p nvidia-offline-packages/drivers # Move the downloaded .run file to this directory mv ~/Downloads/NVIDIA-Linux-x86_64-*.run nvidia-offline-packages/drivers/
Method 2: Downloading .deb packages via apt (for advanced users)
If you are using Ubuntu/Debian and want to use .deb packages:
# Create a directory for packages
mkdir -p nvidia-offline-packages/drivers
cd nvidia-offline-packages/drivers
# Download the driver via apt download (if the repository is available)
# First, add the NVIDIA repository (if not already added)
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
# Download the driver package
apt download nvidia-driver-580
# Download driver dependencies (execute the command line by line)
# First, find out the list of dependencies:
apt-cache depends nvidia-driver-580 | grep "Depends:" | cut -d: -f2 | tr -d ' ' > /tmp/deps.txt
# Then download each dependency:
while read dep; do
apt download "$dep" 2>/dev/null || echo "Skipped dependency: $dep"
done < /tmp/deps.txt
# Remove the temporary file
rm /tmp/deps.txt
Downloading NVIDIA Container Toolkit
About GPG keys:
- GPG keys are used to verify the authenticity of packages when installing via
apt install - When installing offline via
dpkg -i, GPG keys ARE NOT REQUIRED - packages are installed directly - GPG keys are only needed if you plan to use
apt installor set up the repository for future updates - For simplicity, you can skip downloading GPG keys and install packages via
dpkg -i
# Go back to the packages directory
cd nvidia-offline-packages
# Create a directory for the Container Toolkit
mkdir -p toolkit
# Add the NVIDIA Container Toolkit repository (if not already added)
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \
sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit.gpg
curl -fsSL 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.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt update
# Download the Container Toolkit package and all its dependencies
cd toolkit
apt download nvidia-container-toolkit
# Download Container Toolkit dependencies (execute the command line by line)
# First, find out the list of dependencies:
apt-cache depends nvidia-container-toolkit | grep "Depends:" | cut -d: -f2 | tr -d ' ' > /tmp/toolkit-deps.txt
# Then download each dependency:
while read dep; do
apt download "$dep" 2>/dev/null || echo "Skipped dependency: $dep"
done < /tmp/toolkit-deps.txt
# Remove the temporary file
rm /tmp/toolkit-deps.txt
# Optionally: Download the GPG key and repository file (only needed if you plan to use apt install instead of dpkg)
# For offline installation via dpkg -i, GPG keys ARE NOT REQUIRED
cd ..
mkdir -p keys
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey -o keys/nvidia-container-toolkit.gpg
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list -o keys/nvidia-container-toolkit.list
Packaging the Archive
# Go back to the root directory of the packages
cd nvidia-offline-packages
# Ensure all files are in place:
# - drivers/ - contains .deb packages or .run driver file
# - toolkit/ - contains .deb packages of the Container Toolkit
# - keys/ - contains GPG keys and repository files (optionally, if available)
# Create an archive with all packages
# If the keys/ directory is empty or missing, you can create the archive without it:
if [ -d "keys" ] && [ "$(ls -A keys)" ]; then
tar -czf nvidia-packages-offline.tar.gz drivers/ toolkit/ keys/
else
tar -czf nvidia-packages-offline.tar.gz drivers/ toolkit/
echo "Warning: GPG keys are not included in the archive (not required for installation via dpkg)"
fi
# Check the size of the archive
ls -lh nvidia-packages-offline.tar.gz
💡 Comments on Preparing Packages
Downloading Drivers:
- The official NVIDIA website provides the latest driver versions for all GPU models
- The driver version should meet the requirements (recommended 580+)
- .deb packages are more convenient for installation via dpkg (recommended for Ubuntu/Debian)
- .run files are universal installers from NVIDIA, work on any Linux distributions, but require stopping the graphical server during installation
Downloading Container Toolkit:
apt downloaddownloads the package without installation- Dependencies are downloaded separately for a complete offline installation
- GPG keys and repository files are optional - they are only needed if you plan to use
apt installinstead ofdpkg -i, or if you want to set up the repository for future updates
Archive Size: The expected size of the archive is about 200-500 MB depending on the versions of the packages.
Transferring the Archive to the Target Server#
Transfer the archive nvidia-packages-offline.tar.gz to the target server by any convenient method (SCP, SFTP, USB drive, etc.). It is recommended to transfer the archive along with Docker images.
Installation on the Target Server#
After transferring the archive to the target server, perform the installation:
Installing NVIDIA Drivers from .deb Packages
If you downloaded .deb driver packages:
# Extract the archive
tar -xzf nvidia-packages-offline.tar.gz
cd nvidia-offline-packages
# Check for .deb files in the drivers directory
ls -la drivers/*.deb
# Install NVIDIA drivers
cd drivers
sudo dpkg -i *.deb
# Check the installation result
if [ $? -eq 0 ]; then
echo "Drivers installed successfully"
else
echo "Dependency errors detected, fixing..."
# If there are dependency errors, install them from the cache or fix dependencies
sudo apt install --fix-broken -y
# If fix-broken did not help, try installing dependencies manually
# Ensure that all dependencies were downloaded to the drivers directory
echo "Check that all dependencies are downloaded to the drivers/ directory"
ls -la *.deb
fi
# Reboot the server to apply the drivers
echo "Rebooting the server in 10 seconds... Press Ctrl+C to cancel"
sleep 10
sudo reboot
If the installation failed:
- Check which packages did not install:
dpkg -l | grep nvidia - Ensure all dependencies are downloaded:
ls -la drivers/*.deb | wc -l(should be several files) - Try installing packages one by one:
sudo dpkg -i package_name.deb
Installing NVIDIA Drivers from .run File
If you downloaded the .run driver file from the official NVIDIA website:
Important before starting:
- Ensure you have SSH access to the server or physical access (in case of issues)
- If a graphical interface is installed on the server, find out which display manager is used (gdm3, lightdm, sddm)
- For servers without a graphical interface, the steps for stopping the graphical server can be skipped
# Extract the archive (if the .run file was added to the archive)
tar -xzf nvidia-packages-offline.tar.gz
cd nvidia-offline-packages/drivers
# Find the .run driver file (e.g., NVIDIA-Linux-x86_64-580.XX.XX.run)
ls -la *.run
# Make the file executable
chmod +x NVIDIA-Linux-x86_64-*.run
# Determine which graphical server is used (execute one of the commands):
# Check for GNOME/GDM3:
systemctl status gdm3 > /dev/null 2>&1 && echo "Using gdm3"
# Check for LightDM:
systemctl status lightdm > /dev/null 2>&1 && echo "Using lightdm"
# Check for SDDM (KDE):
systemctl status sddm > /dev/null 2>&1 && echo "Using sddm"
# Stop the graphical server (execute ONLY one command corresponding to your display manager):
# For Ubuntu with GNOME:
sudo systemctl stop gdm3
# OR for Ubuntu with LightDM:
# sudo systemctl stop lightdm
# OR for systems with KDE:
# sudo systemctl stop sddm
# OR if there is no graphical interface, skip this step
# Install the driver (use flags for automatic installation)
sudo ./NVIDIA-Linux-x86_64-*.run \
--silent \
--no-nouveau-check \
--no-opengl-files \
--disable-nouveau
# Check the installation result (should be a success message)
echo $?
# If the graphical server was stopped, start it back up (use the same command as for stopping):
sudo systemctl start gdm3 # or lightdm/sddm depending on your system
# Reboot the server to apply the drivers
sudo reboot
If the installation failed:
- Check the logs:
sudo cat /var/log/nvidia-installer.log - Ensure the nouveau module is disabled:
lsmod | grep nouveau - Try the installation with the
--no-opengl-filesflag if the error is related to OpenGL
💡 Comments on Installing the .run File
Installer Flags:
--silent- automatic installation without interactive questions--no-nouveau-check- skips the nouveau module check (open NVIDIA driver)--no-opengl-files- does not install OpenGL libraries (important for servers without GUI)--disable-nouveau- disables the nouveau module before installation
Stopping the Graphical Server:
- This step is not required on servers without a graphical interface
- If the graphical server is not stopped, the installation may fail
- After installation, the graphical server can be started back up
Alternative Method (without stopping GUI): If stopping the graphical server is not possible, you can use a text console:
- Switch to a text console (Ctrl+Alt+F1)
- Log in
- Perform the installation of the .run file
- Return to graphical mode (Ctrl+Alt+F7 or reboot)
Checking Driver Installation
After rebooting, check the driver installation:
# Check GPU (this command should show information about the graphics card)
nvidia-smi
Expected result: You should see a table with information about the GPU, for example:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 580.XX Driver Version: 580.XX CUDA Version: 12.X |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:01:00.0 Off | N/A |
| ... |
+-----------------------------------------------------------------------------+
If the nvidia-smi command does not work or shows an error:
- Check that the driver is loaded:
lsmod | grep nvidia - Check the logs:
dmesg | grep -i nvidia - Ensure the GPU is visible to the system:
lspci | grep -i nvidia
Installing NVIDIA Container Toolkit
After successfully installing the drivers, install the Container Toolkit:
Important:
- Docker must be installed before installing the Container Toolkit
- Ensure Docker is running:
sudo systemctl status docker
# Go back to the packages directory (replace with the actual path where you extracted the archive)
# For example, if the archive was extracted in the home directory:
cd ~/nvidia-offline-packages
# Or if in another location, specify the full path:
# cd /full/path/to/nvidia-offline-packages
# Check that all files are in place
ls -la toolkit/*.deb
# Optionally: Install the GPG key (NOT required for installation via dpkg)
# GPG keys are only needed if:
# 1. You plan to use apt install instead of dpkg -i
# 2. You want to set up the repository for future updates (when internet is available)
# For simple offline installation via dpkg -i, you can skip this step
if [ -f "keys/nvidia-container-toolkit.gpg" ]; then
echo "Installing GPG key (optional)..."
sudo mkdir -p /usr/share/keyrings
sudo cp keys/nvidia-container-toolkit.gpg /tmp/nvidia-container-toolkit.gpg
sudo gpg --dearmor /tmp/nvidia-container-toolkit.gpg -o /usr/share/keyrings/nvidia-container-toolkit.gpg
sudo rm /tmp/nvidia-container-toolkit.gpg
echo "GPG key installed"
else
echo "GPG key not found - skipping installation (not critical for dpkg -i)"
fi
# Install the Container Toolkit from local packages
cd toolkit
sudo dpkg -i *.deb
# Check the installation result
if [ $? -eq 0 ]; then
echo "Container Toolkit installed successfully"
else
echo "Dependency errors detected, fixing..."
# Fix dependencies if necessary
sudo apt install --fix-broken -y
# If fix-broken did not help, check that all dependencies are downloaded
echo "Check for all dependencies in the toolkit/ directory"
ls -la *.deb
fi
# Configure Docker for GPU
sudo nvidia-ctk runtime configure --runtime=docker
# Restart Docker to apply changes
sudo systemctl restart docker
# Check that Docker is running
sudo systemctl status docker
# Check GPU installation in Docker
nvidia-smi
If there were issues with the installation:
- Check that Docker sees the GPU:
docker info | grep -i runtime - Check the configuration:
cat /etc/docker/daemon.json - Ensure nvidia-container-toolkit is installed:
dpkg -l | grep nvidia-container-toolkit - Check Docker logs:
sudo journalctl -u docker -n 50
💡 Comments on Installation on the Target Server
Installing Drivers:
dpkg -i *.deb- installs all .deb packages from the directoryapt install --fix-broken- fixes dependencies using the local package cache (if available)- Rebooting is mandatory to activate NVIDIA drivers
Installing Container Toolkit:
- When installing via
dpkg -i, GPG keys are NOT required - packages are installed directly without signature verification - GPG keys are only needed if you use
apt installor plan to set up the repository for updates dpkg -iis a simpler method for offline installation, does not require key setup
Possible Issues:
- If
apt install --fix-brokendoes not work without internet, ensure all dependencies are downloaded to the packages directory - Check the compatibility of driver and Container Toolkit versions with your version of Ubuntu/Debian
Expected result: After installation, the nvidia-smi command should show information about the GPU, and Docker containers should have access to the GPU.