What you’ll need
- A Compute VM instance (Ubuntu, Debian, or Fedora)
- An SSH public key added when you created the VM
- SSH access from your computer
- A user account with sudo access on the VM
How to generate and add an SSH key on macOS
How to generate and add an SSH key on Windows
How to generate and add an SSH key on Linux
Step 1 – Launch a VM
- In the Compute console, select Create.
- Choose Virtual machine.
- Pick a location and your setup (GPU or vCPU).
- Pick an OS (Ubuntu is usually the simplest choice if you don’t have a preference).
- Under Connectivity, add your SSH public key.
- Create the VM and wait until Status is Running.
Step 2 – Connect over SSH
- Go to Instances.
- Open your VM and select Connectivity options.
- Copy the SSH command and run it in your terminal.
Step 3 – Install Docker Engine
These commands follow Docker’s official installation steps for each Linux distribution. If you’re on Ubuntu/Debian, we use the apt repository method. If you’re on Fedora, we use the rpm repository method.Choose your OS below and run the matching commands.
Ubuntu 24.04 LTS (recommended)
- Remove conflicting packages (safe if they’re not installed):
- Add Docker’s GPG key and repository:
- Install Docker Engine and the Compose plugin:
- Verify:
Debian (Bookworm/Trixie)
- Remove conflicting packages:
- Add Docker’s GPG key and repository:
bookworm).
- Install Docker Engine and the Compose plugin:
- Verify:
Fedora
- Remove conflicting packages:
- Add Docker’s repository:
- Install Docker Engine and the Compose plugin:
- Start Docker:
- Verify:
Optional – Run Docker without sudo
By default, Docker commands require sudo. If you want to run Docker as your normal user, add yourself to thedocker group, then refresh your session.
docker group effectively grants root-level power on the machine. Only do this if you trust the users who have access to the VM. (This is standard Docker behavior.)
Quick sanity checks
These help confirm you have both Docker and Compose working:What’s next
- If you’re running a web UI inside Docker and can’t reach it from your browser, you’ll usually need one of these:
- open ports in Connectivity, or
- SSH port forwarding
See: [[Docs: How to forward ports to reach your web app]].
- If you want the non-technical “when Docker is worth it” overview, read:
[[Interlink: Run Docker the normal way on a Compute VM]].