Use host.docker.internal instead of 0.0.0.0. This will allow docker to decide which IP to use.

Answer from Drew Rochon on Stack Overflow
๐ŸŒ
JetBrains
jetbrains.com โ€บ help โ€บ pycharm โ€บ using-docker-as-a-remote-interpreter.html
Configure an interpreter using Docker | PyCharm Documentation
March 17, 2026 - Wait for PyCharm to connect to the Docker daemon and complete the container introspection. Select an interpreter to use in the Docker container. You can select a Python, conda or uv environment type.
๐ŸŒ
Supervisely
developer.supervisely.com โ€บ app-development โ€บ advanced โ€บ in-depth-app-development โ€บ chapter-4-additionals โ€บ part-1-remote-developing-with-pycharm-docker-ssh-server
Part 1 โ€” Remote Developing with PyCharm [Docker SSH Server] | Supervisely
August 31, 2022 - ... The first thing you need to do is to create a directory in which you can store docker and ssh related files. As an example, we will create a directory named remote_dev inside our project and move into that directory with the command:
Discussions

ssh - Pycharm - using remote Docker container as interpreter - Stack Overflow
I was told on the PyCharm forums that this is likely to be a bug, so not much to do at the moment. However, if you use PyCharm Pro, there's a new Beta functionality which allows you to SSH into remote hosts...it's the "Remote Development โ†’ SSH" option, accessible through the "Welcome to PyCharm" ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - PyCharm remote debug in a docker container - Stack Overflow
I'm having an hard time trying to figure out how to setup a remote debug of a python app (Flask) running in a Docker container. Specifically I'm using docker-compose, PyCharm professional and pytho... More on stackoverflow.com
๐ŸŒ stackoverflow.com
ssh - Pycharm use Docker Container Python as Remote Interpreter - Stack Overflow
But I don't much like using Jupyter for developing and would like to use the Python interpreter in the Docker Container in Pycharm. When I select "Add Python Interpreter" in Pycharm, I get the following options: The documentation for Pycharm suggests using the "Add Python Interpreter/Docker" tool which looks like this: However the documentation doesn't say how to set up the Docker container and the connections if the Docker is on a remote ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Is there an equivalent of the VS Code remote development in PyCharm?
I have exactly the same question: I have a linux machine with my python code (~/documents/my_web_app) and on the same machine there's the python environment and other resources (Kibana, Elasticsearch). I would like to do remote development from my windows machine through SSH and forward some ports (5000 and 5601). I am new to remote development from PyCharm, from what i could understand it sets-up an SSH connection for the code, and another SSH connection for the python environment and the port forwarding. the problem is that it uploads the whole repo again to the machine to the sync folder when i ask to run tests or debug the code which is unnecessary since the code is already there. I'm looking for something like VSCode offers: https://code.visualstudio.com/docs/remote/ssh More on reddit.com
๐ŸŒ r/pycharm
10
7
June 18, 2024
๐ŸŒ
JetBrains
jetbrains.com โ€บ help โ€บ pycharm โ€บ docker.html
Docker | PyCharm Documentation
1 month ago - Docker Buildx plugin, which is necessary for building images from Dockerfile. Note that using Buildx with Docker requires Docker Engine version 19.03 or later. For Dev Containers on a remote server, refer to Limitations.
๐ŸŒ
GitHub
gist.github.com โ€บ costa โ€บ 204dccca4543dc518370947d33955f9a
Setting up remote (really remote) containerised development environment with PyCharm (Medium blogpost) ยท GitHub
Make a copy of your Python component's Dockerfile (Dockerfile.remote-dev) with the following changes: ... Other python versions are available upon request -- I've made a very simple image (FROM python:2.7) based on https://github.com/eugene-s/python-sshd (FROM python:2.7, not Alpine or anything) which I'm using here. b) Remove your ENTRYPOINT/CMD -- the component will be running sshd now and PyCharm will be running Python scripts through it.
๐ŸŒ
JetBrains
jetbrains.com โ€บ help โ€บ pycharm โ€บ connect-to-devcontainer.html
Dev Container overview | PyCharm Documentation
October 23, 2024 - The container can be run in a remote environment, and its resources and capabilities become available during development. In PyCharm, there are various scenarios that you can use to start a Dev Container:
๐ŸŒ
JetBrains
jetbrains.com โ€บ help โ€บ pycharm โ€บ start-dev-container-for-a-remote-project.html
Start Dev Container for a remote project | PyCharm Documentation
February 5, 2026 - In addition, ensure you have Java ... project located in the remote file system. Launch PyCharm. On the left-hand pane of the Welcome screen, click Remote Development....
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 76051437 โ€บ pycharm-using-remote-docker-container-as-interpreter
ssh - Pycharm - using remote Docker container as interpreter - Stack Overflow
Selecting New Project, you can select between the possible SSH configurations available in PyCharm (you can set them up through Setting โ†’ Tools โ†’ SSH Configurations). The whole thing is actually much more similar to how VS Code works. It downloads some helpers and open a remote PyCharm instance directly on the remote machine, and you can work there. I tested it, and it works in remote docker containers as well.
Find elsewhere
๐ŸŒ
GitHub
github.com โ€บ tkat0 โ€บ cookiecutter-pycharm-remote-docker
GitHub - tkat0/cookiecutter-pycharm-remote-docker: PyCharm project template for development in remote docker environment
December 10, 2018 - Add new Docker configuration (e.g. Docker-remote) and set as follows. This name is used later. ... By answering some questions, project directory are automatically generated. # Create a project from cookiecutter-pycharm-remote-docker template $ cookiecutter git@github.com:tkat0/cookiecutter-pycharm-remote-docker.git full_name [Your Name]: tkat0 email [Your email]: tkato.dev@gmail.com" project_name [project_name]: sample-project project_slug [sample_project]: project_short_description []: sample project version [0.1.0]: timezone [Asia/Tokyo]: python_version [3.6.0]: remote_host [remote machine ip-addr or host-name]: 192.168.0.2 remote_docker_name [Docker-remote]: remote_uid [remote user id (result of "ssh 192.168.0.2 id -u")]:1003 remote_work_dir [remote working directory.
Starred by 41 users
Forked by 3 users
Languages ย  Python 77.1% | Dockerfile 15.1% | Makefile 7.0% | Shell 0.8% | Python 77.1% | Dockerfile 15.1% | Makefile 7.0% | Shell 0.8%
๐ŸŒ
JetBrains
jetbrains.com โ€บ help โ€บ pycharm โ€บ using-docker-compose-as-a-remote-interpreter.html
Configure an interpreter using Docker Compose | PyCharm Documentation
March 17, 2026 - Specify the docker-compose.yml file in Configuration files and select the service. Optionally, specify environment variables and edit the Compose project name. Wait until PyCharm creates and configures a new target: Select an interpreter to use in the container. You can select a Python, conda or uv environment type. ... The configured remote ...
๐ŸŒ
Pauleveritt
pauleveritt.github.io โ€บ posts โ€บ docker_intro
Using Docker in PyCharm โ€” Paul Everitt documentation
Once that Docker image is locally available and the Docker โ€œhostโ€ is running and knows about it, PyCharm can make Docker interpreters for your project, as containers based on that image. Alternatively, you can skip this step and later pull in the image while creating the Docker-based remote interpreter by simply typing in the image name during creation.
๐ŸŒ
JetBrains
youtrack.jetbrains.com โ€บ issue โ€บ PY-33489 โ€บ Native-support-for-running-Docker-on-the-remote-machine
Native support for running Docker on the remote machine
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
Top answer
1 of 1
3

Thank you for depicting the dilemma so poignantly and clearly in your cartoon :-). My colleague and I were trying to do something similar and what ultimately worked beautifully was creating an SSH config directly to the Docker container jumping from the remote machine, and then setting it as a remote SSH interpreter so that pycharm doesn't even realize it's a Docker container. It also works well for vscode.

  1. set up ssh service in docker container (subset of steps in https://dev.to/s1ntaxe770r/how-to-setup-ssh-within-a-docker-container-i5i, port22 stuff wasn't needed)
    • docker exec -it <container> bash: create admin interactive prompt for docker
    • apt-get install openssh-server
    • service ssh start
    • confirm with service ssh status -> * sshd is running
  2. determine IP and test SSHing from remote machine into container (adapted from https://phoenixnap.com/kb/how-to-ssh-into-docker-container, steps 2 and 3)
    • from normal command prompt on remote machine (not within container): docker inspect -f "{{ .NetworkSettings.IPAddress }}" <container> to get container IP
    • test: ping -c 3 <container_ip>
    • ssh: ssh <container_ip>; should drop you into the container as your user; however, requires container to be configured properly (docker run cmd has -v /etc/passwd:/etc/passwd:ro \ etc.). It may ask for a password. note: if you do this for a different container later that is assigned the same IP, you will get a warning and may need to delete the previous key from known_hosts; just follow the instructions in the warning.
  3. test SSH from local machine
    • if you don't have it set up already, set up passwordless ssh key-based authentication to the remote machine with the docker container
    • make SSH command that uses your remote machine as a jump server to the container: ssh -J <remote_machine> <container_ip>, as described in https://wiki.gentoo.org/wiki/SSH_jump_host; if successful you should drop into the container just as you did from the remote machine
    • save this setup in your ~/.ssh/config; follow the ProxyJump Example from https://wiki.gentoo.org/wiki/SSH_jump_host
    • test config with ssh <container_host_name_defined_in_ssh_config>; should also drop you into interactive container
  4. configure pycharm (or vscode or any IDE that accepts remote SSH interpreter)
    • Preferences -> Project -> Python Interpreter -> Add -> SSH Interpreter -> New server configuration
    • host: <container_host_name_defined_in_ssh_config>
    • port: 22
    • username: <username_on_remote_server>
    • select interpreter, can navigate using the folder icon, which will walk you through paths within the docker, or you can enter the result of which python from the container
    • follow pycharm prompts
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 4407769339538-How-Remote-Docker-interpreter-runs-in-remote-server-
How Remote Docker interpreter runs in remote server? โ€“ IDEs Support (IntelliJ Platform) | JetBrains
October 5, 2021 - Connect via SSH to Docker engine running on a remote machine and use the remote machine as a development environment for Visual Studio Code.We created a project and added a Python script.
๐ŸŒ
JetBrains
jetbrains.com โ€บ help โ€บ pycharm โ€บ settings-docker.html
Docker connection settings | PyCharm Documentation
February 24, 2026 - Connect to a remote Docker daemon via an existing SSH configuration or create a new one. ... Connect to a Docker daemon running in Windows Subsystem for Linux (WSL). ... If you are running minikube, select this option to automatically detect ...
๐ŸŒ
Map Tech & Code
davidraleigh.github.io โ€บ 2017 โ€บ 06 โ€บ 27 โ€บ Debugging-a-Remote-Docker-Container-with-PyCharm.html
Debugging A Remote Docker Container With Pycharm | Map Tech & Code
June 27, 2017 - gcloud compute --project "blog-and-demos" ssh --zone "us-central1-f" "remote-debug-demo" cd ~/remote-debug-docker/ # copy from your docker container to your remote vm, so each new build has a copy of the helpers and your local # pycharm ide doesn't have to upload them each time you create a new image sudo docker cp temp-python-debug:/root/.pycharm_helpers ./ # upload your pycharm helpers so that you can download them to a new remote vm in the future (or some other team # can benefit from your pycharm_helpers) sudo gsutil cp -r .pycharm_helpers gs://raleigh-data/2017.1.4/ Now youโ€™ve tagged your development image with the name test-image and youโ€™ve gotten your remote-debug-docker directory setup for creating a Docker container you can ssh into.
๐ŸŒ
JetBrains
blog.jetbrains.com โ€บ pycharm โ€บ 2015 โ€บ 12 โ€บ using-docker-in-pycharm
Using Docker in PyCharm | The PyCharm Blog
January 17, 2024 - Once that Docker image is locally available and the Docker โ€œhostโ€ is running and knows about it, PyCharm can make Docker interpreters for your project, as containers based on that image. Alternatively, you can skip this step and later pull in the image while creating the Docker-based remote interpreter by simply typing in the image name during creation.
๐ŸŒ
Medium
medium.com โ€บ @furkanpur โ€บ remote-python-debug-to-docker-container-over-ssh-by-using-pycharm-44a9b6e82206
Remote Python Debug to Docker Container over Ssh by using PyCharm | by Furkan Pur | Medium
October 8, 2019 - Letโ€™s start. Now, we need to navigate Tools > Deployment > Configuration from the menu bar. After popup opens, we need to add new server by clicking + button top left. After giving name to server, we need to select SFTP as a server type.
๐ŸŒ
YouTube
youtube.com โ€บ watch
Configuring a remote Python interpreter in PyCharm | PyCharm Tutorial - YouTube
This is the Getting Started Series, with Paul Everitt.In this episode, you will learn how to create remote Python interpreters in PyCharm Pro using SSH, Dock...
Published ย  January 10, 2022