- Assumptions
- You have an Ubuntu 22.04 Linux server created
- 4GB of RAM
- 30GB of Drive Storage
- You have an Ubuntu 22.04 Linux server created
- Install Docker
- sudo apt-get update
- sudo apt-get install ca-certificates curl gnupg
- sudo install -m 0755 -d /etc/apt/keyrings
-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
- sudo chmod a+r /etc/apt/keyrings/docker.gpg
-
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- sudo apt-get update
- sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- Add Current User to Docker Group
- By default, only the root user can do docker commands, you need to add your current user to the docker group in order to allow it to run docker commands.
- sudo groupadd docker
- sudo gpasswd -a $USER docker
- newgrp docker
- By default, only the root user can do docker commands, you need to add your current user to the docker group in order to allow it to run docker commands.
- Test Docker installation
- docker run hello-world
- This command runs a test docker container to see if your installation functions normally. The output should look like the image below
- docker run hello-world