Skip to content

Chrome Remote Debugging — Complete Guide

DodaTech Updated 2026-06-24 3 min read

In this tutorial, you'll learn about Chrome Remote Debugging. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.

Hook

You start Chrome with --remote-debugging-port=9222 and try to connect from another instance or a DevTools frontend like chrome://inspect. The page shows "No devices detected" or "Connection refused." You know it should work but nothing appears.

The Wrong Way

Starting Chrome with --remote-debugging-port=9222 but also running a separate Chrome instance for regular browsing — only one Chrome instance can bind to a given debugging port.

# BAD: Multiple Chrome instances on the same port
google-chrome --remote-debugging-port=9222 &
google-chrome --remote-debugging-port=9222 &
Second Chrome instance: "Unable to attach — port already in use"
Only the first instance is debuggable
The second instance uses a random port

Multiple Chrome instances cannot share the same debugging port.

The Right Way

Use a single Chrome instance and verify the debugging endpoint.

# 1. Close all Chrome instances
killall chrome
# 2. Start Chrome with remote debugging enabled
google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug
# 3. Verify the debugging endpoint is accessible
curl -s http://localhost:9222/json/version | python3 -m json.tool
{
    "Browser": "Chrome/126.0.0.0",
    "User-Agent": "Mozilla/5.0 ...",
    "webSocketDebuggerUrl": "ws://localhost:9222/devtools/browser/abc123"
}
# 4. Check chrome://inspect on your regular Chrome
# Open chrome://inspect → "Discover network targets" → Configure
# Add: localhost:9222
# 5. For remote debugging over the network:
# Start Chrome with --remote-debugging-address=0.0.0.0 (use carefully)
# Ensure port 9222 is not blocked by firewall
# 6. Connect with standalone DevTools frontend
# https://chrome-devtools-frontend.appspot.com/
# Or use VS Code's "Debug: Open Link" with ws://localhost:9222/... URL
chrome://inspect shows the remote instance ✓
DevTools connects to all tabs ✓

Prevention

  • Use a dedicated user data dir for remote debugging (--user-data-dir=/tmp/chrome-debug).
  • Keep the debugging session isolated from your main browsing profile.
  • Close the debugging Chrome instance when not in use.
  • Use --remote-debugging-address=127.0.0.1 (default) for local debugging only.
  • Check system firewall rules if connecting from another machine.

Common Mistakes with remote debugging

  1. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
  2. Using return to exit a function early instead of wrapping a pure value in the monad
  3. Mixing let bindings with <- bindings in do notation, producing type errors

These mistakes appear frequently in real-world CHROME code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

What is Chrome remote debugging used for?

Remote debugging allows you to inspect and debug web pages running in one Chrome instance from another instance, VS Code, or a dedicated DevTools window. It is essential for testing mobile sites and debugging WebView applications.

Can I debug Android Chrome from desktop?

Yes — connect the Android device via USB, enable USB debugging on the phone, and open chrome://inspect on the desktop. Chrome discovers the device and lists its tabs automatically.

Is remote debugging secure?

Any process on the same machine can connect to the debugging port. Do not enable --remote-debugging-address=0.0.0.0 on a shared or public network. Use SSH port forwarding for remote debugging over the internet.


DodaTech — remote debugging without the remote hassle.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro