Skip to content
Blog

Installing Docker Engine on Amazon Linux 2023 for AWS Workloads

Deploying Docker on AWS EC2 instances running Amazon Linux 2023, dnf install docker, EC2 user permissions, and systemd auto-start.

Published on • October 24, 2026

AI Assistant

Amazon Linux 2023 (AL2023) is AWS’s optimized Linux operating system for EC2 cloud workloads. AL2023 ships Docker in its native package repository, tuned specifically for AWS Nitro System hypervisors, AWS Graviton processors, and Amazon ECR integration.

In this guide, we cover deploying and configuring Docker Engine on Amazon Linux 2023 EC2 instances.

Step 1: Update Packages & Install Docker

SSH into your Amazon Linux 2023 EC2 instance and run dnf package management updates:

# Update system repositories
sudo dnf update -y

# Install Docker Engine from AL2023 repository
sudo dnf install -y docker

Step 2: Start & Enable Docker Daemon

Enable the Docker daemon to launch automatically upon EC2 instance reboots:

sudo systemctl enable --now docker

# Check daemon status
sudo systemctl status docker

Step 3: Configure ec2-user Non-Root Permissions

By default, the default AWS SSH user ec2-user must use sudo to execute container operations. Grant non-root Docker access by adding ec2-user to the docker group:

sudo usermod -aG docker ec2-user

# Reload group permissions without logging out
newgrp docker

Verify permission configuration without sudo:

docker info

Step 4: Installing Docker Compose Plugin

To install Docker Compose v2 on Amazon Linux 2023:

# Download latest Docker Compose binary
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

# Verify compose plugin installation
docker compose version

Step 5: Test Docker Execution

Run a lightweight container to verify network routing and storage volume allocation:

docker run --rm -p 80:80 nginx:alpine

Summary

Amazon Linux 2023 provides a fast, cloud-optimized platform for running containerized microservices and AI workloads in AWS EC2 environments.

References & Further Reading