Skip to content

Instantly share code, notes, and snippets.

@Saanch
Last active April 13, 2017 10:08
Show Gist options
  • Save Saanch/7e832638c05ee85dd693fee72faf23bb to your computer and use it in GitHub Desktop.
Save Saanch/7e832638c05ee85dd693fee72faf23bb to your computer and use it in GitHub Desktop.
Running Docker on centos

ssh to server

ssh root@ip

Add new user for managing docker

adduser username

Set password for the user

passwrd username

Add user to the sudo list(the following group is specific to the centos)

usermod -aG wheel username

For ubuntu

usermod -aG sudo username

test user is added to the sudoers list

sudo ls -la /root

if the ablove steps fails we need to add the username to the sudoers list manually

login as the new user

su - username

Install docker client

curl -sSL https://get.docker.com/ | sh

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 username`

Remember that you will have to log out and back in for this to take effect! logout

Start docker service

sudo service docker start

Test the docker service

docker ps -a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment