# How can I use VS Code breakpoints to debug Open edX running in Tutor containers?

**URL:** https://discuss.openedx.org/t/how-can-i-use-vs-code-breakpoints-to-debug-open-edx-running-in-tutor-containers/17004
**Category:** Development
**Tags:** how-to, sumac, backend-dev, tutor
**Created:** [September 4, 2025, 2:39pm UTC](https://discuss.openedx.org/t/how-can-i-use-vs-code-breakpoints-to-debug-open-edx-running-in-tutor-containers/17004 "2025-09-04T14:39:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Yogesh](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/yogesh/32/8319_2.png) [@Yogesh](https://discuss.openedx.org/u/Yogesh)
#### Post date: [September 4, 2025, 2:39pm UTC](https://discuss.openedx.org/t/how-can-i-use-vs-code-breakpoints-to-debug-open-edx-running-in-tutor-containers/17004/1 "2025-09-04T14:39:50Z")

</div>

Hi all,

I’m running Open edX (Sumac) locally with Tutor, and I’d like to use VS Code’s inbuilt debugger with breakpoints. The challenge is that Tutor runs services (LMS, CMS, workers, etc.) inside Docker containers, so VS Code can’t directly attach like it would with a local Django project.

I know that I can use

```auto
import pdb; pdb.set_trace()

```

and then attach to the container — I’ve been doing that for quite some time already. But if I could use VS Code’s built-in debugger with proper breakpoints, that would be much nicer and more productive.

So my questions are:

1. What’s the recommended way to install a Python debugger like `debugpy` inside the Tutor dev containers (LMS, CMS, workers)?

2. How can I expose the debugger port (e.g., 5678) from the container to the host so VS Code can attach?

3. How should I configure path mappings so that breakpoints in my local `edx-platform` folder match the code running inside the container?

If anyone has a working `launch.json` setup or a Tutor plugin/override they use for this workflow, I’d really appreciate an example.

Thanks!

---

<div class="post-metadata">

### Author: ![tpayne](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/tpayne/32/9621_2.png) [@tpayne](https://discuss.openedx.org/u/tpayne)
#### Post date: [September 4, 2025, 7:05pm UTC](https://discuss.openedx.org/t/how-can-i-use-vs-code-breakpoints-to-debug-open-edx-running-in-tutor-containers/17004/2 "2025-09-04T19:05:01Z")

</div>

Hi @Yogesh . [Here is a solution](https://discuss.openedx.org/t/how-to-debug-python-code-using-vscode/8111/5) that has been shared to do this. I’ve taken that solution and adapted things to work with the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. In this scenario, VS Code can attach from within the container, so you don’t need to expose the debugger port. I’m planning on posting a write-up on it here in the forums soon and I’ll share the link when that is up.

---

<div class="post-metadata">

### Author: ![tpayne](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/tpayne/32/9621_2.png) [@tpayne](https://discuss.openedx.org/u/tpayne)
#### Post date: [September 4, 2025, 8:21pm UTC](https://discuss.openedx.org/t/how-can-i-use-vs-code-breakpoints-to-debug-open-edx-running-in-tutor-containers/17004/3 "2025-09-04T20:21:50Z")

</div>

Here is my writeup on it:

> [@Debugging with Visual Studio Code Dev Containers Extension](https://discuss.openedx.org/t/debugging-with-visual-studio-code-dev-containers-extension/17013):
>
> With the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension for Visual Studio Code (VS Code), you can have access to VS Code features within a container, which includes debugging tools. Here is an overview to help you get started debugging code in your Tutor dev environment. Initial Setup Make sure you have the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension installed (lms-vscode-remote.remote-containers). Open the VS Code Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run Dev Containers: Attach to Running Container. Select the cont…

---

<div class="post-metadata">

### Author: ![Yogesh](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/yogesh/32/8319_2.png) [@Yogesh](https://discuss.openedx.org/u/Yogesh)
#### Post date: [September 5, 2025, 7:44am UTC](https://discuss.openedx.org/t/how-can-i-use-vs-code-breakpoints-to-debug-open-edx-running-in-tutor-containers/17004/4 "2025-09-05T07:44:51Z")

</div>

Thanks a lot @tpayne

This looks really useful — I’ve been relying on `pdb.set_trace()` inside the container until now, but being able to use VS Code’s debugger directly with Dev Containers sounds much smoother. I’ll give your write-up a try and see how it works with my Tutor (Sumac) dev setup.

Really appreciate you sharing this here — it’s exactly the kind of workflow I was hoping for!
