Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

On-Call and Incident Response Runbook

By Kokil Thapa | Last reviewed: August 2026

When a production Laravel application fails at 2 AM, the difference between a five-minute fix and a four-hour outage is usually documentation. An effective On-Call and Incident Response Runbook transforms panic into procedure by providing exact commands, decision trees, and escalation paths before the alert even fires. Without this structured knowledge base, engineers waste critical minutes guessing server paths or searching Slack history while users experience downtime.

I have maintained production web systems since 2010, and I can confirm that memory is not a valid operational strategy. Whether you are running a high-traffic WooCommerce store or a legal-tech portal like Laravel applications serving Nepal-based clients, fatigue will erase your mental notes during an emergency. The runbook bridges the gap between "I think I fixed this last time" and "Here is the exact command to restore service." This guide covers building a runbook specifically for PHP/Laravel stacks, grounded in real deployment workflows using Deployer 7, GitLab CI, and Ubuntu servers.

What should be included in an On-Call and Incident Response Runbook?

A functional runbook is not a generic wiki page; it is an executable checklist designed for high-stress environments. In my experience managing infrastructure for eCommerce platforms and legal service portals, every entry must pass the "3 AM test": can a tired engineer execute this safely without reading three other documents? For Laravel 12.x and modern PHP 8.4 stacks, your runbook needs five non-negotiable components.

  1. Alert Definition and Severity Matrix: Clearly distinguish between P1 (site down, payment gateway failing) and P3 (admin dashboard slow). Define what constitutes a "wake-up" event versus a "morning triage" task.
  2. Immediate Triage Commands: Copy-pasteable commands to check system health. Do not link to documentation; embed the actual artisan or systemctl commands.
  3. Architecture Context: A simplified diagram showing how Nginx, PHP-FPM, Redis, and MySQL interact. When queues back up, engineers need to know if the bottleneck is the worker count or the database connection limit.
  4. Rollback and Mitigation Procedures: Specific steps to revert the last deploy via Deployer or disable a feature flag. Mitigation (restoring service) always takes precedence over root cause analysis.
  5. Escalation Contacts and Access: Verified phone numbers for senior engineers, hosting providers, and third-party API vendors. Include links to credential vaults, never passwords directly.

For teams managing multiple sites on shared infrastructure—a pattern I use for several sister sites deployed via GitLab CI—the runbook must also specify environment isolation. Confusing the staging database with production during an incident is a catastrophic but preventable error. Always prefix critical commands with explicit environment checks.

Runbook Core ComponentsAlert TriggerTriage ChecklistLogs • Metrics • StatusMitigation StepsRollback • Restart • ScaleEscalation PathVendor • Senior • DBADiagnostic CommandsRecovery VerificationCommunication TemplatePost-Incident Review
Core components of an On-Call and Incident Response Runbook flow from alert trigger through mitigation to post-incident review

How do you write effective runbook commands for Laravel production debugging?

The most common failure mode in runbooks is vagueness. "Check the logs" is useless when the engineer does not know whether you use daily rotation, single-file logging, or syslog. For Laravel 12 applications running on Ubuntu 24.04 with PHP-FPM, precision saves time. Every command in your On-Call and Incident Response Runbook must be tested against the current production environment, not your local Valet setup.

Essential Diagnostic Commands

Include these exact commands in your runbook, adjusted for your specific Deployer release paths. On a standard zero-downtime deployment, the active release symlink is typically /var/www/project/current.

# Verify current release path and deployment timestamp
ls -la /var/www/project/current
cat /var/www/project/current/.env | grep APP_ENV

# Check Laravel-specific health endpoints (if configured)
curl -s https://example.com/up | jq .

# Tail application logs with context
tail -n 100 /var/www/project/current/storage/logs/laravel.log | grep -i "error\|exception"

# Inspect PHP-FPM process pool status
systemctl status php8.4-fpm
journalctl -u php8.4-fpm --since "10 minutes ago" --no-pager

# Check queue worker health and stuck jobs
php /var/www/project/current/artisan queue:monitor --timeout=60
redis-cli llen queues:default

# Validate database connectivity without running migrations
php /var/www/project/current/artisan db:show --counts=users,orders

A frequent mistake I encounter during CI/CD pipeline audits is outdated runbook commands referencing old PHP versions. If you upgraded from PHP 8.3 to 8.4 last month but the runbook still says php8.3-fpm, the on-call engineer will waste minutes troubleshooting a service that no longer exists. Version pinning in documentation is as important as version pinning in composer.json.

Queue and Cache Emergency Procedures

Laravel queues are often the first component to degrade under load. Your runbook needs explicit restart procedures that respect graceful shutdowns. Simply killing workers can corrupt job payloads.

# Gracefully restart all queue workers after deployment
php /var/www/project/current/artisan queue:restart

# Force-stop stuck workers (last resort only)
pkill -f "queue:work"
supervisorctl restart laravel-worker:*

# Flush application cache without clearing sessions
php /var/www/project/current/artisan config:clear
php /var/www/project/current/artisan route:clear
php /var/www/project/current/artisan view:clear

# Verify Redis memory pressure
redis-cli info memory | grep used_memory_human

Always document the expected output of healthy commands. If redis-cli llen queues:default normally returns 0-50 but currently shows 15,000, that is your smoking gun. Without baseline expectations, metrics are just noise.

How should incident severity levels be defined for PHP web applications?

Severity definitions must be tied to business impact, not technical symptoms. A 500 error on an admin report page is technically identical to a 500 error on the checkout endpoint, but operationally they are worlds apart. For eCommerce clients using WooCommerce or custom Laravel carts, I define severity based on revenue exposure and user-facing functionality.

SeverityBusiness ImpactResponse TimeExample Scenarios
P1 — CriticalRevenue loss, data breach, complete service outageImmediate (24/7 wake-up)Payment gateway timeout, database corruption, SSL certificate expiry, homepage 500 errors
P2 — HighMajor feature broken, significant user friction< 1 hour during business hoursSearch broken, email notifications failing, admin panel inaccessible, slow page loads (>5s)
P3 — MediumMinor feature issue, workaround available< 4 hours / next business dayImage upload failing for specific formats, export CSV formatting wrong, non-critical webhook delays
P4 — LowCosmetic, internal tooling, no user impactScheduled maintenance windowTypos in admin UI, deprecated deprecation warnings, log verbosity adjustments

This matrix prevents alert fatigue. If every notification triggers a P1 response, engineers stop responding to real emergencies. For Nepal-based businesses operating on tighter budgets, clearly defining P2 vs P3 helps manage expectations about after-hours support costs. A client paying Rs 15,000/month (~USD 110) for maintenance should understand that cosmetic fixes wait until Monday morning, while payment failures get immediate attention.

Severity Decision TreeAlert ReceivedIs revenue or data at risk?YESNOP1 CRITICALWake up immediatelyCore feature broken?YESNOP2 HIGHRespond within 1 hourP3/P4Next business day• Page stakeholders• Start incident channel• Begin mitigation NOW• RCA after recovery
Decision tree for classifying incident severity in an On-Call and Incident Response Runbook based on business impact

How do you handle incident communication and stakeholder updates?

Technical resolution is only half the job. Stakeholders do not care about your strace output; they want to know when service will restore and what they should tell customers. Pre-written communication templates eliminate the cognitive load of drafting messages while debugging. In my work with legal-tech clients where trust is paramount, transparent communication during outages preserves relationships more than pretending nothing happened.

Status Update Templates

Maintain these templates in your runbook with placeholders clearly marked. Adapt tone for your audience—internal teams get technical detail, clients get business impact.

## INITIAL ACKNOWLEDGMENT (within 15 min of P1)
Subject: [INCIDENT] Service degradation detected — {SERVICE_NAME}
Status: Investigating
Impact: {USER_FACING_SYMPTOM}
Started: {TIMESTAMP_NPT}
Next update: {TIMESTAMP + 30 MIN}

We are aware of {SYMPTOM} affecting {SCOPE}. 
Engineering is actively investigating. 
No ETA yet — we will update in 30 minutes.

## PROGRESS UPDATE (every 30-60 min)
Status: {INVESTIGATING | IDENTIFIED | MITIGATING | RECOVERING}
Current action: {WHAT_WE_ARE_DOING_NOW}
ETA: {ESTIMATE_OR_UNKNOWN}
Workaround: {IF_AVAILABLE}

## RESOLUTION NOTICE
Status: Resolved
Duration: {START_TIME} to {END_TIME} ({TOTAL_MINUTES} min)
Root cause: {ONE_SENTENCE_SUMMARY}
Prevention: {FOLLOW_UP_ACTION_PLANNED}

Service is fully restored. Post-incident review scheduled for {DATE}.

For Nepal-based operations, consider bilingual updates if your client's customer base includes non-English speakers. Also account for local business hours and festivals—an incident during Dashain may require different communication cadences than a regular Tuesday. Link these templates to your server security and monitoring documentation so the on-call engineer has full context.

What belongs in a post-incident review for Laravel applications?

The post-incident review (PIR), sometimes called a post-mortem, is where organizational learning happens. Without it, you will fix the same bug three times in six months. A PIR is not a blame session; it is a structured analysis of systemic failures. For Laravel applications, focus on actionable improvements to code, configuration, or process.

PIR Document Structure

  • Timeline: Minute-by-minute account from first alert to full recovery. Use timestamps from monitoring tools, not memory.
  • Impact Quantification: Orders lost, users affected, revenue estimate. For a WooCommerce florist site, "23 failed checkout attempts during peak Valentine's window" is more useful than "checkout was down."
  • Root Cause Analysis: Use the "Five Whys" technique. "Queue failed" → Why? → "Redis OOM" → Why? → "Memory limit too low" → Why? → "Never tuned after traffic doubled" → Why? → "No capacity review process."
  • Action Items: Concrete tasks with owners and deadlines. "Increase Redis maxmemory" is better than "monitor Redis better." Link each item to a Jira ticket or GitLab issue.
  • Runbook Updates: What was missing or wrong in the current runbook? This section closes the feedback loop.

Schedule PIRs within 48 hours of P1 incidents while memories are fresh. For distributed teams across time zones, record the session for async review. The goal is updating the On-Call and Incident Response Runbook so the next incident is faster, cheaper, and less stressful.

Post-Incident Feedback LoopIncident OccursP1/P2 Alert FiresRunbook UsedTriage + MitigationService RestoredMTTR RecordedPost-Incident ReviewWithin 48 HoursAction Items CreatedCode • Config • ProcessRunbook UpdatedNew Commands AddedFEEDBACK LOOPOutcome: Faster MTTR Next TimeReduced Stress • Higher Reliability
Feedback loop showing how post-incident reviews continuously improve the On-Call and Incident Response Runbook

Start Building Your Runbook Before the Next Outage

An On-Call and Incident Response Runbook is not a document you write once and archive. It is a living artifact that evolves with your application, your team, and your infrastructure. Start small: pick your top three recurring alerts and document them thoroughly this week. Test the commands during a quiet period. Share the draft with whoever covers your next on-call shift and ask what is missing. For teams managing Laravel applications, WooCommerce stores, or legal-tech platforms in Nepal or globally, this discipline compounds into reliability over months and years.

If your production environment lacks structured incident response procedures, or if your current runbook is outdated and untested, reach out through my contact page. I help teams build practical, maintainable operational documentation grounded in real production experience—not theoretical frameworks that collapse under pressure. Whether you need a full runbook audit, deployment pipeline hardening, or hands-on incident response training for your developers, we can scope an engagement that fits your operational reality and budget.

Frequently Asked Questions

A documented procedure guiding engineers through detecting, triaging, mitigating, and resolving production incidents. It includes escalation paths, diagnostic commands, rollback steps, and communication templates to reduce mean time to recovery during outages.

Small teams lack redundant staffing, so tribal knowledge fails when the primary engineer is unavailable. A runbook ensures any competent developer can stabilize production systems at 3 AM using verified steps rather than guessing under pressure or relying on memory.

Initial creation takes 20-40 hours for core services, roughly Rs 75,000-150,000 (USD 550-1,100) at senior Nepal rates. Ongoing maintenance requires 4-8 hours monthly as infrastructure evolves, costing Rs 15,000-30,000 (USD 110-220) per month.

Every runbook needs severity definitions, escalation contacts with phone numbers, initial triage checklists, service-specific diagnostic commands, approved mitigation procedures, rollback instructions, stakeholder communication templates, and post-incident review requirements. Missing any section creates gaps that cause delays during actual emergencies when stress is high and cognitive load exceeds normal capacity.

Test quarterly via tabletop exercises simulating real failures. Update immediately after every production incident, infrastructure change, or dependency upgrade. In my experience maintaining Laravel applications on shared EC2 infrastructure, runbooks stale for six months become unreliable because PHP versions, Deployer configs, and database schemas drift from documented state without deliberate synchronization efforts.

GitLab CI pipelines trigger alerts via webhook to Slack or email. PagerDuty or Grafana OnCall handle escalation scheduling. Store runbooks in Git repositories alongside code for version control. For Nepal Gift Card and similar projects, I use GitLab issues as incident tickets linked to runbook commits, ensuring documentation stays synchronized with actual deployment configurations and rollback procedures.

Document php-fpm restart commands, queue worker recovery via supervisorctl, Redis cache flush procedures, and database connection troubleshooting. Include artisan commands for checking scheduled tasks and failed jobs. Specify log file paths under storage/logs and common error patterns like token mismatch or migration failures. Always verify these commands work on your exact Ubuntu and PHP-FPM configuration before documenting them as authoritative recovery steps.

Use three tiers. SEV1 means complete service outage affecting all users requiring immediate response. SEV2 indicates degraded functionality impacting significant user segments needing resolution within four hours. SEV3 covers minor issues with workarounds available, resolved next business day. Avoid five-tier systems designed for enterprises; they create confusion and slow triage decisions when small teams face production pressure at odd hours.

Document provider-specific status page URLs, API health check endpoints, and webhook verification steps. Include manual reconciliation procedures for eSewa, Khalti, or ConnectIPS when callbacks fail. Specify when to switch to backup gateways versus waiting. On WooCommerce florist sites processing international payments, I maintain separate runbooks for each gateway because Stripe timeout handling differs completely from local Nepal payment provider error responses and retry logic.

Vague instructions like "check the server" instead of exact SSH commands. Outdated credentials or deprecated tool references. Missing rollback procedures after failed deployments. Assuming reader knows internal architecture. Runbooks written once then abandoned. Effective runbooks read like executable scripts with copy-pasteable commands, current version numbers, and explicit decision trees that guide exhausted engineers through recovery without requiring architectural knowledge they may lack.

Implement follow-the-sun rotation if possible, otherwise limit on-call to one week monthly maximum. Compensate with time off after overnight incidents. Automate repetitive diagnostics via monitoring alerts with contextual data. Set clear severity thresholds preventing unnecessary wake-ups. In my experience supporting legal-tech portals, defining SEV3 as next-business-day resolution prevented 80% of false alarms while maintaining genuine emergency coverage for critical client-facing services.

Track mean time to acknowledge, mean time to resolve, and incident recurrence rate. Measure percentage of incidents resolved using runbook versus ad-hoc troubleshooting. Monitor on-call page frequency and false positive rates. After implementing structured runbooks for Adventure Third Pole Trek booking system, MTTR dropped from 90 minutes to 25 minutes because engineers stopped rediscovering diagnostic steps during each outage and followed validated procedures instead.

WordPress runbooks focus on plugin conflicts, theme errors, wp-cli commands, and database repair via WP-CLI. Laravel runbooks emphasize queue workers, job failures, artisan commands, and framework-specific caching. WordPress incidents often resolve via plugin deactivation; Laravel requires understanding service container bindings and middleware stacks. Both need database backup restoration steps, but Laravel migrations add complexity absent in WordPress content management workflows and update cycles.

Yes. Pre-write status page updates, email notifications, and social media posts for each severity level. Legal-tech clients especially need compliant language avoiding liability admission while maintaining transparency. Templates reduce decision fatigue during crises when crafting careful wording competes with technical troubleshooting. Include placeholders for incident timeline, affected services, estimated resolution time, and post-mortem commitment. Review templates quarterly with stakeholders to ensure tone matches current brand voice and regulatory requirements.

Never store passwords, API keys, or tokens in runbook documents. Reference environment variables or secrets managers like HashiCorp Vault or AWS Secrets Manager. Use placeholder syntax indicating where credentials inject at runtime. For Deployer-based deployments, document how to access shared .env files securely via SSH rather than embedding connection strings. Audit runbook access logs quarterly. Rotate any credential accidentally committed to version control immediately and treat the exposure as a security incident requiring its own response procedure.

Share this article

Quick Contact Options
Choose how you want to connect me: