Open Laboratory Docs
GPU Virtual Machine
Documentation

Deploy on a GPU Virtual Machine

Use this provider-neutral path for an NVIDIA GPU VM with a supported Linux distribution. The commands below target Ubuntu 22.04 or newer.

No inbound ports or firewall rules are needed — Laboratory OS uses an outbound tunnel. You can block all inbound traffic entirely.

1. Create the VM

Choose an NVIDIA GPU, an Ubuntu image, and a region near the people who will use the workstation. Some providers require a GPU quota request before the VM can be created.

Choosing a GPU: More VRAM lets you run larger models — 16 GB handles most image generation, 24-48 GB covers mid-size LLMs, and 100 GB+ is needed for large LLMs.

Allocate at least 100 GB of storage. 200+ GB recommended if you plan to download multiple models or LLMs.

Keep inbound firewall rules closed. If you need SSH for setup, allow TCP 22 from your IP only. The VM still needs outbound network access for image downloads, package installation, and your selected remote-access method.

2. Install the host dependencies

Connect with the username and method shown by your provider, then install Docker:

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker

Verify:

docker run --rm hello-world

If you see “Hello from Docker!”, the installation was successful.

Check whether the provider image already includes a working NVIDIA driver:

nvidia-smi

If that command fails because no driver is installed, install one:

Note: GPU-optimized cloud images often include a driver. Run nvidia-smi first — if it works, skip this section.

sudo apt-get update
sudo apt-get install -y ubuntu-drivers-common
sudo ubuntu-drivers autoinstall
sudo reboot

After reboot, confirm the driver is loaded:

nvidia-smi

You should see your GPU listed with its driver version and VRAM.

Troubleshooting: If nvidia-smi is not found after install, make sure you have rebooted — the reboot after ubuntu-drivers autoinstall is required. If you see a Driver/library version mismatch error, reboot to resync the driver and CUDA library versions.

Install NVIDIA Container Toolkit so Docker can pass the GPU through:

# Add the NVIDIA package 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

# Install
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit

# Configure Docker runtime and restart
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

Verify:

docker run --rm --gpus all nvidia/cuda:12.0-base-ubuntu22.04 nvidia-smi

If you see nvidia-smi output inside the container, everything is set up correctly.

Troubleshooting: If you see could not select device driver “nvidia”, run sudo nvidia-ctk runtime configure --runtime=docker followed by sudo systemctl restart docker. If the GPU is visible on the host but not inside the container, make sure you are passing --gpus all to docker run.

3. Run Laboratory OS

The managed-Uplink example below creates a durable workspace volume and restarts after a VM reboot. See Run Laboratory OS for self-hosted Uplink and Tailscale alternatives.

docker run -d --restart unless-stopped \
  --gpus all \
  --pid host \
  --name laboratory \
  -e UPLINK_DEVICE_TOKEN='your-device-token' \
  -v laboratory_os_workspace:/workspace \
  openlaboratoryorg/laboratory-os

Check the container logs for the assigned Laboratory URL. It appears once the selected remote-access method is ready, usually within the first 30 seconds:

docker logs laboratory

In device-token mode, the instance also appears under Tunnels and Devices in the Uplink console, and access is gated by the owning Uplink account. On a self-hosted edge, use the lab access token printed during boot. On Tailscale, access is governed by your tailnet ACLs.

4. Operate it

  • Stop the VM when it is not in use, after checking how the provider bills for stopped compute and attached storage.
  • Keep the named /workspace volume or copy it before deleting the VM. See Persistence.
  • To update Laboratory OS, pull the new image and recreate the container with the same name, credentials, and workspace volume.
  • Keep the host OS, Docker, and NVIDIA driver patched.
Search across 15 pages.
↑↓ navigate openEsc close