How to reinstall docker
How to reinstall docker
Install Docker Desktop on Debian
Estimated reading time: 5 minutes
This page contains information on how to install, launch, and upgrade Docker Desktop on a Debian distribution.
Prerequisites
To install Docker Desktop successfully, you must:
If you have installed the Docker Desktop for Linux tech preview or beta version, you need to remove all files that were generated by those packages (eg.
For a Gnome Desktop environment, you must also install AppIndicator and KStatusNotifierItem Gnome extensions.
For non-Gnome Desktop environments, gnome-terminal must be installed:
Install Docker Desktop
Recommended approach to install Docker Desktop on Debian:
Install the package with apt as follows:
At the end of the installation process, apt displays an error due to installing a downloaded package. You can ignore this error message.
There are a few post-install configuration steps done through the post-install script contained in the deb package.
The post-install script:
Launch Docker Desktop
To start Docker Desktop for Linux, search Docker Desktop on the Applications menu and open it. This launches the whale menu icon and opens the Docker Dashboard, reporting the status of Docker Desktop.
Alternatively, open a terminal and run:
When Docker Desktop starts, it creates a dedicated context that the Docker CLI can use as a target and sets it as the current context in use. This is to avoid a clash with a local Docker Engine that may be running on the Linux host and using the default context. On shutdown, Docker Desktop resets the current context to the previous one.
After you’ve successfully installed Docker Desktop, you can check the versions of these binaries by running the following commands:
To enable Docker Desktop to start on login, from the Docker menu, select Settings > General > Start Docker Desktop when you log in.
Alternatively, open a terminal and run:
To stop Docker Desktop, click on the whale menu tray icon to open the Docker menu and select Quit Docker Desktop.
Alternatively, open a terminal and run:
Upgrade Docker Desktop
Once a new version for Docker Desktop is released, the Docker UI shows a notification. You need to download the new package each time you want to upgrade Docker Desktop and run:
Install Docker Engine on RHEL
Estimated reading time: 10 minutes
To get started with Docker Engine on RHEL, make sure you meet the prerequisites, then install Docker.
Prerequisites
We currently only provide packages for RHEL on s390x (IBM Z). Other architectures are not yet supported for RHEL, but you may be able to install the CentOS packages on RHEL. Refer to the Install Docker Engine on CentOS page for details.
OS requirements
To install Docker Engine, you need a maintained version of RHEL 7, RHEL 8 or RHEL 9 on s390x (IBM Z). Archived versions aren’t supported or tested.
The overlay2 storage driver is recommended.
Uninstall old versions
It’s OK if yum reports that none of these packages are installed.
Installation methods
You can install Docker Engine in different ways, depending on your needs:
Most users set up Docker’s repositories and install from them, for ease of installation and upgrade tasks. This is the recommended approach.
Some users download the RPM package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
In testing and development environments, some users choose to use automated convenience scripts to install Docker.
Install using the repository
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
Set up the repository
Install the yum-utils package (which provides the yum-config-manager utility) and set up the repository.
Install Docker Engine
Install the latest version of Docker Engine, containerd, and Docker Compose or go to the next step to install a specific version:
This command installs Docker, but it doesn’t start Docker. It also creates a docker group, however, it doesn’t add any users to the group by default.
To install a specific version of Docker Engine, list the available versions in the repo, then select and install:
a. List and sort the versions available in your repo. This example sorts results by version number, highest to lowest, and is truncated:
This command installs Docker, but it doesn’t start Docker. It also creates a docker group, however, it doesn’t add any users to the group by default.
Verify that Docker Engine is installed correctly by running the hello-world image.
This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
This installs and runs Docker Engine. Use sudo to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.
Upgrade Docker Engine
To upgrade Docker Engine, follow the installation instructions, choosing the new version you want to install.
Install from a package
Install Docker Engine, changing the path below to the path where you downloaded the Docker package.
Docker is installed but not started. The docker group is created, but no users are added to the group.
Verify that Docker Engine is installed correctly by running the hello-world image.
This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
This installs and runs Docker Engine. Use sudo to run Docker commands. Continue to Post-installation steps for Linux to allow non-privileged users to run Docker commands and for other optional configuration steps.
Upgrade Docker Engine
Install using the convenience script
Docker provides a convenience script at get.docker.com to install Docker into development environments quickly and non-interactively. The convenience script is not recommended for production environments, but can be used as an example to create a provisioning script that is tailored to your needs. Also refer to the install using the repository steps to learn about installation steps to install using the package repository. The source code for the script is open source, and can be found in the docker-install repository on GitHub.
Always examine scripts downloaded from the internet before running them locally. Before installing, make yourself familiar with potential risks and limitations of the convenience script:
Tip: preview script steps before running
You can run the script with the DRY_RUN=1 option to learn what steps the script will execute during installation:
This example downloads the script from get.docker.com and runs it to install the latest stable release of Docker on Linux:
Docker is installed. The docker service starts automatically on Debian based distributions. On RPM based distributions, such as CentOS, Fedora, RHEL or SLES, you need to start it manually using the appropriate systemctl or service command. As the message indicates, non-root users cannot run Docker commands by default.
Use Docker as a non-privileged user, or install in rootless mode?
The installation script requires root or sudo privileges to install and use Docker. If you want to grant non-root users access to Docker, refer to the post-installation steps for Linux. Docker can also be installed without root privileges, or configured to run in rootless mode. For instructions on running Docker in rootless mode, refer to run the Docker daemon as a non-root user (rootless mode).
Install pre-releases
To install the latest version of Docker on Linux from the “test” channel, run:
Upgrade Docker after using the convenience script
If you installed Docker using the convenience script, you should upgrade Docker using your package manager directly. There is no advantage to re-running the convenience script, and it can cause issues if it attempts to re-add repositories which have already been added to the host machine.
Uninstall Docker Engine
Uninstall the Docker Engine, CLI, Containerd, and Docker Compose packages:
Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:
You must delete any edited configuration files manually.
Install Docker Engine on Debian
Estimated reading time: 10 minutes
To get started with Docker Engine on Debian, make sure you meet the prerequisites, then install Docker.
Prerequisites
OS requirements
To install Docker Engine, you need the 64-bit version of one of these Debian or Raspbian versions:
Uninstall old versions
It’s OK if apt-get reports that none of these packages are installed.
Installation methods
You can install Docker Engine in different ways, depending on your needs:
Most users set up Docker’s repositories and install from them, for ease of installation and upgrade tasks. This is the recommended approach, except for Raspbian.
Some users download the DEB package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
In testing and development environments, some users choose to use automated convenience scripts to install Docker. This is currently the only approach for Raspbian.
Install using the repository
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
Raspbian users cannot use this method!
For Raspbian, installing using the repository is not yet supported. You must instead use the convenience script.
Set up the repository
Update the apt package index and install packages to allow apt to use a repository over HTTPS:
Add Docker’s official GPG key:
Use the following command to set up the repository:
Install Docker Engine
Update the apt package index, and install the latest version of Docker Engine, containerd, and Docker Compose, or go to the next step to install a specific version:
To install a specific version of Docker Engine, list the available versions in the repo, then select and install:
a. List the versions available in your repo:
b. Install a specific version using the version string from the second column, for example, 5:18.09.1
Verify that Docker Engine is installed correctly by running the hello-world image.
This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
Docker Engine is installed and running. The docker group is created but no users are added to it. You need to use sudo to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.
Upgrade Docker Engine
Install from a package
Install Docker Engine, changing the path below to the path where you downloaded the Docker package.
The Docker daemon starts automatically.
Verify that Docker Engine is installed correctly by running the hello-world image.
This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
Docker Engine is installed and running. The docker group is created but no users are added to it. You need to use sudo to run Docker commands. Continue to Post-installation steps for Linux to allow non-privileged users to run Docker commands and for other optional configuration steps.
Upgrade Docker Engine
To upgrade Docker Engine, download the newer package file and repeat the installation procedure, pointing to the new file.
Install using the convenience script
Docker provides a convenience script at get.docker.com to install Docker into development environments quickly and non-interactively. The convenience script is not recommended for production environments, but can be used as an example to create a provisioning script that is tailored to your needs. Also refer to the install using the repository steps to learn about installation steps to install using the package repository. The source code for the script is open source, and can be found in the docker-install repository on GitHub.
Always examine scripts downloaded from the internet before running them locally. Before installing, make yourself familiar with potential risks and limitations of the convenience script:
Tip: preview script steps before running
You can run the script with the DRY_RUN=1 option to learn what steps the script will execute during installation:
This example downloads the script from get.docker.com and runs it to install the latest stable release of Docker on Linux:
Docker is installed. The docker service starts automatically on Debian based distributions. On RPM based distributions, such as CentOS, Fedora, RHEL or SLES, you need to start it manually using the appropriate systemctl or service command. As the message indicates, non-root users cannot run Docker commands by default.
Use Docker as a non-privileged user, or install in rootless mode?
The installation script requires root or sudo privileges to install and use Docker. If you want to grant non-root users access to Docker, refer to the post-installation steps for Linux. Docker can also be installed without root privileges, or configured to run in rootless mode. For instructions on running Docker in rootless mode, refer to run the Docker daemon as a non-root user (rootless mode).
Install pre-releases
To install the latest version of Docker on Linux from the “test” channel, run:
Upgrade Docker after using the convenience script
If you installed Docker using the convenience script, you should upgrade Docker using your package manager directly. There is no advantage to re-running the convenience script, and it can cause issues if it attempts to re-add repositories which have already been added to the host machine.
Uninstall Docker Engine
Uninstall the Docker Engine, CLI, Containerd, and Docker Compose packages:
Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:
You must delete any edited configuration files manually.
DOCKER (How to install DOCKER on Linux)
Today we are going to learn how to install Docker on Linux and as always we will go to very basics step by step. At the end of this session, we will also look some useful tips.
In this session we will look at some prerequisites ;
Let’s get Started
You must be having some Linux system to learn this tutorial because we are going to install Docker to Linux systems. If you do not have a Linux system and you want to do it in hands-on you can get a free Linux instance from Amazon AWS. Use this link to get a free Linux instance from Amazon. You can create a free account and get a free instance.
AWS Free Tier
Gain free, hands-on experience with the AWS platform, products, and services Explore more than 60 products and start…
Connect to Linux
As a part of prerequisites type this command and check information about your operating system.
OS requirements
To install Docker Engine — Community, you need the 64-bit version of one of these Ubuntu versions:
You will get all the information related to installing Docker to your machine using this link.
Uninstall old versions
It’s OK if apt-get reports that none of these packages are installed.
Install Docker
Before you install Docker Engine — Community for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
2. Install packages to allow apt to use a repository over HTTPS:
3. Add Docker’s official GPG key:
Verify that you now have the key with the fingerprint by searching for the last 8 characters of the fingerprint.
4. Use the following command to set up a stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below.
INSTALL DOCKER ENGINE — COMMUNITY
First, we will use this command to update the apt package index.
Then install the latest version of Docker Engine — Community and containerd, or go to the next step to install a specific version:
If you have multiple Docker repositories enabled, installing or updating without specifying a version in the apt-get install or apt-get update command always installs the highest possible version, which may not be appropriate for your stability needs.
To install a specific version of Docker Engine — Community, list the available versions in the repo, then select and install:
Use this command to list the versions available in your repo:
To check Docker version type this command
4. Verify that Docker Engine — Community is installed correctly by running the hello-world image.
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
UPGRADE DOCKER ENGINE — COMMUNITY
Now Docker is successfully installed to your system.
Start Docker
To start Docker use this command
You can add your user to the Docker group (Optional). For example my user is userEx and run this command
Now you can run some Docker commands.
This will list all the images.
This will list all running containers.
As mentioned above to run the image you can type the command
If the images are not present on your system ideally Docker should get this image from Docker Hub which is an online Docker repository and then run the image and start the container.
Stop Docker
You can use the below command to stop Docker.
Uninstall Docker
You can use this command to uninstall Docker from your machine.
How to Install Docker On Ubuntu 18.04
Home » SysAdmin » How to Install Docker On Ubuntu 18.04
Docker is an increasingly popular software package that creates a container for application development.
Developing in Docker speeds up applications, as it shares the kernel and other resources, instead of requiring dedicated server resources.
There are two versions of Docker – Docker CE (Community Edition) and Docker EE (Enterprise Edition). If you have a small-scale project, or you’re just learning, you will want to use Docker CE.
In this tutorial, learn how to install Docker on Ubuntu 18.04.
Option 1: Install Docker on Ubuntu Using Default Repositories
Step 1: Update Software Repositories
It’s a good idea to update the local database of software to make sure you’ve got access to the latest revisions.
Open a terminal window and type:
Allow the operation to complete.
Step 2: Uninstall Old Versions of Docker
Next, it’s recommended to uninstall any old Docker software before proceeding.
Use the command:
Step 3: Install Docker on Ubuntu 18.04
To install Docker on Ubuntu, in the terminal window enter the command:
Step 4: Start and Automate Docker
The Docker service needs to be setup to run at startup. To do so, type in each command followed by enter:
Step 5 (Optional): Check Docker Version
To verify the installed Docker version number, enter:
Note: The official Docker website does not offer support for Ubuntu 18.04. It’s possible that the Ubuntu default repositories have not updated to the latest revision. There’s nothing wrong with running this installation. However, if you are up for a slightly more intensive operation, you can install a more recent (or specific) Docker from the official Docker repositories.
Option 2: Install Docker from Official Repository
Step 1: Update Local Database
Update the local database with the command:
Step 2: Download Dependencies
You’ll need to run these commands to allow your operating system to access the Docker repositories over HTTPS.
In the terminal window, type:
To clarify, here’s a brief breakdown of each command:
Step 3: Add Docker’s GPG Key
The GPG key is a security feature.
To ensure that the software you’re installing is authentic, enter:
Step 4: Install the Docker Repository
To install the Docker repository, enter the command:
A stable release is tested and confirmed to work, but updates are released less frequently. You may substitute edge if you’d like more frequent updates, at the cost of potential instability. There are other repositories, but they are riskier – more info can be found on the Docker web page.
Step 5: Update Repositories
Update the repositories you just added:
Step 6: Install Latest Version of Docker
To install the latest version of docker:
Step 7 (Optional): Install Specific Version of Docker
List the available versions of Docker by entering the following in a terminal window:
The system should return a list of available versions as in the image above.
At this point, type the command:
However, substitute [version] for the version you want to install (pulled from the list you just generated).
2. Next, click on the pool link, then stable, then amd64. This is the location of the stable Docker releases for Ubuntu 18.04.
3. Click on the Docker engine you want to install and the .deb package downloads automatically. Make a note of the path where you saved it.
4. To install Docker, run the following command (using the path of the downloaded Docker package):
Allow the installer to run.
Option 4: Install Docker from a Convenience Script
For installing edge or testing versions of Docker, you can use convenience scripts.
This method should not be used in production environments or if you already have another version of Docker installed on your system.
Make sure to inspect the scripts before downloading and running them on your system.
Install Docker Engine – Community
To install the latest Docker engine, use the get.docker.com script by running the command:
Run the script to start the installation:
The Docker service will start automatically.
Note: Using convenience scripts does not allow you to customize installation parameters or choose the Docker version.
Install Docker Testing Version
To install the latest testing version of Docker, use the test.docker.com script:
Start the installation by running the command:
Great job! You’ve got four (4) different options for installing Docker on Ubuntu 18.04.
Finally, you can check the Docker guides if you get into trouble, plus they have a fairly robust forum you can search. Happy developing!