Installing Docker
- Open Terminal
- Find the “Terminal” app and click it.
- Run the Easy Install Command
- In Terminal, type or paste this whole line and press Enter:
wget -qO- https://get.docker.com/ | sh
- This downloads a small script and runs it. It will install Docker for you.
- In Terminal, type or paste this whole line and press Enter:
- Wait for It to Finish
- The script will show text as it downloads and sets up Docker.
- When the text stops, Docker is installed.
- Check Docker Works
- Still in Terminal, type:
sudo docker run hello-world
- Press Enter. Docker will download a tiny test program and run it.
- If you see “Hello from Docker!”, it means Docker is ready.
- Still in Terminal, type:
- Let You Use Docker Without “sudo” (Optional)
- By default, you need to type
sudo
before every Docker command. If you want to skip typingsudo
, do this:- Type:
sudo usermod -aG docker $USER
Press Enter. - Close Terminal and log out of your Ubuntu account. Then log back in.
- Now you can run Docker commands without
sudo
. For example:docker run hello-world
- Type:
- By default, you need to type
That’s it! Docker is now installed on your Ubuntu 22.04 in just one simple step.