How to Install Docker on Linux Mint in One Command

Why on Linux Mint? Well, because I have a Linux Mint computer. I’ve successfully installed Docker on my computer and here’s the one-line command on how to do it without the mumbo jumbo of the official Docker docs. if this post gets traction, I might write another Docker Installation tutorial for other distros.

Tested on

Here’s the command for a one-line Docker install on Linux Mint:

Install Docker With Curl
curl -L s.revonzev.com/install-docker-linux-mint-curl | bash
Bash

Or the full command:

Install Docker
sudo apt-get update && \
    sudo apt-get -y install ca-certificates curl && \
    sudo install -m 0755 -d /etc/apt/keyrings && \
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
    sudo chmod a+r /etc/apt/keyrings/docker.asc && \
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$UBUNTU_CODENAME") stable" | \
    sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
    sudo apt-get update && \
    sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && \
    sudo docker run hello-world && \
    sudo groupadd docker ;
    sudo usermod -aG docker $USER && \
    sudo mkdir /home/"$USER"/.docker
    sudo chown "$USER":"$USER" /home/"$USER"/.docker -R && \
    sudo chmod g+rwx "$HOME/.docker" && \
    docker run hello-world
Bash

Do restart afterward if you see the following error:

Docker Socket Error
docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Head "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied.
Plaintext

Then try to run docker run hello-world to see if you can run docker without sudo permission.

Some docker images need you to log in, you can do so by running docker login command.

You can find the official Ubuntu Docker installation steps here: s.revonzev.com/official-docker-ubuntu-tutorial

Or other official Docker installation steps for other distro (CentOS, Debian, Fedora, Pi, RHEL SLES, Ubuntu) here: s.revonzev.com/official-docker-tutorial

I made this post because I just want to copy and paste and be done with it every time I start a fresh Linux Mint install.


Posted

in

by


Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments