
Docker is a workhorse. It’s also opinionated about the kind of environment it wants. It expects you can install system packages, run a background daemon, manage users and permissions, and keep state in a predictable place. That’s why a virtual machine (VM) is the clean path on Compute when your workflow depends on Docker.
If you’re still deciding between runtimes, read this first: [[Interlink: VM or container: how to choose in 60 seconds]]. If you want the short announcement and the “what changed” overview, start here: Compute now supports virtual machines (VMs).
A container instance is designed to run your workload inside a managed environment. That’s perfect when you’re running a single app, a script, or a standard model setup. It gets awkward when Docker itself becomes part of the environment.
A VM gives you the missing pieces: sudo access, system packages, services, and the “this behaves like a normal Linux host” baseline that Docker expects. For most teams, that means less time on workarounds and fewer surprises later.
Use Docker on a Compute VM when you’re doing any of the following:
If your goal is simply “run one workload,” skip Docker and use a Compute container instance. It’s usually simpler. VM or container: how to choose in 60 seconds
You only need two things to get going:
If you already have a Compose stack, this is a good moment to note which ports it needs. You’ll use that in the Connectivity settings when you create the VM. If you don’t know yet, keep things closed and open ports later when you’re ready.
In the console:
If you want the canonical “click-by-click” reference, use: Compute quickstart or Launch and connect to your first Compute instance.
Use this guide for the exact install steps on Ubuntu, Debian, or Fedora: Install Docker on a Compute VM.
Once Docker is installed, you can treat your VM like any other Docker host: pull images, run containers, and use docker compose for stacks.
A common failure mode is “it runs, but I can’t reach it.”
When that happens, check two things:
If you want the plain-English version of “SSH vs HTTPS vs TCP vs UDP,” use this: SSH, HTTPS, TCP, UDP: how to expose a service from a Compute VM. If you’re forwarding a local port to use a web UI, this doc is the reliable reference: How to forward ports to reach your web app.
Yes. Use a virtual machine. A VM gives you the OS-level control Docker expects. VM or container: how to choose in 60 seconds
No. If you just want to run a single workload, a Compute container instance is usually the simplest route. Docker becomes useful when you need multi-service stacks, Compose, or tooling that assumes Docker exists.
That’s a normal path. Create a VM with the same region and hardware class, redeploy your workload, and treat it as a “graduation” to OS-level control. When it’s worth switching from a container instance to a VM
If Docker is part of how you ship work, don’t fight your runtime. Launch a VM, install Docker once, run your stack, and keep moving.