Docker Installation: Difference between revisions

No edit summary
No edit summary
Line 3: Line 3:
Install Docker:
Install Docker:


<syntaxhighlight lang="bash">
sudo apt update
sudo apt update
sudo apt install docker.io
sudo apt install docker.io
</syntaxhighlight>


Enable and start the Docker service:
Enable and start the Docker service:


<syntaxhighlight lang="bash">
sudo systemctl enable --now docker
sudo systemctl enable --now docker
</syntaxhighlight>


Add your user to the Docker group (replace <code>{YOURUSERNAME}</code> with your username):
Add your user to the Docker group (replace <code>{YOURUSERNAME}</code> with your username):


<syntaxhighlight lang="bash">
sudo usermod -aG docker {YOURUSERNAME}
sudo usermod -aG docker {YOURUSERNAME}
</syntaxhighlight>


Log out and back in (or reboot) for the group change to take effect.
Log out and back in (or reboot) for the group change to take effect.
Line 26: Line 20:
Install Docker:
Install Docker:


<syntaxhighlight lang="bash">
sudo apk add docker
sudo apk add docker
</syntaxhighlight>


Enable Docker at boot:
Enable Docker at boot:


<syntaxhighlight lang="bash">
sudo rc-update add docker default
sudo rc-update add docker default
</syntaxhighlight>


Start the Docker service:
Start the Docker service:


<syntaxhighlight lang="bash">
sudo rc-service docker start
sudo rc-service docker start
</syntaxhighlight>


Add your user to the Docker group (replace <code>{YOURUSERNAME}</code> with your username):
Add your user to the Docker group (replace <code>{YOURUSERNAME}</code> with your username):


<syntaxhighlight lang="bash">
sudo addgroup {YOURUSERNAME} docker
sudo addgroup {YOURUSERNAME} docker
</syntaxhighlight>


Log out and back in (or reboot) for the group change to take effect.
Log out and back in (or reboot) for the group change to take effect.

Revision as of 20:47, 7 July 2026

Debian

Install Docker:

sudo apt update sudo apt install docker.io

Enable and start the Docker service:

sudo systemctl enable --now docker

Add your user to the Docker group (replace {YOURUSERNAME} with your username):

sudo usermod -aG docker {YOURUSERNAME}

Log out and back in (or reboot) for the group change to take effect.

Alpine Linux

Install Docker:

sudo apk add docker

Enable Docker at boot:

sudo rc-update add docker default

Start the Docker service:

sudo rc-service docker start

Add your user to the Docker group (replace {YOURUSERNAME} with your username):

sudo addgroup {YOURUSERNAME} docker

Log out and back in (or reboot) for the group change to take effect.