Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Using remote docker with SSH tunnel.

Project Description

docker-tunnel is a console utility to use remote docker with SSH tunnel.

If you are using OS X or a Linux distribution with docker-unsupported kernel, no more running a virtual machine or ssh to a remote shell.


With pip:

$ pip install docker-tunnel

With pipsi (Recommended):

$ pipsi install docker-tunnel


$ docker-tunnel
( $
( $ echo $DOCKER_HOST
( $ docker ps  # go ahead
( $ ^D  # ctrl-d

More options:

$ docker-tunnel --help

Shell Theme Integration

Inside the tunnel injected shell, the environment variable DOCKER_HOST and DOCKER_PROMPT_INFO will be assigned. They can be used in your shell theme to prompt you which tunnel is using.

There is an example, my custom theme for OH-MY-ZSH.


Error response from daemon: client and server don't have same version (client : 1.14, server: 1.12)

The docker in source of CentOS 7 is using API 1.12 but the docker client in Homebrew of OS X is not. You can downgrade the docker client with Homebrew:

$ brew versions docker
1.0.0    git checkout c513c42 /usr/local/Library/Formula/docker.rb
$ cd /usr/local/Library/Formula  # now we install the old version of docker
$ git checkout c513c42 -- docker.rb
$ brew unlink docker
$ brew install docker
$ git checkout HEAD -- docker.rb
$ cd -
$ brew info docker  # check the installed versions and current version
/usr/local/Cellar/docker/1.1.1 (9 files, 9.8M) *
  Poured from bottle
/usr/local/Cellar/docker/1.2.0 (9 files, 6.6M)
  Poured from bottle
$ docker-tunnel
( $ docker version
Client version: 1.0.0
Client API version: 1.12
( $ exit
$ brew switch 1.2.0  # restore to latest
bind: Address already in use. cannot listen to port: 4243
You can find out the process which held the 4243 port with sudo lsof -i :4243 and decide to kill it or pick another port with --local-port.
channel 1: open failed: connect failed: Connection refused. 2014/09/06 13:08:57 Get EOF
Does the docker server listen on You may have to set correct server info with --remote-host and --remote-port.

Known Bugs

  • The ssh tunnel can be authenticated with public key only. The password prompt will caused a crash.


If you want to report bugs or request features, please create issues on GitHub Issues.

Release History

This version
History Node


History Node


History Node


History Node

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(6.2 kB) Copy SHA256 Hash SHA256
3.4 Wheel Sep 7, 2014
(4.4 kB) Copy SHA256 Hash SHA256
Source Sep 7, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting