Lesson 0: Before the Terminal
FreeWhat this is and why it matters
This lesson is the setup step: it gets your computer ready before any real lab begins.
Without it, every later lab fails at the first step, because the tools it needs are not installed or not running.
You will learn the basic words, install one free program, run two quick checks that prove it works, and run your first container.
This lesson is for a true beginner. If you have never used a terminal, never installed Docker, and do not know what Linux or Ubuntu is, start here. Do this lesson first. The order for the whole kit is in the box below — read it before you start.
Think of it like this. You want to cook in a new kitchen. First you need a stove that works. This lesson is switching the stove on and checking the flame. The cooking comes later.
One idea per step. Do the steps in order. Do not skip ahead.
The order for the whole kit — read this first
Do the kit in this order. Do not bounce between packs.
- Lesson 0 first. It teaches the words, installs Docker, and runs your first container.
- If Lesson 0 felt hard, or you have never used a terminal before, do Phase 2 next. Phase 2 teaches Linux, Git, and Docker from zero.
- Then do Phase 1. Its labs use the terminal and Docker you now have.
If you hold only Phase 1: do Lesson 0, then the Phase 1 labs in order. You do not need Phase 2 to start. If you hold only Phase 2: do Phase 2 in order. You do not need Phase 1 to start. Phase 1 comes after, when you want the data tier.
1. What these words mean
Read these first. Every word below is used in the steps that follow, and none of them is explained again later.
Computer. The machine on your desk or in your lap. It runs programs, stores your files, and shows you the screen.
Operating system. The main program that runs your computer. It starts when you switch the machine on. It lets your other programs use the screen, the keyboard, and the files. Windows and macOS are operating systems.
Linux. An operating system, like Windows and macOS, but free and open. Many servers run Linux. You do not need to learn Linux to start this kit. You only need to know the word.
Ubuntu. One version of Linux. It is the most common version people start with. When a guide says "Ubuntu", it means a computer running this version of Linux.
Terminal. A window where you type commands instead of clicking. It looks plain: a dark or white window with a line of text waiting for you to type. Every command in this kit runs in a terminal.
Command. One line of typed text that tells the computer to do one thing. For example, docker --version is a command. It asks Docker to tell you which version it is. You type it, press Enter, and the computer answers.
Docker. A free program that runs other programs for you, each one in its own sealed box. You install Docker once. Then every lab in this kit runs inside Docker.
Container. One sealed box that Docker runs. A container holds one program and everything that program needs. When you stop the container, the program stops. When you start it again, the program starts again.
Image. The recipe Docker uses to build a container. An image is a saved copy of a program, ready to run. Docker downloads the image once, then builds containers from it. For example, the image postgres:16-alpine is the recipe for a PostgreSQL record store. The 16 is the version number of PostgreSQL. The word alpine means a small, light version of the recipe.
Docker Desktop. The version of Docker you install on Windows and Mac. It is a normal app with an icon. You open it, and it runs Docker in the background for you.
WSL. Short for Windows Subsystem for Linux. It is a built-in part of Windows that lets Linux programs run on Windows. You do not set it up yourself. The Docker installer sets it up for you.
Git. A tool that keeps track of changes to files. You do not need to learn Git in this lesson. You only need one small part of it on Windows: Git Bash, the terminal that comes with Git.
Git Bash. A terminal program for Windows that comes with Git for Windows. It understands the kit's commands. PowerShell is a different Windows terminal. The kit's commands do not work in PowerShell, so do not use PowerShell for this kit.
Port. A numbered door on your computer. Programs listen at doors. When a lab says "PostgreSQL is on port 5432", it means the record store answers at door number 5432 on your own machine. Two programs cannot use the same door at the same time.
File. One saved thing: a lesson, a picture, a list of orders. A file has a name, like docker-compose.yml.
Folder. A place that holds files, like a drawer holds papers. A folder has a name, like kafka-lab. Folders can hold other folders too.
Compose. A tool that starts several containers together from one file. That file is called docker-compose.yml. It is the list of containers for one lab.
Daemon. A background program that keeps running without a window. When an error says "cannot connect to the Docker daemon", it means Docker Desktop is not running yet, so there is no background Docker program to talk to.
cd. Short for "change directory". The command that moves your terminal into a folder. For example, cd phase1 moves your terminal into the phase1 folder. You type it, press Enter, and you are inside that folder. To go back up one folder, type cd .. and press Enter. The two dots mean "the folder above this one".
The kit. The set of folders and lesson files you downloaded for this course. After you unzip it, the Phase 1 part lives in a folder called phase1.
What you need before Step 1
- A computer running Windows or Mac. This lesson gives steps for Windows and Mac only. It gives no Linux install steps. If you use Linux, open the Docker docs link in Step 2 (https://docs.docker.com/get-started) and follow the Linux install steps there.
- A web browser.
- Internet, to download Docker.
- The kit zip file, downloaded and unzipped. This lesson does not give the zip file name, because it can change. After unzipping, look in your Downloads folder for a folder called
phase1. That is where your work happens.
Do not pay for anything in this lesson. Docker Desktop is free for the personal use in this kit.
Step 1 — Open a terminal
What this is: a terminal is the plain window where you will type every command in this kit.
Why we do it first: without an open terminal, you have nowhere to type the checks in Steps 3 and 4.
On Windows
First install Git for Windows, because Git Bash is your terminal.
- Open your web browser and go to the Git for Windows download page at https://gitforwindows.org — that is the official download page. Do not download Git from any other site.
- Download it, open the downloaded file, and follow the installer. Accept the normal choices it offers.
- Then find Git Bash in the Start menu and open it.
- Run every command in this kit in Git Bash, not in PowerShell.
What "accept the normal choices" means: the installer shows a series of screens with a Next button. Keep the choices it already picked, and keep clicking Next until it finishes. You do not need to change any setting.
Why Git Bash and not PowerShell: the kit's commands use for loops and .sh script files. A for loop is a command that repeats another command several times. A .sh file is a saved list of commands for the bash program. PowerShell is a different Windows terminal that does not understand those commands, so they fail there. Git Bash understands them.
On Mac
Open the Terminal app. You can find it in Applications, inside the Utilities folder. Or press Command and Space together, type Terminal, and press Enter.
Step 2 — Install Docker Desktop
What this is: Docker Desktop is the app that installs Docker on your computer.
Why we install it: every lab in this kit runs inside Docker containers. Without Docker, no lab can start.
On Windows
- Open your web browser and go to the Docker website at https://docs.docker.com/get-started — that page links to the official Docker Desktop download. Do not download Docker from any other site.
- Download Docker Desktop for Windows.
- Open the downloaded file and follow the installer. Accept the normal choices it offers, as in Step 1: keep the choices it already picked, and keep clicking Next until it finishes.
- The installer sets up WSL for you. WSL is a built-in part of Windows that lets Linux programs run on Windows. You do not need to set it up yourself.
- Restart your computer if the installer asks you to. If it does not ask, do not restart.
- Open Docker Desktop from the Start menu. Wait until it says it is running. The first start takes a few minutes. "Running" means the Docker Desktop window shows it is started, and its small icon in the bottom-right corner of your screen is steady, not flashing or showing an error.
- Leave Docker Desktop running in the background while you do the labs. If you close it, Docker stops, and the labs stop working. If a lab suddenly stops working, check first whether Docker Desktop is still open — if it closed, open it again, wait until it says it is running, and try the lab step again.
On Mac
- Open your web browser and go to the Docker website at https://docs.docker.com/get-started — that page links to the official Docker Desktop download.
- Download Docker Desktop for Mac. Pick the download that matches your Mac: Apple chip, or Intel chip. If you do not know which one you have, click the Apple menu, then "About This Mac", and read the chip name. If the chip name starts with "Apple M1", "Apple M2", or "Apple M3", pick the Apple chip download. If it says "Intel", pick the Intel chip download.
- Open the downloaded file and follow the installer. Accept the normal choices it offers, as in Step 1.
- Open Docker Desktop from your Applications folder. Wait until it says it is running. The first start takes a few minutes. "Running" means the Docker Desktop window shows it is started.
- Leave Docker Desktop running in the background while you do the labs. If you close it, Docker stops, and the labs stop working. If a lab suddenly stops working, check first whether Docker Desktop is still open.
Step 3 — Check Docker itself
What this is: a check command that asks Docker to tell you which version it is.
Why we run it: if Docker answers with a version number, Docker is installed. If it answers with an error, Docker is not installed or not running yet, and you must fix that before any lab.
Type this in your terminal, then press Enter:
docker --versionWord by word:
docker— the Docker tool.--version— "tell me your version number".
What you should see, line by line:
Docker version 27.5.1, build 9f9e405Docker version 27.5.1— the version number of Docker on this machine. Your number will be different. That is fine. Your number may also be newer than 27.5.1 — a newer number is fine too.build 9f9e405— a short code that names the exact build of that version. Your code will be different. That is fine.- What matters: a version number appears, and no error appears. That means Docker is installed.
If it breaks:
command not found— Docker is not installed. Go back to Step 2 and install it.Cannot connect to the Docker daemon— Docker Desktop is not running yet. Open Docker Desktop and wait until it says it is running, then try the command again.
Step 4 — Check Compose
What this is: Compose is the tool that starts several containers together from one file. You met the word in section 1. Every lab uses Compose to start its containers.
Why we run it: if Compose is missing or too old, the labs cannot start.
Type this in your terminal, then press Enter:
docker compose versionWord by word:
docker— the Docker tool.compose— the part of Docker that starts several containers together from one file.version— "tell me your version number".
What you should see, line by line:
Docker Compose version v2.32.4-desktop.1Docker Compose version v2.32.4-desktop.1— the version number of Compose. Your number will be different. That is fine.- What matters: a version number appears, and no error appears.
If it breaks:
- Any error right after you installed Docker: Docker Desktop may still be starting. Wait one minute and try again.
compose is not a docker command— your Docker is too old. Update Docker Desktop to the newest version, then try again.
If both Step 3 and Step 4 show a version number, Docker is ready.
Step 5 — Run your first container
What this is: one command that downloads a tiny test program called hello-world and runs it once, inside a sealed box.
Why we run it: this is the proof that Docker really works — not just installed, but able to download a program and run it. Until now you have only asked Docker its version. This step makes Docker do its real job: run a container.
A hello-world image is a tiny test program. It does one thing: it prints a greeting, then stops. It is the smallest possible container. It costs nothing and takes seconds.
Type this in your terminal, then press Enter:
docker run hello-worldWord by word:
docker— the Docker tool.run— "download the image if I do not have it yet, then start a container from it and run it now". Different fromup, which starts the long-running boxes listed in a file.runstarts one box, once, from one image name.hello-world— the name of the test image. It is Docker's own tiny test program.
What Docker does, in order: it looks for the hello-world image on your machine. It is not there yet, so Docker downloads it from Docker Hub — the public place where ready-made images live. Then Docker builds a container from it, runs the test program inside the box, and the program prints its greeting. Then the container stops, because its job is done. A container that has finished its job stopping is normal — it is not an error.
What you should see, line by line:
Hello from Docker!
This message shows that your installation appears to be working correctly.Hello from Docker!— the test program ran. Docker works.This message shows that your installation appears to be working correctly.— Docker is telling you, in its own words, that the install works.- After those two lines Docker prints a longer list of the steps it just took — contacting Docker, downloading the image, running it. You do not need to read every line. The two lines above are the proof.
If it breaks:
Cannot connect to the Docker daemon— Docker Desktop is not running yet. Open Docker Desktop and wait until it says it is running, then try again. This is the same fix as in Step 3.- A line about
pull access deniedorno such host— Docker could not reach the internet to download the image. Check your internet connection, wait a minute, and try again. The image is tiny, so a second try usually works.
If Step 5 worked, you have run your first container. You can see it listed as finished with docker ps -a. ps -a means "list all boxes, including ones that already stopped". The hello-world box shows as Exited. That is correct — it printed its greeting and stopped. The labs from here on run bigger containers the same way — docker run for one box, Compose for several boxes together.
Step 5a — After install: what breaks on real machines
What this is: four problems that appear after Docker is installed, on real machines, even when Steps 3, 4, and 5 all passed.
Why we put it here: installing Docker is the easy part. What an intermediate does not know yet is how to tell the difference between "Docker is broken" and "Docker is fine, something else is wrong". Each block below is one such difference. Read them now; you will need them in the first lab that fails.
1. The version check passes, but Docker is not running
docker --version only asks the Docker tool on your machine for its version number. It never talks to the daemon — the background program that actually runs containers. So a version number with no error means "installed". It does not mean "running".
docker ps is different: it asks the daemon to list the running boxes, so it DOES talk to the daemon. If docker --version works and docker ps fails with Cannot connect to the Docker daemon, Docker is installed but not running. Open Docker Desktop, wait until it says it is running, and try again.
Diagnostic: run docker version — no dashes, no extra word. It prints two parts: Client (the tool you just typed with) and Server (the daemon in the background). If the Client part prints and the Server part shows an error, the tool works and the daemon is down. That one line tells you which half of Docker is broken.
2. "Permission denied" on the Docker socket (Linux only)
On Linux you may see this error:
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sockA socket is a named meeting point on your machine where two programs talk to each other. This error means your user account is not allowed to talk to Docker through that meeting point. It does NOT mean Docker is broken, and reinstalling Docker will not fix it.
Quick test: run the same command with sudo in front of it. sudo means "run this as the superuser", the account that is allowed to do anything. If the command works with sudo, Docker is fine and permission is the problem.
The real fix: add your user account to the docker group. A group is a list of user accounts that share one permission. The command is:
sudo usermod -aG docker $USERWord by word: usermod — "change a user account". -aG docker — "add to the group called docker". $USER — your own account name. After running it, log out of your computer and log back in, so the new permission takes effect. Then try the Docker command again without sudo.
What the fix means — read this before you run it: anyone in the docker group can start a container, and a container can be told to read any file on the machine. So joining the group is nearly the same as having full control of the machine. On your own computer that is fine. On a shared or work machine, ask first. And never "fix" this by typing sudo before every Docker command forever: it works, but every file the container creates then belongs to the superuser, not to you, and that causes confusing permission errors later.
This error does not happen on Windows or Mac with Docker Desktop — there Docker already runs as your own user. If you see it, you are on Linux.
3. Two Composes: docker compose and docker-compose
docker compose (with a space) is the current Compose, built into Docker. docker-compose (with a dash) is the old separate program, version 1. They are two different programs with almost the same name. The kit uses docker compose with a space, in every lab.
If docker compose version fails but docker-compose --version prints a version number starting with 1., you have only the old one. Update Docker Desktop (or Docker, on Linux) instead of rewriting the kit's commands with a dash. If the two commands print very different version numbers, Docker was installed twice — for example once from your system's app store and once from Docker Desktop. Remove one, so every lab talks to the same Docker.
4. Your disk fills up quietly
Every image you download stays on your machine until you delete it. The lab images are big, and after a few labs they add up. If a lab fails with no space left on device, this is the cause — not the lab.
Check first, with this command:
docker system dfWord by word: docker system — "tell me about Docker itself". df — "disk free", how much space is used. It shows how much space your images, containers, and saved data use, and how much of it can be reclaimed.
The fix is:
docker system pruneprune means "delete the things nothing uses": stopped containers, unused networks, and images no container uses. Run it only BETWEEN labs, never in the middle of one: it deletes stopped containers, and a stopped lab container's data goes with it. If you are mid-lab, finish or reset the lab first.
Step 5b — How to read a version line as a diagnostic
docker --version prints one line with two parts: a version number and a build code. Here is how to read it as a check, not just a number:
- A version number appears at all — Docker is installed. No number, only an error — Docker is not installed, or not on the path. That is the Step 3 check.
- The number itself — compare it with the number in Step 3. Your number will be different, and a newer number is fine. A much OLDER number is a warning, not a pass: old Docker may not understand a new Compose file, and the lab will fail later with a strange error. Update before the lab.
- The build code (the short code after the word
build) — ignore it. It only names the exact build, and it is useful only when you report a bug. docker compose version— the number should start withv2. If it starts with1., that is the old separate Compose program from Step 5a, block 3. Update Docker instead of rewriting commands.
Step 6 — Find your way around the phase1 folder
What this is: a tour of the folders you unzipped, so you know where everything lives.
Why we do it: every lab tells you to "go into the lab folder". If you do not know the folder names, you cannot follow that instruction.
After you unzip the kit, you get a folder called phase1. Open it. Inside it you will see:
- Lesson files, one per topic. Their file names are:
start-here.md,lesson-0.md,kafka-lab.md,postgresql-lab.md,redis-lab.md,object-store-lab.md,load-balancer-lab.md,end-to-end-lab.md, anderror-decoder.md. The lesson file names end in.md. That means they are plain text lesson files. When a lab says "look up the error in the error decoder", it means open the file phase1/error-decoder.md and find your error message there. - One folder called
portfolio. It holds a README template and blank proof forms. When a lab says "save your proof", the proof goes inphase1/portfolio/proof/. The proof files live in that folder; the templates there end in-TEMPLATE.txt. - One folder per lab:
phase1/kafka-lab,phase1/postgresql-lab,phase1/redis-lab,phase1/object-store-lab,phase1/load-balancer-lab, andphase1/end-to-end. - Inside
phase1/postgresql-labthere is one more folder,phase1/postgresql-lab/patroni, for the Patroni part of that lab. - Each lab folder has a file called
docker-compose.yml. That file is the list of containers for that lab. You do not need to read it or change it. The lab steps tell you the commands to run in each folder. - Two helper scripts:
phase1/kit-doctor.shandphase1/reset.sh. A script is a saved list of commands in one file.kit-doctor.shchecks your machine — the next step says what it does.reset.shwipes one lab's data and starts it fresh. It is used at the end of a lab or a drill, when the lab tells you to run it, from thephase1folder, like this:bash reset.sh kafka-lab.
Do your work inside the phase1 folder. When a lab says "go into the lab folder", it means: open your terminal, move into that folder, and run the commands there. Moving into a folder is the next step's first command.
Step 7 — Move into the phase1 folder
What this is: cd moves your terminal into a folder.
Why we run it: the doctor script in Step 8 lives in the phase1 folder. Your terminal must be inside that folder before you can run it.
First, move your terminal to where you unzipped the kit. If the phase1 folder is in your Downloads folder, you would first move into Downloads, then into phase1. For example, if you unzipped the kit in Downloads, type this first, then press Enter:
cd ~/Downloads~ means your home folder, so ~/Downloads is the Downloads folder inside it. Then move into phase1 as below. This lesson does not give your exact starting folder, because it depends on where you unzipped the kit. Find the phase1 folder on your machine first, then move into it.
Type this, then press Enter, once you are in the folder that holds phase1:
cd phase1Word by word:
cd— short for "change directory". It moves your terminal into a folder.phase1— the name of the folder to move into.
What you should see: nothing special. Your terminal line now shows you are inside phase1. That is normal. To go back up one folder, type cd .. and press Enter. The two dots mean "the folder above this one".
Step 8 — Run the kit doctor script
What this is: kit-doctor.sh is a saved list of checks. It checks Docker, the numbered doors (ports) the labs need, free disk space, and free memory.
Why we run it: it finds setup problems before you start a lab, and it prints a plain-English FIX line that tells you what to do for each problem.
Type this in your terminal, while you are inside the phase1 folder, then press Enter:
bash kit-doctor.shWord by word:
bash— the program that runs script files. It reads the script and runs its commands one by one.kit-doctor.sh— the name of the script file. It lives in thephase1folder. That is why you must be insidephase1first.
What you should see, line by line:
OK: Docker command found.
OK: Docker Compose works.
OK: Docker is running.
OK: Port 5432 is free (needed by postgresql-lab).
OK: Disk space is fine (about 12 GB free).
OK: Memory is fine (about 8 GB free right now).- Each line starts with
OK:— that one check passed. Port 5432 is free— door number 5432 is not used by any other program, so the PostgreSQL lab can use it. Door 5432 is the door the PostgreSQL record store listens on. If another program were already using door 5432, the PostgreSQL lab could not start, because two programs cannot use the same door at the same time.Disk space is fine (about 12 GB free)— your numbers will be different. What matters is the wordOK, not the exact number.Memory is fine (about 8 GB free right now)— your numbers will be different. What matters is the wordOK, not the exact number.- How to tell it worked: every line starts with
OK:. If every line saysOK, your machine is ready.
Your run will show more port lines than the example above. The script checks 12 doors in total: 9092 and 9094 (Kafka lab), 5432 and 5433 (PostgreSQL lab, main and standby), 6379 and 6380 (Redis lab, main and second store), 9000 and 9010 (object store lab, first and second store), 8080 (load balancer lab), and 2379, 8008 and 8009 (Patroni lab). Each one prints its own OK line. At the very end it prints one last line:
All OK - your machine is ready for the labs.If it breaks:
No such file or directory— you are not inside thephase1folder. Runcd phase1first, then try again.- A line starting with
FIXinstead ofOK— that one check failed. Do what the FIX line says, then run the script again.
Step 9 — If you get stuck
Do these three steps, in order.
- Run the doctor script again, as in Step 8. It prints a FIX line for each problem.
- Look up the error in the error decoder. Copy the error message from your terminal, find it in the file phase1/error-decoder.md, and follow the fix it gives.
- Email support@promptstudioai.in with the exact error line and the step you were on. The team replies within 24 hours.
If Lesson 0 worked — both version checks showed a number, and the doctor script showed OK on every line — you are ready for Phase 1. Start with phase1/start-here.md.
What this lesson does NOT cover
- Linux install steps. This lesson gives none. Use the Docker docs link in Step 2 for Linux.
- What to do if Docker Desktop asks for a paid plan. This lesson does not cover it. Do not pay for anything in this lesson.
- Any lab after this one. Each lab has its own lesson.
Quick check — try it yourself
Question: In the terminal, type: docker --version — what exact version line appears?
Open the practice terminal to test this →
Show answer
You should see Docker version 27.5.1, build 9f9e405 (on your own computer, the version number may be different).