You have to use curl, follow the commands below:
sudo curl -sSL http://getdocker/ | sh
This will execute a code that installs docker.
Note the last part of the script:
If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like:
sudo usermod -aG docker user
Remember that you will have to log out and back in for this to take effect!
Then, update Docker run:
sudo apt-get update && apt-get upgrade
and make sure that you use docker.io instead of docker.
sudo apt-get install docker.io