use Winpdb. It is a platform independent graphical GPL Python debugger with support for remote debugging over a network, multiple threads, namespace modification, embedded debugging, encrypted communication and is up to 20 times faster than pdb.

Features:

  • GPL license. Winpdb is Free Software.
  • Compatible with CPython 2.3 through 2.6 and Python 3000
  • Compatible with wxPython 2.6 through 2.8
  • Platform independent, and tested on Ubuntu Gutsy and Windows XP.
  • User Interfaces: rpdb2 is console based, while winpdb requires wxPython 2.6 or later.


(source: winpdb.org)

winpdb-reborn ยท PyPI

GitHub - bluebird75/winpdb: Fork of the official winpdb with improvements

Answer from nosklo on Stack Overflow
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ howto โ€บ remote_debugging.html
Remote debugging attachment protocol โ€” Python 3.14.4 documentation
This protocol enables external tools to attach to a running CPython process and execute Python code remotely. Most platforms require elevated privileges to attach to another Python process. Disabli...
๐ŸŒ
JetBrains
jetbrains.com โ€บ help โ€บ pycharm โ€บ remote-debugging-with-product.html
Remote Debugging with PyCharm | PyCharm Documentation
Click on the toolbar, and from the list of available configurations, select Python Debug Server. Enter the name of this run/debug configuration โ€“ let it be MyRemoteServer. Specify the Port number (here 12345) and the IDE host name (here 192.168.106.73) of the machine where the IDE is running. These parameters will be used by the remote debug server to access it.
๐ŸŒ
Visual Studio Code
code.visualstudio.com โ€บ docs โ€บ python โ€บ debugging
Python debugging in VS Code
November 3, 2021 - This starts the package myproject using python3, with the remote computer's private IP address of 1.2.3.4 and listening on port 5678 (you can also start the remote Python process by specifying a file path instead of using -m, such as ./hello.py). Local computer: Only if you modified the source code on the remote computer as outlined above, then in the source code, add a commented-out copy of the same code added on the remote computer. Adding these lines makes sure that the source code on both computers matches line by line. #import debugpy # Allow other computers to attach to debugpy at this IP address and port.
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ visualstudio โ€บ python โ€บ debugging-python-code-on-remote-linux-machines
Debug Python code on remote Linux computers - Visual Studio (Windows) | Microsoft Learn
December 11, 2025 - Use Visual Studio to debug Python code running on remote Linux computers, including necessary configuration steps, security, and troubleshooting.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ what is the point of debugging on a remote machine if you have the source file locally?
r/learnpython on Reddit: What is the point of debugging on a remote machine if you have the source file locally?
May 4, 2024 -

By reading this article about debugging over SSH, I was wondering what is the point of setup such a machinery when you have a local copy of myscript.py ? Why not debugging myscript.py locally?

Wouldn't remote debugging makes sense if myscript.py is only present on the remote machine but I want to debug it from a local machine?

Top answer
1 of 7
11
Didn't read the article, but in general, this is simply because your development environment is most likely completely different to either the production environment, or the endpoint environment. There's a funny saying/joke where a manager comes over to a developer and tells him that there's something wrong with their app, because it doesn't work on the customers device. "Well, it works on my computer" the developer replies, to which the manager says, "Well John, we're not going to give them your computer are we?!" Say you're developing on a Unix machine and using curses, but then your client tries to run your tool on windows, and curses breaks, because it requires windows curses and you didn't know that. So, what are you going to do? You'll keep running the file in your environment, and it all works well! You'd be scratching your head and potentially never figure it out, having no error message to rely on, it will always work for you, unless you figure out that you should build a windows VM environment and try it there, only at which point you'd figure out that curses is the culprit. Are you going to ask the customer to note down the errors for you? Are you going to ask them to be sending screenshots and then you sending an alternative script, and ask them for more screenshots? Well that would be horrendously unprofessional. An alternative to all this is connecting to the client endpoint via ssh and running the tool to see what's going on. If your tool integrates logging, that would make it much easier to debug.
2 of 7
4
The overall environment that the script is running on may be completely different than the machine you are trying to debug it from. Your dev machine has a ton of things on it that a remote, production machine will not.
Top answer
1 of 4
19

I have resolved this issue. If anyone wants to do remote development and debugging, follow below steps:

  1. Install remote ssh extension in VS code
  2. Once installed, you will find a green icon on the bottom left corner in vs code which allows us to connect to the remote machine.
  3. Connect to the remote machine using the standard ssh command. Alternatively, you can use ssh-keygen to generate a public-private key if you don't want to use the password at every prompt.
  4. Once you are connected to remote machine, you can open the file explorer and create any python file. When you will save this, it will get saved in your remote machine. This way you are using your machine to remotely develop code on another remote machine.
  5. Good thing about vs code is that it selects the remote machine's python interpreter so all the packages which you have installed on your remote machine will work with IntelliSense.
  6. In order to debug the code, we will use debugpy. Install this on both machine (remote & local)
  7. On your remote machine, run below command:

python3 -m debugpy --listen 1.2.3.4:5678 --wait-for-client app.py

here 1.2.3.4 is the IP of remote machine. This will start a remote debugger which will wait for a clients connection.

  1. On your local machine, in VS code open Run & Debug, add a configuration of Python: Remote Attach. Make sure that launch.json has the host as the IP of your remote machine and port as 5678.
  2. Now start debugging as normal and you will notice the code will break at first breakpoint and from here you can proceed normally as we used to do in local debugging process.

TBH, this is best feature VS code has because most of the software allows you to do remote development which is nothing but just a normal SSH but remote debugging gives you more control. I was doing some python project on Raspberry Pi and obviously cannot install VS code or pycharm on it. But with this feature now I can easily develop the code using Pi's python interpreter and debug it as well.

If anyone is having any issues, let me know. Happy to help.

2 of 4
4

It is frustrating there are so many out-dated instructions how to remote debug Python scripts from VSC.

As of August 2024 there is a far easier way to set this up that answers the OP's question which involved VSC being installed on a laptop and debugging a Python script saved on a Raspberry Pi also in the same LAN.

Once you have installed the Remote SSH extension on your local machine use that to SSH via VSC in to your remote machine. Now install the Python Debugger extension on your remote system.

Since you have ssh'd in to that remote system via the VSC extension VSC just debugs the script on that remote system as though it is LOCAL.

  1. Place a breakpoint (red dot) on the line you want script execution to stop at.
  2. From File Menu > Run > Start Debugging (F5)... The Command Palette will open and it will say:
  3. Select Debugger <-- Choose Python Debugger
  4. Then choose...
  5. Python File Debug the currently active Python File.
  6. Now use F10, F11 etc to step through the lines of code.

You DO NOT need to...

  • Do ssh local port forwarding.
  • Separately install debugpy from the command line in your local and remote environments.
  • Run debugpy from the command line.
  • Have a copy of the Python script in your local environment AND another on the remote environment. You only need ONE copy in the remote environment.
  • You don't even need a launch.json.

I checked about what sockets were opened by separately ssh'ing from a Terminal in to the "remote system" (my Raspberry Pi running Ubuntu) and they are all localhost.

ubuntu@ubuntu:~$ lsof -i
COMMAND     PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
code-f1e1 76603 ubuntu    9u  IPv4 519530      0t0  TCP localhost:43675 (LISTEN)
code-f1e1 76603 ubuntu   12u  IPv4 519534      0t0  TCP localhost:43675->localhost:34540 (ESTABLISHED)
python    77190 ubuntu    4u  IPv4 520559      0t0  TCP localhost:39819 (LISTEN)
python    77190 ubuntu    8u  IPv4 522535      0t0  TCP localhost:45381 (LISTEN)
python    77190 ubuntu    9u  IPv4 521557      0t0  TCP localhost:45381->localhost:59082 (ESTABLISHED)
python    77190 ubuntu   11u  IPv4 521558      0t0  TCP localhost:35979->localhost:37454 (ESTABLISHED)
python    77218 ubuntu    3u  IPv4 520157      0t0  TCP localhost:37454->localhost:35979 (ESTABLISHED)
python    77228 ubuntu    3u  IPv4 520164      0t0  TCP localhost:59082->localhost:45381 (ESTABLISHED)
Find elsewhere
๐ŸŒ
GitHub
github.com โ€บ xuancong84 โ€บ python-remote-debug
GitHub - xuancong84/python-remote-debug: A tutorial on how to use VSCode to do Python remote debugging ยท GitHub
We typically use sshfs to ssh-mount the remote folder onto some local folder. So you need to make sure you can SSH the server from your local machine. On the server, make sure the pip package debugpy is installed, and run python -m debugpy --listen xxx.xxx.xxx.xxx:12345 --wait-for-client your-python-code.py, where xxx.xxx.xxx.xxx is the server IP address that your local machine has direct access to, 12345 can be any chosen port on the server that is not blocked by any firewall, and your-python-code.py is the Python program that you want to debug.
Author ย  xuancong84
๐ŸŒ
Donjayamanne
donjayamanne.github.io โ€บ pythonVSCodeDocs โ€บ docs โ€บ debugging_remote-debugging
Remote Debugging | Python in Visual Studio Code
{ "name": "Attach (Remote Debug)", "type": "python", "request": "attach", "localRoot": "${workspaceRoot}", "remoteRoot": "C:/temp/myscripts", "port": 3000, "secret": "my_secret", "host":"ipaddress or 'localhost'" }
๐ŸŒ
Medium
medium.com โ€บ @TechArtCorner โ€บ python-remote-debugging-debug-external-applications-with-pycharm-1da72a88fde0
Python Remote Debugging โ€” Debug External Applications with PyCharm | by Tech Art Corner - Karol Kowalczyk | Medium
January 20, 2026 - Run the remote debugging server. You should always run it before you try to connect. By now you probably can see a console and some snippet of code. You can use it to connect. Simply execute those two lines of code in your tool. You can add those lines in the function you want to debug. Or trigger it with a button. It will also work fine (in most cases) if you simply type it into built in Python console in the software you are debugging.
๐ŸŒ
DEV Community
dev.to โ€บ suzuki0430 โ€บ mastering-python-debugging-on-remote-ssh-with-vscode-4lg7
Mastering Python Debugging on Remote SSH with VSCode - DEV Community
May 26, 2023 - To do this, use SSH tunneling with the following command (linking port 5678 of the local machine with port 5678 of the remote machine). $ ssh -i ~/.ssh/<pem-key> -L 5678:localhost:5678 ubuntu@<public-ip> launch.json is a file read by VSCode when a debug session starts (when Run and Debug in the sidebar is clicked).
๐ŸŒ
Python
docs.python.org โ€บ 3.14 โ€บ howto โ€บ remote_debugging.html
Remote debugging attachment protocol โ€” Python 3.14.3 documentation
This protocol enables external tools to attach to a running CPython process and execute Python code remotely. Most platforms require elevated privileges to attach to another Python process. Disabli...
๐ŸŒ
Codementor
codementor.io โ€บ community โ€บ remote debugging guide for python
Remote Debugging Guide for Python | Codementor
May 17, 2019 - Run the Remote Debug configuration in PyCharm. Run the python script $ START_DEBUGGER=1 python app.py
๐ŸŒ
Python
wiki.python.org โ€บ moin โ€บ PythonDebuggingTools
PythonDebuggingTools - Python Wiki
For current information, please visit python.org. If a change to this archive is absolutely needed, requests can be made via the infrastructure@python.org mailing list. Add your useful tools here -- editors, debuggers and other utils that really help with the process.:
๐ŸŒ
Pydev
pydev.org โ€บ manual_adv_remote_debugger.html
Remote Debugger
Last Site Update: November 13th, 2025 | Latest Version: 13.1.0 ยท In PyDev you can debug a remote program (a file that is not launched from within Eclipse)
๐ŸŒ
Dynatrace
rookout.com โ€บ __home__ โ€บ cloud & monitoring solutions โ€บ observability for developers
Python Remote Debugging in PyCharm: A Tutorial
March 10, 2026 - Instantly capture full-stack debug data from any line of code directly from both your IDE or a web-based interface
๐ŸŒ
Lightrun
lightrun.com โ€บ home โ€บ python remote debugging with vs code and debugpy
Python Remote Debugging with VS Code and debugpy - Lightrun
June 22, 2023 - In the simplest terms, remote debugging is debugging an application running in a remote environment like production and staging. To perform remote debugging, you need to be able to remotely connect to a running application from your local ...
๐ŸŒ
Martin Heinz
martinheinz.dev โ€บ blog โ€บ 99
Remote Interactive Debugging of Python Applications Running in Kubernetes | Martin Heinz | Personal Website & Blog
June 19, 2023 - But you can! In this tutorial we will create a setup for remote debugging of Python applications running in Kubernetes, which will allow you to set breakpoints, step through code, and interactively debug you applications without any change to your code or deployment.
๐ŸŒ
ActiveState
docs.activestate.com โ€บ komodo โ€บ 12 โ€บ manual โ€บ debugpython.html
Debugging Python
Komodo controls the debugging session once the session starts on the remote machine. To debug a Python program remotely, the Python debugger client package must be installed on the remote machine. Packages are available for download from the Komodo Remote Debugging page.
๐ŸŒ
Home Assistant
home-assistant.io โ€บ integrations โ€บ remote python debugger
Remote Python Debugger - Home Assistant
When the start option of the integration has been set to false, one can use the debugpy.start action to inject and start the remote Python debugger at runtime.