If you upgraded your docker stack recently, it might be possible that you run into this error:

$ docker ps
Error response from daemon: client is newer than server(client API version 1.21, server API version: 1.19)

Best solution I've found is to dvm, use a tool provided by Carina. dvm stands, I guess, for docker version manager.

To install:

curl -sL https://download.getcarina.com/dvm/latest/install.sh | sh

If you have used nvm or similar, the way you use dvm will feel familiar:

  • dvm ls to list installed versions
  • dvm install 1.9.0 to install versions
  • dvm use 1.8.1