This guide will help you install and use Docker to run the LLM Cost Explorer, even if you've never used Docker before.
Think of Docker as a shipping container for software. Just like a shipping container can hold any cargo and be moved anywhere, a Docker container holds an application and everything it needs to run β and works the same on any computer.
Why use Docker?
- β No need to install Python, libraries, or dependencies manually
- β Works exactly the same on Windows, Mac, and Linux
- β One command to run, one command to stop
- β Doesn't interfere with other software on your computer
-
Check System Requirements
- Windows 10 64-bit: Pro, Enterprise, or Education (Build 19041+)
- Windows 11 64-bit: Any edition
- WSL 2 enabled (Docker will help you set this up)
-
Download Docker Desktop
- Go to: https://www.docker.com/products/docker-desktop/
- Click "Download for Windows"
-
Install
- Run the downloaded installer (
Docker Desktop Installer.exe) - Follow the prompts (keep default options)
- When prompted, ensure "Use WSL 2" is checked
- Run the downloaded installer (
-
Restart Your Computer
- This is required for the installation to complete
-
Start Docker Desktop
- Find "Docker Desktop" in your Start menu and open it
- Wait for it to start (you'll see a whale icon in your system tray)
- The first start may take a few minutes
-
Verify Installation
- Open Command Prompt or PowerShell
- Type:
docker --version - You should see something like:
Docker version 24.0.6
-
Check Your Mac's Chip
- Click the Apple menu β "About This Mac"
- Note whether you have an Intel or Apple Silicon (M1/M2/M3) chip
-
Download Docker Desktop
- Go to: https://www.docker.com/products/docker-desktop/
- Click "Download for Mac"
- Choose the version for your chip (Intel or Apple Silicon)
-
Install
- Open the downloaded
.dmgfile - Drag Docker to your Applications folder
- Open Docker from Applications
- Open the downloaded
-
Grant Permissions
- macOS will ask for permission to install networking components
- Enter your password when prompted
-
Wait for Docker to Start
- You'll see a whale icon in your menu bar
- Wait until it stops animating (this means Docker is ready)
-
Verify Installation
- Open Terminal (Applications β Utilities β Terminal)
- Type:
docker --version - You should see something like:
Docker version 24.0.6
# Update package index
sudo apt-get update
# Install prerequisites
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
# Add your user to the docker group (so you don't need sudo)
sudo usermod -aG docker $USER
# Log out and back in for the group change to take effect
# Then verify:
docker --version| Concept | Analogy | Description |
|---|---|---|
| Image | Recipe | A blueprint with all instructions to build the app |
| Container | Cake | A running instance created from the image |
You can create many containers from one image, just like you can bake many cakes from one recipe.
| Command | What it does |
|---|---|
docker build |
Creates an image from a Dockerfile (like writing a recipe) |
docker run |
Starts a container from an image (like baking the cake) |
docker ps |
Shows running containers |
docker stop |
Stops a running container |
docker images |
Lists all images on your computer |
Option A: Download ZIP
- Go to https://github.com/dlwhyte/AgenticAI_foundry
- Click the green "Code" button
- Click "Download ZIP"
- Extract the ZIP file to a folder you'll remember (e.g.,
Documents/AgenticAI_foundry)
Option B: Clone with Git (if you have Git installed)
git clone https://github.com/dlwhyte/AgenticAI_foundry.gitWindows:
- Press
Win + R, typecmd, press Enter - Or search for "Command Prompt" in the Start menu
- Or search for "PowerShell" (recommended)
Mac:
- Press
Cmd + Space, type "Terminal", press Enter - Or go to Applications β Utilities β Terminal
Linux:
- Press
Ctrl + Alt + T - Or search for "Terminal" in your applications
# Windows (Command Prompt)
cd C:\Users\YourName\Documents\AgenticAI_foundry
# Windows (PowerShell) - same as above
cd C:\Users\YourName\Documents\AgenticAI_foundry
# Mac/Linux
cd ~/Documents/AgenticAI_foundryTip: You can drag the folder onto the terminal window to paste the path!
This creates the image (downloads dependencies, sets everything up). Only needed once.
docker build -t agenticai-foundry .-t agenticai-foundrygives the image a name.tells Docker to look in the current folder for the Dockerfile
This will take 2-3 minutes the first time (it's downloading Python and libraries).
You'll see lots of output. Wait until you see:
Successfully built xxxxxxxxxx
Successfully tagged agenticai-foundry:latest
docker run -p 8501:8501 agenticai-foundry-p 8501:8501connects port 8501 on your computer to port 8501 in the container
You'll see output like:
You can now view your Streamlit app in your browser.
URL: http://0.0.0.0:8501
Open your web browser and go to:
http://localhost:8501
π You should see the LLM Cost Explorer!
When you're done, go back to the terminal and press:
Ctrl + C
This stops the container.
- Cause: Docker isn't installed or terminal was opened before installation
- Solution:
- Make sure Docker Desktop is installed
- Close and reopen your terminal
- On Windows, try restarting your computer
- Cause: Docker Desktop isn't running
- Solution:
- Open Docker Desktop application
- Wait for the whale icon to stop animating
- Try the command again
- Cause: Another app (or another container) is using that port
- Solution: Use a different port:
Then open
docker run -p 8502:8501 agenticai-foundry
http://localhost:8502instead
- Cause: Trying to pull an image that doesn't exist
- Solution: Make sure you're building, not pulling:
docker build -t agenticai-foundry .
- Cause: First-time download of Python and libraries (~500MB)
- Solution: This is normal for the first build. Subsequent builds are much faster due to caching.
- Cause: You're not in the right directory
- Solution: Make sure you
cdinto the folder containing theDockerfile:cd path/to/AgenticAI_foundry ls # Should show Dockerfile, Home.py, etc.
- Cause: Browser cache
- Solution: Hard refresh with
Ctrl + Shift + R(Windows/Linux) orCmd + Shift + R(Mac)
# See running containers
docker ps
# See all containers (including stopped)
docker ps -a
# Stop a container
docker stop <container_id>
# Remove a container
docker rm <container_id>
# See all images
docker images
# Remove an image
docker rmi agenticai-foundry
# Rebuild without cache (if you need a fresh build)
docker build --no-cache -t agenticai-foundry .
# Run in background (detached mode)
docker run -d -p 8501:8501 agenticai-foundry
# View logs of a background container
docker logs <container_id>
# Stop all running containers
docker stop $(docker ps -q)If you want to free up disk space later:
# Remove the container (after stopping it)
docker rm $(docker ps -a -q --filter ancestor=agenticai-foundry)
# Remove the image
docker rmi agenticai-foundry
# Remove all unused Docker data (careful!)
docker system pruneβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DOCKER QUICK START β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. Open terminal β
β 2. cd AgenticAI_foundry β
β 3. docker build -t agenticai-foundry . β
β 4. docker run -p 8501:8501 agenticai-foundry β
β 5. Open http://localhost:8501 β
β 6. Ctrl+C to stop β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Docker Documentation: https://docs.docker.com/get-started/
- Streamlit Documentation: https://docs.streamlit.io/
- Course Discussion Forum: Post your question with any error messages
MIT Professional Education: Agentic AI