📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Linux Command Line Docker Basics on Linux

Docker Basics on Linux

5 min read
Docker runs apps in containers. docker run -d -p 80:8080 myapp starts one. docker ps lists running containers. docker exec -it id bash opens a shell inside one. docker logs id shows the output.

Docker on Linux

sudo apt install docker.io
sudo systemctl enable --now docker
sudo usermod -aG docker $USER  # no sudo needed after re-login

docker pull nginx
docker run -d -p 80:80 --name web nginx
docker ps
docker logs web
docker exec -it web bash
docker stop web
docker rm web