Introduction
This guide explains how to install Docker on your Linux system using the official get.docker.com script. This method is quick and ensures you have the latest Docker version.
Step 1: Update System Packages
Ensure your system is up to date before proceeding:
Step 2: Download and Run the Installation Script
Use the following command to download and execute the Docker installation script:
sudo sh get-docker.sh
The script detects your operating system and installs Docker accordingly.
Step 3: Verify Docker Installation
After installation, verify that Docker is installed and running:
This should display the installed Docker version. You can also check the Docker service status:
Step 4: Add Your User to the Docker Group (Optional)
By default, Docker requires root privileges. To run Docker without using sudo
, add your user to the Docker group:
Log out and log back in for this change to take effect, or run:
Step 5: Test Docker
Run the following command to test Docker functionality:
This downloads a test image and runs it as a container. If successful, you'll see a welcome message.
Troubleshooting
If you encounter issues, try these steps:
- Ensure your user is in the Docker group if you get a permission error.
- Restart the Docker service:
- Check Docker logs for errors:
Official Documentation
Docker is now installed on your system and ready for use. Refer to the Docker documentation for further guidance on managing containers, images, and services.