Get a real database running for your tests in minutes — Docker Desktop, step by step
Before we start
Your tests need a real database to run against — and a fresh, identical one every time, without installing Postgres by hand on every machine. One command gives you exactly that.
Spin up Postgres with one command — no manual install
Throw the container away, start a clean one — locally and in CI
The database lives in the container, not your OS
Your laptop, a teammate's, the CI server — no "works on mine"
Open your browser and head to the official Docker Desktop download page.
Click Download for Windows. It grabs the installer — a single .exe file, a few hundred MB.
Open your Downloads folder and double-click the file you just got.
The installer offers to use the WSL 2 backend. Leave it checked — it's what lets Docker run Linux containers on Windows.
Choose how Docker Desktop should run on your machine.
Let it install, then click Close. Docker Desktop may ask you to restart Windows to finish setting up WSL 2 — go ahead.
Docker Desktop is installed. A restart is required to complete setup.
Launch Docker Desktop from the Start menu. Wait for the whale icon in the system tray to go steady — that means the engine is running.
Open PowerShell and run the two "hello world" checks of Docker.
hello-world prints its greeting, you're done — everything works.Now you can spin up a real database for your tests — with one command
docker run postgres — a fresh Postgres at a known addressdocker-compose.yml and a GitHub Actions service container