SSH into any docker container from anywhere with no hassle

Sometimes you want to access a docker container from outside its host server, or you don't want to install a ssh server inside your docker container, this post will tell you about a tool for that.


Dockssh, ssh into any container from anywhere


  • For learning and fun
  • Wasting some free time in my weekend :D
  • For testing/staging/development environments

How it works

  • Dockssh runing on port 22022 on host
  • A user connects to dockssh i.e ssh -p 22022 [email protected]
  • Dockssh checks if the user provided password is the same as the one stored in redis key dockssh:container1:pass
  • On success, Dockssh will open a PTY (pseudotty) to docker exec -it container1 /bin/sh
  • Have fun ^^! (replace container1 with any of your containers)

Why redis for configurations

  • No configurations files
  • Simple & tiny
  • Makes Dockssh loads configurations in realtime, no need to restart


  • Linux
  • Docker
  • Redis


Download the binary from here

Building from source

go get


  • Just ./dockssh
  • or ./dockssh --help to see its options

Mohammed Al Ashaal

I'm a problem solver who gets the job done in simple and easy way, I don't learn tools, I learn concepts.

Subscribe to Mohammed Al Ashaal

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!