Install Docker The Easy Way
Install Docker The Easy Way

Install Docker The Easy Way

Docker is one of my favorite tools for hosting websites and doing other homelab things but installing Docker can be a no fun process for adding keys and repos that requires dozens of commands

Well now it is as easy as two commands thanks to get.docker.com. get.docker.com has made a script that installs Docker and Docker compouse with just one line and will add the docker user group with a secound, are you ready to get started?

The first command that we are going to use is

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

This command is made up of two common Unix/Linux command-line tools, curl and sh, to download and execute a script that installs Docker

curl: curl is a command-line tool used for making HTTP requests. In this case, it is fetching the contents of a script from the specified URL.

-sSL: These are options passed to curl:

https://get.docker.com: This is the URL from which curl fetches the script. It points to a script that installs Docker.

| (pipe): The pipe operator takes the output (in this case, the content of the script) from the command on the left (curl in this case) and passes it as input to the command on the right (sh).

sh: sh is a command-line interpreter that executes commands read from a script or entered interactively. In this case, it is executing the script obtained from the URL.

So in just one line we can download and install Docker.

Now lets look at the next command this command is optional but it makes it much easer to work with docker because you would have to enter sudo before every command.

sudo usermod -aG docker $USER

sudo:
stands for "superuser do" and is used to execute commands with elevated privileges. The sudo command allows a permitted user to execute a command as the superuser (or another user) as specified by the security policy.

usermod: is a command used for modifying user account properties. In this case, it is used to modify group memberships.

-aG docker:

Options passed to usermod: