This guide explains how to install Docker Engine on a Linux system. Docker Engine is a prerequisite for installing NiralOS EDGE.
Supported Distributions #
This guide uses Ubuntu as the reference distribution. The steps are applicable to
Ubuntu 22.04 LTS, Ubuntu 24.04 LTS, and other Debian-based distributions.
Prerequisites #
Before installing Docker Engine, ensure that:
- You have a supported Linux distribution.
- You have a user account with sudo privileges.
- The system has an active Internet connection.
- Any older Docker packages have been removed (if previously installed).
Step 1. Update the Package Index #
Open a terminal and update the package repository.
sudo apt update
Step 2. Install Required Packages #
Install the packages required to add Docker’s official repository.
sudo apt install -y ca-certificates curl gnupg
Step 3. Create the Docker Keyring Directory #
Create the directory used to store Docker’s GPG key.
sudo install -m 0755 -d /etc/apt/keyrings
Step 4. Download Docker’s GPG Key #
Download and save Docker’s official signing key.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Set the correct permissions on the key.
sudo chmod a+r /etc/apt/keyrings/docker.gpg
Step 5. Add the Docker Repository #
Add Docker’s official APT repository to your system.
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Step 6. Refresh Package Information #
Update the package index to include Docker packages.
sudo apt update
Step 7: Install Docker Engine #
Install Docker Engine along with the required components.
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 8: Verify Docker Service #
Check whether the Docker service is running.
sudo systemctl status docker
A successful installation should show the service as:
Active: active (running)
Press Q to exit the status screen.
Step 9: Start Docker (If Required) #
If Docker is not already running, start the service.
sudo systemctl start docker
Enable Docker to start automatically on system boot.
sudo systemctl enable docker
Step 10: Allow the Current User to Run Docker #
Add your user account to the docker group.
sudo usermod -aG docker $USER
Apply the new group membership without logging out.
newgrp docker
Note: If the new group membership is not applied immediately, log out and log back into your Linux session.
Step 11: Verify Docker Installation #
Check the installed Docker version.
docker --version
Example output: Docker version 28.x.x
Step 12: Verify Docker Engine #
Display Docker system information.
docker info
The command should complete without permission errors.
Step 13: Test Docker #
Run Docker’s official test container.
docker run hello-world
A successful installation displays a message similar to: Hello from Docker!
This message shows that your installation appears to be working correctly.
Step 14: Verify User Permissions #
Run the following command without using sudo.
docker ps
If an empty container list is displayed, your user has permission to access Docker Engine.
Example:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Installation Complete #
Docker Engine is now installed and ready for use.
You can proceed with the NiralOS EDGE interactive installer:
curl -fsSL https://niraledge.com/install.sh | bash
Troubleshooting #
Permission Denied While Running Docker
If you receive a permission error when executing Docker commands:
- Verify that your user has been added to the docker group.Â
- Log out and log back in, or run:Â
newgrp docker
Docker Service Is Not Running #
Check the Docker service status.
sudo systemctl status docker
If necessary, start the service.
sudo systemctl start docker
Docker Command Not Found #
If the docker command is not recognized:
- Verify that Docker Engine was installed successfully.Â
- Refresh the package index and reinstall Docker if required.Â
- Open a new terminal session and run:Â
docker --version
Verify Installation #
The following commands should all execute successfully:
docker --version
docker info
docker run hello-world
docker ps