Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Docker»How to Install Docker on Debian 10 (Buster)

    How to Install Docker on Debian 10 (Buster)

    By RahulJuly 26, 20193 Mins Read

    Docker is a container-based application framework, which wraps a specific application with all its dependencies in a container. Docker containers can easily to ship to the remote location on start there without making entire application setup. This tutorial will help you to install Docker on Debian 10 Buster Linux distribution.

    Advertisement

    Step 1 – Prerequisites

    First of all, remove any default Docker packages from the system before installation Docker on a Linux VPS. Execute commands to remove unnecessary Docker versions.

    sudo apt-get purge docker lxc-docker docker-engine docker.io
    

    Now, install some required packages on your system for installing Docker on Debian system. Run the below commands to do this:

    sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
    

    Step 2 – Setup Docker PPA

    After that, you need to import dockers official GPG key to verify packages signature before installing them with apt-get. Run the below command on terminal.

    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
    

    After that add the Docker repository on your Debian system which contains Docker packages including its dependencies. You must have to enable this repository to install Docker on Debian.

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian buster stable"
    

    Step 3 – Install Docker on Debian 10

    Your system is now ready for Docker installation. Run the following commands to upgrade apt index and then install Docker community edition on Debian.

    sudo apt-get update
    sudo apt-get install docker-ce
    

    After successful installation of Docker community edition, the service will start automatically, Use below command to verify service status.

    sudo systemctl status docker
    

    Your system is now ready for running Docker containers. Use our Docker Tutorial for Beginners to working with Docker.

    Step 4 – How to Use Docker

    After installation of Docker on a Linux. Here are some basic details for search and download Docker images, launch containers and manage them.

    Search Docker Images

    docker search debian
    

    Download Docker Images

    docker pull debian
    

    Now make sure that the above images have been downloaded successfully on your system. Below command list all images.

    docker images
    
    REPOSITORY    TAG          IMAGE ID            CREATED         SIZE
    debian        latest       3bbb526d2608        4 weeks ago     101MB
    

    Launch New Container with Image

    docker run -i -t debian /bin/bash
    

    To exit from docker container type CTRL + P + Q. This will leave container running in the background an provide you host system console. If you used the exit command, it will stop the current container.

    After exiting from Docker container, execute below command to list all running containers.

    docker ps
    
    CONTAINER ID     IMAGE     COMMAND        CREATED        STATUS        PORTS    NAMES
    g86370300af15     debian    "/bin/bash"    2 hours ago    Up 2 hours             first_debian
    

    By default Above command will list only running containers. To list all containers (including stopped container) use the following command.

    docker ps -a
    

    Start/Stop/Attach Container

    You can start, stop or attach to any containers with following commands. To start container use following command.

    docker start <CONTAINER_ID>
    

    To stop container use following command.

    docker stop <CONTAINER_ID>
    

    To attach to currently running container use following command.

    docker attach <CONTAINER_ID>
    

    Step 5 – Remove Docker

    To remove docker from your Debian system run following command.

    sudo apt purge docker-ce
    

    debian Debian 10 Docker
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Install Flask on Debian

    How to Install and Use Flask on Debian 11/10

    Running a Cronjob Inside Docker: A Beginner’s Guide

    Running a Cronjob Inside Docker: A Beginner’s Guide

    Docker Run: A Beginner’s Guide to Run Docker Containers

    Docker Run: A Beginner’s Guide to Run Docker Containers

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.