How To Install Docker Desktop on CentOS Stream 10
Docker has revolutionized the way developers build, deploy, and manage applications through containerization technology. While Docker Engine provides the core containerization functionality via command-line tools, Docker Desktop delivers a more comprehensive, user-friendly experience with an intuitive graphical interface. CentOS Stream 10, the latest version of the CentOS Project distribution, offers an excellent platform for running Docker Desktop. This guide will walk you through the complete process of installing Docker Desktop on CentOS Stream 10, from preparation to optimization and troubleshooting.
Introduction
Containerization has become essential in modern software development and deployment workflows. Docker’s containerization technology allows developers to package applications with all dependencies, ensuring consistent behavior across different environments. The distinction between Docker Engine and Docker Desktop is important to understand – while Docker Engine provides the core container runtime and command-line interface, Docker Desktop bundles additional tools like a graphical user interface, Docker Compose, Kubernetes integration, and container management features.
Installing Docker Desktop on CentOS Stream 10 offers several advantages, including streamlined container management, visual monitoring of resources, and simplified multi-container orchestration. By the end of this tutorial, you’ll have a fully functional Docker Desktop installation to enhance your development and deployment processes on CentOS Stream 10.
Understanding Docker Desktop for Linux
Docker Desktop for Linux extends beyond the basic functionality of Docker Engine by providing a comprehensive graphical interface and additional tools that simplify container management. The intuitive dashboard allows users to visualize running containers, manage images, configure networking, and monitor resource usage without memorizing complex command-line arguments.
Key features of Docker Desktop include:
- Graphical user interface for container management
- Built-in Kubernetes orchestration
- Volume management and data persistence tools
- Container resource monitoring
- Extensions ecosystem
- Development environment integration
For CentOS Stream 10, you’ll need to ensure your system meets the minimum requirements: a 64-bit processor, at least 4GB RAM (8GB recommended), 20GB free disk space, and KVM virtualization support. Docker Desktop provides significant advantages over alternative container solutions like Podman or LXC by offering a more integrated experience while maintaining compatibility with the Docker ecosystem.
Prerequisites for Installation
Before installing Docker Desktop on CentOS Stream 10, verify that your system meets these requirements:
- Hardware: 64-bit processor with 4GB RAM minimum (8GB recommended)
- Storage: At least 20GB of free disk space
- CentOS Stream 10 with the latest updates installed
- Root or sudo access to your system
- Active internet connection for downloading packages
- KVM virtualization support enabled in BIOS/UEFI
To verify KVM virtualization support, run:
lscpu | grep Virtualization
If virtualization is supported, you’ll see “VT-x” or “AMD-V” listed in the output.
Check your system’s available memory and disk space:
free -h
df -h
Additionally, ensure no conflicting container technologies are installed, such as Podman or buildah, which come pre-installed on CentOS Stream distributions.
Preparing Your CentOS Stream 10 System
Proper system preparation is crucial for a successful Docker Desktop installation. Start by updating all system packages to their latest versions:
sudo dnf update -y
Next, install essential utilities needed for the installation process:
sudo dnf install -y dnf-plugins-core wget curl gnupg2 software-properties-common
If firewalld is active on your system, configure it to allow Docker’s network traffic:
sudo firewall-cmd --permanent --zone=public --add-masquerade
sudo firewall-cmd --reload
Since CentOS Stream 10 comes with Podman and buildah pre-installed, remove these packages to prevent conflicts with Docker:
sudo dnf remove -y podman buildah
For optimal Docker performance, adjust kernel parameters by creating a new configuration file:
sudo tee /etc/sysctl.d/99-docker.conf <
These settings enable proper network forwarding and communication between Docker containers and the host system.
Installing Docker Engine Prerequisites
Docker Desktop requires Docker Engine as its foundation. Begin by installing the necessary prerequisites:
sudo dnf install -y yum-utils device-mapper-persistent-data lvm2
These packages provide tools for repository management and support for the device mapper storage driver that Docker uses by default.
Next, ensure that the CentOS extras repository is enabled, as it contains packages required by Docker:
sudo dnf config-manager --set-enabled extras
Verify the installation of all prerequisites with:
rpm -qa | grep -E 'yum-utils|device-mapper-persistent-data|lvm2'
The command should display the installed packages, confirming they’re properly set up for the Docker Engine installation.
Installing Docker Engine
Now we’ll install Docker Engine, which is required before installing Docker Desktop:
Adding the Docker Repository
First, add the official Docker repository to your system:
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
This adds the Docker CE stable repository to your system’s package sources.
Installing Docker Packages
Install Docker Engine, CLI, and containerd with:
sudo dnf install -y docker-ce docker-ce-cli containerd.io
Additionally, install the Docker Compose and Buildx plugins, which extend Docker’s functionality:
sudo dnf install -y docker-buildx-plugin docker-compose-plugin
Starting the Docker Service
Start the Docker service and enable it to run at system boot:
sudo systemctl start docker
sudo systemctl enable docker
Verifying Docker Engine Installation
Verify that Docker Engine is correctly installed by running a test container:
sudo docker run hello-world
If successful, you’ll see a message confirming that Docker is working properly. Check the installed version with:
sudo docker --version
docker compose version
These commands display the versions of Docker Engine and Docker Compose installed on your system.
Installing Docker Desktop on CentOS Stream 10
With Docker Engine installed, we can now proceed to install Docker Desktop:
Downloading Docker Desktop
Visit the Docker Desktop for Linux download page or use wget to download the RPM package:
wget https://desktop.docker.com/linux/main/amd64/docker-desktop-4.25.0-x86_64.rpm
Note: The version number may change, so check the Docker website for the latest version.
Verifying Package Integrity
Verify the downloaded package’s integrity:
sha256sum docker-desktop-4.25.0-x86_64.rpm
Compare the output with the checksum provided on the Docker website to ensure the file wasn’t corrupted during download.
Installing Docker Desktop
Install the Docker Desktop package using DNF:
sudo dnf install -y ./docker-desktop-4.25.0-x86_64.rpm
This command installs Docker Desktop and its dependencies on your system.
Alternative Installation Method
If you encounter issues with the direct RPM installation, you can use the repository method:
# Add Docker Desktop repository
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-desktop.repo
# Install Docker Desktop
sudo dnf install -y docker-desktop
This alternative approach might resolve dependency issues that sometimes occur with direct package installation.
Post-Installation Configuration
After installing Docker Desktop, configure various settings to optimize performance and usability:
Configuring Docker Daemon
Create or modify the Docker daemon configuration file:
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <
This configuration sets up log rotation and increases the file descriptor limits for containers.
Setting Up Log Rotation
Configure log rotation to prevent Docker logs from consuming too much disk space:
sudo tee /etc/logrotate.d/docker <<EOF
/var/lib/docker/containers/*/*.log {
rotate 7
daily
compress
size=10M
missingok
delaycompress
copytruncate
}
EOF
This ensures Docker container logs are rotated daily, compressed, and limited in size.
Configuring Resource Limits
Docker Desktop allows you to allocate specific system resources to containers. You can configure these limits through the Docker Desktop interface or by modifying configuration files:
mkdir -p ~/.docker/
tee ~/.docker/config.json <<EOF
{
"cpu-quota": 50000,
"memory": 4096,
"disk-size": 50
}
EOF
These settings allocate 50% CPU, 4GB RAM, and 50GB disk space to Docker Desktop.
User Permissions and Non-Root Access
For security and convenience, configure Docker to allow non-root users to manage containers:
Creating and Configuring the Docker Group
Create the docker group if it doesn’t already exist:
sudo groupadd docker
Adding Your User to the Docker Group
Add your user to the docker group:
sudo usermod -aG docker $USER
Applying Group Changes
Apply the group changes without logging out:
newgrp docker
Testing Non-Root Access
Test that you can run Docker commands without sudo:
docker run hello-world
If successful, you’ll be able to manage Docker as a non-root user. Remember that membership in the docker group grants privileges equivalent to root on the host system, so only add trusted users to this group.
Launching and Exploring Docker Desktop
Now that Docker Desktop is installed and configured, it’s time to launch and explore its features:
Starting Docker Desktop
Start Docker Desktop by clicking its icon in the applications menu or by running:
systemctl --user start docker-desktop
The Docker Desktop application will launch, displaying its graphical interface.
Navigating the Interface
Docker Desktop’s interface consists of several key sections:
- Dashboard: Shows running containers and recent activity
- Containers: Lists all containers with status and controls
- Images: Displays available Docker images
- Volumes: Shows data volumes for persistent storage
- Dev Environments: Tools for development environments
- Extensions: Additional plugins and functionality
Explore these sections to become familiar with Docker Desktop’s capabilities. The settings icon in the top-right corner allows you to configure preferences, resource allocation, and startup options.
Testing Your Docker Desktop Installation
Verify that Docker Desktop is working correctly by running several tests:
Running Test Containers
Start a simple web server container:
docker run -d -p 8080:80 --name test-nginx nginx
Open your browser and navigate to http://localhost:8080
. You should see the Nginx welcome page.
Building a Simple Docker Image
Create a Dockerfile:
mkdir docker-test
cd docker-test
tee Dockerfile <<EOF
FROM alpine:latest
CMD ["echo", "Docker Desktop is working!"]
EOF
Build and run the image:
docker build -t test-image .
docker run test-image
Using Docker Compose
Create a simple Docker Compose file:
tee docker-compose.yml <<EOF
version: '3'
services:
web:
image: nginx
ports:
- "8081:80"
redis:
image: redis
EOF
Run the multi-container application:
docker compose up -d
Visit http://localhost:8081
to verify the Nginx service is running. Use Docker Desktop’s dashboard to monitor these containers and their resource usage.
Troubleshooting Common Issues
Even with careful installation, you might encounter issues with Docker Desktop on CentOS Stream 10. Here are solutions to common problems:
Permission and Access Problems
If you receive “permission denied” errors:
# Check if your user is in the docker group
groups
# Add your user to the docker group if needed
sudo usermod -aG docker $USER
newgrp docker
Networking and Connectivity Issues
For container networking problems:
# Restart Docker service
sudo systemctl restart docker
# Check Docker's network configuration
docker network ls
docker network inspect bridge
Resource Limitation Problems
If containers fail due to resource constraints:
- Open Docker Desktop
- Go to Settings > Resources
- Increase CPU, memory, or disk allocations
Compatibility Issues with CentOS Stream 10
For compatibility problems:
# Ensure all dependencies are installed
sudo dnf install -y fuse-overlayfs iptables container-selinux
# Verify Docker is using the correct storage driver
docker info | grep "Storage Driver"
Common Error Messages
For the “Cannot connect to the Docker daemon” error:
# Check if Docker daemon is running
sudo systemctl status docker
# Start it if needed
sudo systemctl start docker
For GUI-related issues:
# Restart the Docker Desktop service
systemctl --user restart docker-desktop
# Check for error logs
journalctl --user -u docker-desktop
These troubleshooting steps address most common issues that users encounter when installing Docker Desktop on CentOS Stream 10.
Performance Optimization
Optimize Docker Desktop’s performance with these strategies:
Resource Allocation Best Practices
Allocate appropriate resources to Docker Desktop based on your workload:
- For development: 2 CPUs, 4GB RAM, 20GB disk
- For testing: 4 CPUs, 8GB RAM, 40GB disk
- For heavy workloads: 6+ CPUs, 16GB RAM, 100GB+ disk
Configure these in Docker Desktop’s settings under Resources.
Storage Configuration Optimization
Choose the right storage driver for your workload:
sudo tee /etc/docker/daemon.json <<EOF
{
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
]
}
EOF
sudo systemctl restart docker
The overlay2 driver generally offers the best performance for CentOS Stream 10.
Network Performance Settings
Optimize network performance:
sudo tee -a /etc/docker/daemon.json <<EOF
{
"mtu": 1500,
"default-address-pools": [
{"base": "172.30.0.0/16", "size": 24}
]
}
EOF
sudo systemctl restart docker
This configures the Maximum Transmission Unit (MTU) and address pools for container networks.
Memory and CPU Limitation Strategies
Implement resource constraints for individual containers:
docker run -d --name constrained-app --memory=512m --cpus=0.5 nginx
This ensures high-priority containers have necessary resources and prevents any single container from consuming excessive resources.
Advanced Features of Docker Desktop
Docker Desktop includes several advanced features to enhance your container workflows:
Working with Docker Extensions
Docker Desktop supports extensions that add functionality:
- Click on “Extensions” in the left sidebar
- Browse available extensions
- Install extensions like Disk Usage Analyzer or Resource Usage Monitor
Extensions provide additional tools without leaving the Docker Desktop interface.
Setting Up and Managing Kubernetes
Enable Kubernetes in Docker Desktop:
- Open Settings > Kubernetes
- Check “Enable Kubernetes”
- Click “Apply & Restart”
Once enabled, verify with:
kubectl get nodes
This allows you to run Kubernetes workloads locally for development and testing.
Integration with Development Environments
Docker Desktop integrates with popular IDEs:
- Visual Studio Code: Install the “Docker” extension
- JetBrains IDEs: Use the built-in Docker integration
These integrations allow you to manage containers directly from your development environment.
Container Monitoring and Logging
Monitor containers in real-time:
- View basic metrics in the Containers tab
- Install monitoring extensions for detailed analytics
- Configure logging drivers for centralized logging:
sudo tee -a /etc/docker/daemon.json <<EOF
{
"log-driver": "syslog",
"log-opts": {
"syslog-address": "tcp://192.168.1.100:514"
}
}
EOF
sudo systemctl restart docker
This sends container logs to a central syslog server for analysis.
Upgrading and Maintaining Docker Desktop
Proper maintenance ensures Docker Desktop continues to function optimally:
Updating Docker Desktop
Update Docker Desktop through the application:
- Click on the gear icon > About Docker Desktop
- If updates are available, click “Update & Restart”
Alternatively, download the latest RPM and upgrade:
wget https://desktop.docker.com/linux/main/amd64/docker-desktop-latest-x86_64.rpm
sudo dnf upgrade -y ./docker-desktop-latest-x86_64.rpm
Managing Docker Images and Containers
Regularly clean up unused resources:
# Remove unused containers
docker container prune
# Remove unused images
docker image prune
# Remove all unused objects
docker system prune -a
Backup and Restore Strategies
Back up important Docker data:
# Back up Docker configuration
sudo tar -czf docker-config-backup.tar.gz /etc/docker /var/lib/docker
# Back up specific volumes
docker run --rm -v your_volume:/volume -v $(pwd):/backup alpine tar -czf /backup/volume-backup.tar.gz -C /volume ./
These backups can be restored when needed to recover from system failures or migrations.
Docker Desktop for Development Workflows
Docker Desktop enhances development workflows with powerful features:
Integrating with Code Editors and IDEs
Set up Docker integration in popular editors:
- VSCode: Install the Docker extension and connect to Docker Desktop
- JetBrains IDEs: Configure Docker in Settings > Build, Execution, Deployment > Docker
This allows you to manage containers, build images, and debug containerized applications directly from your editor.
Setting Up Development Containers
Create development containers for consistent environments:
# Example devcontainer.json
{
"name": "Python Dev Environment",
"image": "python:3.10",
"extensions": [
"ms-python.python"
],
"postCreateCommand": "pip install -r requirements.txt"
}
This provides isolated, reproducible development environments for team members.
Volume Mapping for Live Code Updates
Map local code directories to containers for immediate code updates:
docker run -d -p 8080:80 -v $(pwd):/app my-dev-image
Changes to local files are immediately reflected in the container without rebuilding.
Using Docker Compose for Multi-Service Development
Create a docker-compose.yml file for multi-container applications:
version: '3'
services:
web:
build: ./web
volumes:
- ./web:/app
ports:
- "8000:8000"
db:
image: postgres:13
environment:
POSTGRES_PASSWORD: example
redis:
image: redis:alpine
Run with docker compose up -d
to start all services simultaneously.
Security Considerations
Maintaining security is crucial when using Docker Desktop:
Securing Your Docker Installation
Implement basic security measures:
# Run Docker daemon with limited permissions
sudo tee -a /etc/docker/daemon.json <<EOF
{
"userns-remap": "default"
}
EOF
sudo systemctl restart docker
This enables user namespace remapping, isolating container processes from the host.
Managing Container Privileges
Run containers with minimal privileges:
docker run --security-opt=no-new-privileges --cap-drop=ALL --cap-add=NET_BIND_SERVICE nginx
This prevents privilege escalation and drops unnecessary capabilities.
Network Security for Containers
Isolate container networks:
# Create an isolated network
docker network create --internal private_network
# Run container in the isolated network
docker run --network private_network my-internal-service
Containers on this network cannot access external networks unless explicitly allowed.
Image Scanning and Vulnerability Detection
Scan images for vulnerabilities:
# Install Docker Scout
docker extension install docker/scout-extension
# Scan an image
docker scout cves nginx:latest
This identifies potential security vulnerabilities in container images.
Congratulations! You have successfully installed Docker Desktop. Thanks for using this tutorial to install the latest version of Docker Desktop on CentOS Stream 10. For additional help or useful information, we recommend you check the official Docker website.