Guides
Working with Docker

Install Docker on Ubuntu or Debian

8min

Installing Docker on Ubuntu or Debian only takes a few commands. This should all take only a few minutes. Let's dive in.

1. Remove Docker

First, you need to remove any Docker dependencies. (If you've never installed Docker before, don't worry. You can skip this step.)

Linux


2. Set up the repository

Now we need to set up the Docker repository, add the official GPG key, and verify it.

Linux


Next, we add the GPGKey.

Linux


Now, we need to verify the fingerprint and check it matches this:

  • 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
Linux


If that's all good, we add the Docker repository.

Linux


3. Install Docker

Okay, now that we've got the repository set up and verified, it's time to install Docker.

Linux


At this point, it's good to start a container to check that Docker installed correctly.

Linux


4. Add non-root users

You'll notice that if you want to start Docker as a non-root user, you'll probably run into this error message.

Linux


Don't worry. There's an easy fix for that. First, create the docker group.

Linux


Then add the non-root user to the group.

Linux


With all that done, you've got Docker set up and ready to use.