Installing Docker

Installing Docker on Your Dedicated Server

Docker allows you to run applications in isolated containers, making deployment consistent and repeatable across environments.

Install Docker on Ubuntu/Debian

apt update
apt install ca-certificates curl gnupg -y

install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
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" | tee /etc/apt/sources.list.d/docker.list > /dev/null

apt update
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

Verify Installation

docker --version
docker run hello-world

Run Docker Without sudo

usermod -aG docker $USER
newgrp docker

Enable Docker at Boot

systemctl enable docker
systemctl start docker

Basic Docker Commands

docker ps             # List running containers
docker ps -a          # List all containers
docker images         # List downloaded images
docker pull nginx     # Download an image
docker stop <id>     # Stop a container
docker rm <id>       # Remove a container
docker rmi <image>   # Remove an image
  • 0 Uživatelům pomohlo
Byla tato odpověď nápomocná?

Související články

Getting Started with Docker Compose

Getting Started with Docker Compose Docker Compose lets you define and run multi-container...

Managing Docker Containers

Managing Docker Containers A practical reference for day-to-day Docker container management. Run...

Using Docker Volumes for Persistent Storage

Using Docker Volumes for Persistent Storage By default, data inside a container is lost when the...

Docker Networking Explained

Docker Networking Explained Understanding Docker networking lets you connect containers together,...

Building Custom Docker Images with a Dockerfile

Building Custom Docker Images A Dockerfile defines the steps to build a custom Docker image for...