
A runbook is the document you want open when something has to be done right, often under pressure: a deployment, a failover, a certificate renewal, a 3 a.m. alert. A good runbook lets anyone on the team carry out the procedure correctly, even if they've never done it before. A bad one sends them to Slack to ask the one person who knows.
This guide covers what a runbook should contain, how to write the steps, what to do with commands and screenshots, and how to keep runbooks trustworthy. There's a template for a deployment runbook at the end.
Runbook, playbook or SOP?
The terms overlap, and teams use them differently. A common split:
| Document | Answers | Example |
|---|---|---|
| Runbook | "How do I carry out this specific operation?" | Deploy the API to production |
| Playbook | "How do we respond to this kind of situation?" | Responding to a security incident |
| SOP | "What's the approved way to do this routine task?" | Monthly access review |
A playbook often links to several runbooks. During an incident, the playbook says "fail over the database", and the failover runbook says exactly how.
What every runbook needs
- Title: the operation, verb first. "Deploy the payments service to production."
- Purpose and when to use it: one or two sentences, including the alert or event that triggers it.
- Owner and last tested date: who maintains it and when someone last ran it.
- Impact and risk: what users will notice, expected downtime, what could go wrong.
- Prerequisites: access, roles, tools, approvals, maintenance windows.
- Pre-checks: what to verify before starting.
- Procedure: numbered steps, with commands and expected output.
- Verification: how to confirm it worked.
- Rollback: how to undo it, and when to decide to.
- Escalation: who to contact if it goes wrong, and how.
The last three are the ones most often missing, and the ones you need most when something breaks.
Write steps for someone under pressure
People use runbooks when they're stressed, tired or new. Write for that reader.
- One action per step, numbered.
- Say what to expect after each important step: "The command prints
deployment "api" successfully rolled out." If they see something else, they know to stop. - Make decision points explicit: "If the health check fails, stop and go to Rollback." Don't make people improvise.
- Mark dangerous steps clearly: "Warning: this deletes the old database. Confirm the backup finished in step 4 first."
- Avoid "obviously" and "just". If it were obvious, they wouldn't need the runbook.
- Link to dashboards and tools directly instead of describing where to find them.
Put commands in text, not screenshots
Commands belong in code blocks people can copy. Never put a command only in a screenshot: it can't be copied, searched or diffed, and one mistyped character can do damage.
Good command steps include:
- the exact command, in a code block
- what to substitute, with placeholders in a clear format like
<RELEASE_TAG> - where to run it (which machine, which directory, which context or environment)
- the expected output, or the important line of it
Example:
5. Check that you're pointed at the production cluster:
```bash
kubectl config current-context
```
Expected output: `prod-us-east-1`. If you see anything else, stop.
Use screenshots for consoles and dashboards
Plenty of operations happen in a web console or a GUI: a cloud provider's console, a load balancer setting, a feature-flag dashboard, a CI pipeline's manual approval button. For those steps, a screenshot with the right button highlighted prevents mistakes, especially in consoles with dozens of similar options.
- One screenshot per step that changes the screen.
- Highlight the control, and crop out unrelated parts of the console.
- Blur or crop account IDs, keys and internal hostnames if the runbook is shared widely.
- Retake screenshots when the console changes. Cloud consoles change often.
Always include rollback
Every runbook that changes something should say how to undo it, written at the same level of detail as the procedure. Include the point of no return, if there is one: "After step 9, the old version can't be restored automatically. Restore from the backup instead."
Also say when to roll back. "If error rates stay above 2% for five minutes after the deploy, roll back" is better than leaving it to judgment at 3 a.m.
Test runbooks before you need them
A runbook nobody has run is a guess. Test them:
- Have someone other than the author run it, ideally the newest person on the team, in staging.
- Run critical runbooks on a schedule, such as quarterly failover drills.
- Update the "last tested" date each time, and fix what didn't match.
- Review after every incident. If the runbook was wrong or missing a step, fix it as part of the follow-up.
Keep them where people will find them
Store runbooks somewhere searchable and reachable during an outage. If your wiki goes down with your production systems, that's a problem. Many teams keep runbooks in the same repository as the code, in Markdown, so changes are reviewed like code. Link each alert to its runbook so the on-call engineer lands on the right page.
Deployment runbook template
Title: Deploy [service] to production
Purpose: Release a new version of [service]. Use for every
production release.
Owner: [team or person] Last tested: [date]
Impact: [User-visible effect, expected downtime]
Risk: [What could go wrong]
Prerequisites
- Access: [roles, clusters, consoles]
- Approval: [who approves, where]
- Window: [allowed times]
Pre-checks
1. Confirm the release passed CI: [link]
2. Confirm the database backup completed: [command or link]
3. Announce the deploy in [channel]
Procedure
1. [Command or action]
Expected: [output or what you see]
2. ...
Verification
1. Check the health endpoint: [command] -> expect 200
2. Check error rate on [dashboard link] for 10 minutes
Rollback
Roll back if: [clear condition]
1. [Command or action]
2. Verify: [how]
Escalation
- First: [on-call rotation or person, how to reach]
- Then: [team lead]
Capture the console steps faster
Command steps are quick to document: you paste the command and its output. Console and GUI steps are slower, because each one needs a screenshot taken, cropped and highlighted, and retaken when the console changes.
If you work on a Mac, Steppr can handle those parts. You do the operation once in the console while it records. Each click becomes a numbered step with a screenshot, named after the real button or field, and you can blur account IDs or keys before sharing. Copy the steps as Markdown and paste them into your runbook in Notion, Confluence, GitHub or your docs editor, screenshots included. Steppr records clicks and keystrokes, so keep the actual terminal commands as text in code blocks, as described above.
Frequently asked questions
How detailed should a runbook be?
Detailed enough that someone who has never done the operation, but has the right access, can complete it without asking for help. If you'd have to explain a step out loud, write the explanation down.
Should runbooks be automated?
Automate what you can, and keep the runbook. The runbook then documents how to run the automation, what to check, and what to do when the automation fails.
What format should a runbook use?
Any format your team can search and edit quickly. Markdown in a Git repository, a wiki page in Confluence or Notion, or your incident tool's runbook feature all work. Consistency matters more than the tool.
For routine procedures that aren't operations, see how to write an SOP. For mapping a whole process before writing it down, see how to document a process.