Remote Python Debug to Docker Container over Ssh by using PyCharm

Furkan Pur
Jun 22, 2017 · 4 min read

Part 1: Docker Container Creation

$ docker info
$ docker pull ubuntu:16.04
# docker run –it –p 8022:22 ubuntu:16.04

Part 2: Ssh Server Configuration

$ apt update && apt install -y openssh-server
$ mkdir /var/run/sshd
$ echo 'root:testssh' | chpasswd
# Root password was changed with testssh
$ sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config$ sed 's@session\s*required\s* optional' -i /etc/pam.d/sshd$ echo "export VISIBLE=now" >> /etc/profile
$ service ssh restart
$ docker port <your container name> 22
$ ssh root@<your host ip> -p 8022

Part 3: PyCharm Deployment Configuration

Part 4: Remote Interpreter Configuration



Furkan Pur

Written by

Machine Learning Engineer

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade