Remote debugging in Heroku
Discover how to easily set up remote debugging for your Node.js app on Heroku, and diagnose issues like a pro with our step-by-step guide!
Author

Date

Book a call
Table of Contents
Hey there, fellow coder! Have you ever wished you could just step through your Node.js app running on Heroku like a local app? Well, grab your favorite drink and get comfy because we’re about to embark on a fun journey to set up remote debugging on Heroku!
Why Remote Debugging?
Debugging is a crucial part of development, ensuring your app runs smoothly and efficiently. Remote debugging is especially important when your app is deployed on a server, allowing you to diagnose issues that only appear in a deployed environment.
Prerequisites
Before we jump in, make sure you have:
- A Node.js application deployed on Heroku.
- The Heroku CLI installed on your machine.
Debugging Steps
Step 1: Enable Remote Debugging
First, we need to enable remote debugging for your Node.js app. Heroku uses the inspect flag to allow remote debugging.
- Modify Your
Procfile: Add the--inspectflag to yourProcfile. It should look something like this:
2. Deploy Changes to Heroku: Commit your changes and push to Heroku:
Step 2: Open a Remote Debugging Session
Now that your app is configured, it’s time to connect to the remote debugger.
- Restart Your Heroku App: Restarting ensures the
inspectflag is applied:
2. Forward Debugging Port: Forward traffic on a local port to a port inside a dyno; in this case both the local port and dyno port are 9229:
Step 3: Connect Your Debugger
With the SSH tunnel set up, you can now connect your favourite debugger.
Using VS Code
- Open VS Code: Launch VS Code and open your project.
- Configure Debugger: Add a new configuration in your
launch.json:
3. Start Debugging: Select the "Attach to Heroku" configuration and start debugging. Set breakpoints, inspect variables, and step through your code like in a local environment.
Using IntelliJ IDEA / Webstorm
- Open Run Config: Open your IDE and go to
Run > Edit Configurations. - Configure Debugger: Click the
+button and selectAttach to Node.js/Chrome:

3. Start Debugging: Select your newly created Node.js Remote Debug configuration, Click the debug icon and start debugging. Set breakpoints, inspect variables, and step through your code like in a local environment.
And there you have it! You’ve just set up remote debugging for your Node.js app on Heroku. High five! Debugging in the cloud just became a whole lot cooler, right? If you hit any bumps along the way, double-check your SSH tunnel and configurations. Happy debugging!
Related Articles.
More from the engineering frontline.
Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

Apr 6, 2026
How We Built an AI System That Automates Senior Solution Architect Workflows
Discover how we built a 4-agent AI co-pilot that converts complex RFPs into draft technical proposals in 15 minutes — with built-in conflict detection, assumption surfacing, and confidence scoring.

Apr 6, 2026
AI Code Healer for Fixing Broken CI/CD Builds Fast
A deep dive into how GeekyAnts built an AI-powered Code Healer that analyzes CI/CD failures, summarizes logs, and generates code-level fixes to keep development moving.

Apr 2, 2026
A Real-Time AI Fraud Decision Engine Under 50ms
A deep dive into how GeekyAnts built a real-time AI fraud detection system that evaluates transactions in milliseconds using a hybrid multi-agent approach.

Apr 1, 2026
Building an Autonomous Multi-Agent Fraud Detection System in Under 200ms
GeekyAnts built a 5-agent fraud detection pipeline that makes decisions in under 200ms — 15x cheaper than single-model systems, with full explainability built in.

Mar 31, 2026
Building a Self-Healing CI/CD System with an AI Agent
When code breaks a pipeline, developers have to stop working and figure out why. This blog shows how an AI agent reads the error, finds the fix, and submits it for review all on its own.

Mar 26, 2026
Maestro Automation Framework — Advanced to Expert
Master Maestro at scale. Learn architecture, reusable flows, CI/CD optimization, and how to eliminate flakiness in production-grade mobile automation.Master Maestro at scale. Learn architecture, reusable flows, CI/CD optimization, and how to eliminate flakiness in production-grade mobile automation.