Skip to main content

Install Docker ANY Linux Distro

Docker Installer & Verifier

A production-ready bash script that detects whether Docker is already installed and, if not, installs Docker CE + the Docker Compose plugin using the official repository for your Linux distribution.

🚀 One-Line Download & Execute :
apt update && apt install -y curl && clear && curl -s https://docs.greenhome.stream/attachments/69 | bash

🇬🇧 English

Features

  • Smart detection — if Docker and Compose are already installed and working, the script exits cleanly without touching anything.
  • Multi-distro support — Debian, Ubuntu, Raspberry Pi OS, Fedora, RHEL, Rocky, AlmaLinux, CentOS, Arch, Manjaro, openSUSE, SLES, Alpine.
  • Real verification at every step — binary presence, daemon reachability, Compose plugin, and a final hello-world container run.
  • Auto-installs missing dependencies (curl, gnupg, lsb-release, etc.) before touching Docker.
  • Colored output: orange [PROC], green [ OK ], red [FAIL], cyan [INFO].
  • Idempotent — safe to run multiple times.
  • Sudo-aware — works as root or as a regular user with sudo.
  • Adds your user to the docker group so you don't need sudo docker after logout/login.

Requirements

  • A supported Linux distribution (see above).
  • Either root access or a user in the sudo group.
  • Internet connection (to reach the Docker repository).

Usage

Download and run:

curl -fsSL -o install-docker.sh https://example.com/install-docker.sh
chmod +x install-docker.sh
./install-docker.sh

Or if you already have it locally:

chmod +x install-docker.sh
./install-docker.sh

What it does, step by step

  1. Clears the screen and shows a banner.
  2. Sets up sudo — uses root if already root, otherwise requires sudo.
  3. Detects OS family via /etc/os-release and picks the right package manager.
  4. Checks if Docker is installed — verifies the binary, the daemon, and the Compose plugin.
  5. If everything is OK → exits with a green success message. Nothing is installed.
  6. If only Compose is missing → installs only the Compose plugin.
  7. If Docker is missing → adds the official Docker repository for your distro, installs docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, docker-compose-plugin, enables and starts the service, runs hello-world as a final sanity check, and adds your user to the docker group.

Exit codes

  • 0 — success (either already installed or freshly installed).
  • Any non-zero — a step failed; a red [FAIL] message explains what.

Troubleshooting

  • "permission denied" after install — log out and log back in so the new docker group membership takes effect, or run newgrp docker.
  • Behind a proxy — export HTTP_PROXY/HTTPS_PROXY before running the script.
  • Old Docker from distro repo — uninstall docker.io / podman-docker first with your package manager, then re-run this script to get the official Docker CE.

🇬🇷 Ελληνικά

Χαρακτηριστικά

  • Έξυπνος εντοπισμός — αν το Docker και το Compose είναι ήδη εγκατεστημένα και λειτουργούν, το script τερματίζει καθαρά χωρίς να αγγίξει τίποτα.
  • Υποστήριξη πολλών διανομών — Debian, Ubuntu, Raspberry Pi OS, Fedora, RHEL, Rocky, AlmaLinux, CentOS, Arch, Manjaro, openSUSE, SLES, Alpine.
  • Πραγματική επαλήθευση σε κάθε βήμα — ύπαρξη binary, προσβασιμότητα daemon, Compose plugin, και τελικό τρέξιμο του hello-world.
  • Αυτόματη εγκατάσταση εξαρτήσεων (curl, gnupg, lsb-release κ.λπ.) πριν την εγκατάσταση του Docker.
  • Έγχρωμη έξοδος: πορτοκαλί [PROC], πράσινο [ OK ], κόκκινο [FAIL], κυανό [INFO].
  • Idempotent — ασφαλές να τρέξει πολλές φορές.
  • Υποστηρίζει sudo — λειτουργεί ως root ή ως κανονικός χρήστης με sudo.
  • Προσθέτει τον χρήστη σας στην ομάδα docker ώστε να μη χρειάζεται sudo docker μετά από logout/login.

Προϋποθέσεις

  • Υποστηριζόμενη διανομή Linux (βλ. παραπάνω).
  • Πρόσβαση root ή χρήστης στην ομάδα sudo.
  • Σύνδεση στο διαδίκτυο (για πρόσβαση στο αποθετήριο του Docker).

Χρήση

Κατεβάστε και τρέξτε:

curl -fsSL -o install-docker.sh https://example.com/install-docker.sh
chmod +x install-docker.sh
./install-docker.sh

Ή, αν το έχετε ήδη τοπικά:

chmod +x install-docker.sh
./install-docker.sh

Τι κάνει, βήμα προς βήμα

  1. Καθαρίζει την οθόνη και εμφανίζει banner.
  2. Ρυθμίζει sudo — χρησιμοποιεί root αν είστε ήδη root, διαφορετικά απαιτεί sudo.
  3. Εντοπίζει την οικογένεια OS μέσω του /etc/os-release και επιλέγει τον κατάλληλο package manager.
  4. Ελέγχει αν είναι εγκατεστημένο το Docker — επαληθεύει binary, daemon, και το Compose plugin.
  5. Αν όλα είναι εντάξει → τερματίζει με πράσινο μήνυμα επιτυχίας. Δεν εγκαθιστά τίποτα.
  6. Αν λείπει μόνο το Compose → εγκαθιστά μόνο το Compose plugin.
  7. Αν λείπει το Docker → προσθέτει το επίσημο αποθετήριο Docker για τη διανομή σας, εγκαθιστά docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, docker-compose-plugin, ενεργοποιεί και ξεκινά την υπηρεσία, τρέχει το hello-world ως τελικό έλεγχο, και προσθέτει τον χρήστη στην ομάδα docker.

Κωδικοί εξόδου

  • 0 — επιτυχία (είτε ήταν ήδη εγκατεστημένο, είτε εγκαταστάθηκε τώρα).
  • Οτιδήποτε άλλο — κάποιο βήμα απέτυχε· ένα κόκκινο [FAIL] μήνυμα εξηγεί τι.

Αντιμετώπιση προβλημάτων

  • "permission denied" μετά την εγκατάσταση — κάντε logout/login ώστε να εφαρμοστεί η νέα συμμετοχή στην ομάδα docker, ή τρέξτε newgrp docker.
  • Πίσω από proxy — ορίστε HTTP_PROXY/HTTPS_PROXY πριν τρέξετε το script.
  • Παλιό Docker από το αποθετήριο της διανομής — απεγκαταστήστε πρώτα το docker.io / podman-docker με τον package manager σας, και μετά ξανατρέξτε αυτό το script για να πάρετε το επίσημο Docker CE.

License

MIT — use, modify, and redistribute freely.