Why a runbook is one page, not a wiki: it is read half asleep
The alert arrives at 3am. The person reading it has not had coffee and does not remember how the app is put together. They need to know what is broken, what to check first, and who to tell. A wiki with forty pages does not help them at that hour.
A runbook for a small web app should fit on one page, in plain sentences, in the order a tired person needs the answers. If it does not fit, it is probably two documents. Keep the one page for the alert, and link to anything longer.
Write it for the person who gets the message when something breaks. That may be you, or the freelancer who covers for you on Thursday. They should not need to ask you anything before they act.
Line 1: what the app is and where it runs
Start with one line that says what the app does, who uses it, and where it is hosted. Name the host, the region if your provider lets you choose one, and the URL. Add the name of the database and the file storage, if you have them.
For example: 'Client booking site for a dental practice. Runs on a single VPS with the database on the same machine. Public URL is the practice domain.' That is enough. The reader can now picture the system.
Also write where the code lives. If it is on GitHub, give the repository name and the branch that is live. Someone who has never opened the project should be able to find it without searching.
Line 2: which monitors exist and what each alert means (HTTPS monitor, heartbeat for the nightly job, error alerts)
List every monitor you have set up, one per line. For each one, write the alert it sends and what that alert means in your words. Three types cover most small apps.
An HTTPS monitor checks that the site responds. Every HTTPS monitor also checks the site's certificate and warns before it expires. By default the warnings come at 30, 14 and 7 days left, and you can change the first warning for each monitor. If the certificate warning arrives, the first job is to renew it, not to look for a fault in the code.
A heartbeat monitor is for a cron job or a backup. The job checks in each time it succeeds. If the check-in is late, you get an alert. Write down which job each heartbeat watches and what it does. For the nightly database dump, the note might say: 'If this alert fires, the backup did not run. Check the server log for the dump command before anything else.' For more on what these are for, see the post on heartbeat monitors for cron jobs and backups.
Error alerts come from your own code or from the tools you use to report errors. Note where they go, who receives them, and what a normal error looks like compared with one that needs action. Without that note, the reader cannot tell noise from a real problem.
Each monitor has a failure threshold you set. It alerts only after that many failed checks in a row. Write the threshold next to the monitor in the runbook, so the reader knows whether one failed check is already an emergency or whether they should wait for a second one. For how to choose that number, see the post on what to alert on.
Line 3: first three checks for each alert, in order
For each alert, give three checks, in the order they should be run. Keep each one short and specific. A check is something you can do in under two minutes.
For a site that will not load, the checks might be: open the URL in a private window; check whether the server responds over SSH; check the process manager for the web service and restart it if it has stopped. Put the exact command or the exact dashboard location beside each step.
For a late heartbeat, the checks might be: look at the job's log for the last run; check that the server has disk space; run the job by hand and watch what it prints. If the job is fine but the check-in did not reach AperioFlow, the problem is the notification, not the backup.
If after three checks the problem is still open, the runbook should say what to do next. That is line 4.
Line 4: who to tell and where to post the incident update
Write the names and contact details of the people who need to know, in order. Include the client contact if you run a client site, and say whether you tell them first or after you have a cause. Be specific about the channel: phone, email, or a message in a shared chat.
Then say where the incident update goes. If you run a status page, give its address and say who is allowed to post on it. A status page that customers trust is one that gets updated early and often, even when the update only says that you are looking into it. For what to put in each update, read the post on what to put in an incident update.
Alert emails from AperioFlow go only to people in your organisation. Say in the runbook who those people are, so a new team member knows they should be on that list.
Line 5: how to restore from your own backup, and where the copy is
This is the line most runbooks leave out, and the one that matters most on a bad day. Write the steps to restore the database and the files from your backup. Include the exact command, the order of the steps, and the place the backup is stored.
State the location of the backup copy in plain words. For example: 'Nightly dumps are kept on the storage bucket named in the backup script, and the last seven are retained.' Then say how to get the backup down to the server, and how to check that the restored site loads before you point the domain at it.
You can download your data from AperioFlow, and that is worth noting in the runbook if your monitoring history matters to a client. The restore steps above are about your application's backup, which is separate. Keep the two apart on the page so nobody confuses them.
Test the restore at least once before you need it. A restore you have never run is a guess.
Keep it next to the work: link the page from the project
A runbook that lives in a folder nobody opens is no use. Put a link to it in the README of the repository, in the description of the project in your task tool, and in the monitor's description if the tool allows one. When the alert arrives, the reader should be one click from the page.
If you plan work in AperioFlow, add a task called 'Update runbook' to the project, and attach the link. That way the runbook sits beside the work that changes it. The free plan includes 10 monitors and a task board, so a solo developer can keep the whole setup in one place.
Review it once a month when you tidy your monitors
Set a reminder to review the runbook once a month. Check each monitor still exists, that the alert names match what the page says, and that the people listed still work with you. Remove any monitor you no longer use, and add any new one that has appeared since the last review.
When you tidy your monitors, read the runbook at the same time. Most of the errors in old runbooks are small: a renamed job, a server that has moved, an address nobody checks. A monthly look catches them before the alert does.
Set up your monitors first, then write down what each alert means. Start free at https://app.aperioflow.co.uk/#/signup