Skip to content

Latest commit

 

History

History
156 lines (108 loc) · 3.45 KB

File metadata and controls

156 lines (108 loc) · 3.45 KB
title Docker Setup
description Install Docker Engine for dstack services
section Prerequisites
stepNumber 3
totalSteps 7
lastUpdated 2026-01-09
prerequisites
ssl-certificate-setup
tags
docker
containers
prerequisites
difficulty beginner
estimatedTime 10 minutes

Docker Setup

This tutorial guides you through installing Docker Engine on your TDX server. Docker is required for the Local Key Provider and Local Docker Registry.

What You'll Install

Component Purpose
docker-ce Docker Engine (Community Edition)
docker-ce-cli Docker command-line interface
containerd.io Container runtime
docker-buildx-plugin Extended build capabilities
docker-compose-plugin Multi-container orchestration

Prerequisites

Before starting, ensure you have:

Manual Installation

Step 1: Check if Docker is Already Installed

docker --version

If Docker is already installed, you can skip to Verification.

Step 2: Install Prerequisites

sudo apt update
sudo apt install -y ca-certificates curl gnupg

Step 3: Add Docker GPG Key

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc > /dev/null
sudo chmod a+r /etc/apt/keyrings/docker.asc

Step 4: Add 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 "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Step 5: Install Docker Packages

sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Step 6: Start Docker Service

sudo systemctl start docker
sudo systemctl enable docker

Step 7: Add User to Docker Group

This allows running Docker commands without sudo:

sudo usermod -aG docker $USER

Important: Log out and back in for the group membership to take effect, or run:

newgrp docker

Verification

Check Docker is Running

docker info

You should see detailed information about the Docker installation.

Check Docker Version

docker --version

Expected output:

Docker version 27.x.x, build xxxxxxx

Test Docker

docker run hello-world

This downloads and runs a test image. You should see:

Hello from Docker!
This message shows that your installation appears to be working correctly.

Troubleshooting

For detailed solutions, see the Prerequisites Troubleshooting Guide:


Next Steps

With Docker installed, proceed to:

Additional Resources