Why I Started Using Docker

I wanted a way to run apps without messing up my main system. Docker packs an app with everything it needs into a container — a small, isolated environment that shares my kernel but stays separate from everything else.

If something breaks inside a container, I delete it and start over. No reinstalling the whole OS.

Containers vs Images (Quick Version)

  • Image — a read-only template (like a recipe)
  • Container — a running instance of that image (like the actual dish you cooked)

You build or pull an image once. You can spin up as many containers from it as you want.


Arch Linux

This is what I use on my main machine now.

Install Docker

sudo pacman -S docker
sudo systemctl enable --now docker

Check the service is running:

systemctl status docker

You should see active (running).

Test with hello-world

sudo docker pull hello-world
sudo docker images
sudo docker run hello-world

If you see a friendly message from Docker, it works.

Run Docker without sudo (optional)

I got tired of typing sudo every time:

sudo usermod -aG docker $USER

Log out and log back in. Then test:

docker ps

If that works without sudo, you’re set.


Ubuntu

This is what I used first when I was learning Docker on Ubuntu 22.04.

Install Docker

sudo apt update
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker

Check the service is running:

systemctl status docker

You should see active (running).

Test with hello-world

sudo docker pull hello-world
sudo docker images
sudo docker run hello-world

Same test as Arch — if hello-world prints a success message, Docker is working.

Run Docker without sudo (optional)

sudo usermod -aG docker $USER

Log out and log back in. Then test:

docker ps

Quick Reference

StepArch LinuxUbuntu
Installsudo pacman -S dockersudo apt install docker.io
Enable on bootsudo systemctl enable --now dockersudo systemctl enable docker
Testsudo docker run hello-worldsudo docker run hello-world
Skip sudosudo usermod -aG docker $USERsudo usermod -aG docker $USER

The Docker commands (pull, run, ps, etc.) are the same on both distros once it is installed.


What’s Next?

Once Docker is installed, the next step is creating your own container. I wrote that up here: Creating My First Docker Container.