How to Install Docker on Amazon Linux 2023?
Step 1: Update the Package Repository
First, it's a good practice to ensure that your package repository is up-to-date. Open a terminal and run the following command:
sudo dnf update
Step 2: Install Docker
Now, let's install Docker on Amazon Linux 2023. Use the following command:
sudo dnf install docker
Step 3: Start the Docker Service
To start the Docker service, run the following command:
sudo systemctl start docker
Step 4: Enable Docker on Boot
If you want Docker to start automatically every time your Amazon Linux instance boots up, enable the Docker service with this command:
sudo systemctl enable docker
Step 5: Check Docker Status
To verify that Docker is up and running without any issues, use the following command:
sudo systemctl status docker
Step 6: Add Your User to the Docker Group
By default, Docker commands require root privileges or sudo
. To run Docker commands without sudo
, add your user to the Docker group:
sudo usermod -aG docker $USER
Step 7: Verify Docker Installation
To confirm that Docker has been successfully installed, check its version by running:
docker --version
Step 8: Uninstall Docker (Optional)
If you ever need to remove Docker from your Amazon Linux 2023 instance, you can do so with the following command:
sudo dnf remove docker
Comments
Post a Comment