Docker Installation Guide
This guide provides all the key information and getting-started instructions after a successful Docker CE installation via DeploySage-CLI.
Service Management
Manage the Docker service using standard systemctl commands.
# Start the Docker service
sudo systemctl start docker
# Stop the Docker service
sudo systemctl stop docker
# Restart the Docker service
sudo systemctl restart docker
# Check the service status
sudo systemctl status docker
Basic Docker Commands
Docker Compose Commands
Get started with these fundamental Docker commands.
Orchestrate multi-container applications with Docker Compose.
# Check Docker version and info
docker --version
docker info
# Pull an image from Docker Hub
docker pull ubuntu:latest
# List all local images
docker images
# Run a container from an image
docker run -it ubuntu bash
# List all running containers
docker ps
# List all containers (running and stopped)
docker ps -a
# Build and start services
docker-compose up --build
# Start services in the background
docker-compose up -d
# Stop and remove containers, networks, and volumes
docker-compose down
# View logs from all services
docker-compose logs -f
User Permissions
Cleanup Commands
To run Docker commands without sudo, your user has been added to the docker group. This change requires you to either log out and log back in, or run the following command in your current shell:
After this, you can run commands like docker ps instead of sudo docker ps.
Keep your system tidy by periodically removing unused Docker objects.
newgrp docker
# Remove all stopped containers, unused networks, and dangling images
docker system prune
# Remove all unused local volumes
docker volume prune