Docker-Install

A polished one-command Docker installer for fresh Ubuntu/Debian servers.

It installs:

  • Docker Engine
  • Docker CLI
  • containerd
  • Docker Buildx plugin
  • Docker Compose plugin

It can also optionally add a chosen Linux user to the docker group so Docker commands can be run without sudo after the user logs out/in. If requested, it can install Portainer CE as a local Docker container too.

One-command install

Install Docker only:

curl -fsSL https://gitea.wheelytho.com/Wheelz/Docker-Install/raw/branch/main/install-docker.sh | bash

Install Docker and add the current SSH/login user to the docker group:

curl -fsSL https://gitea.wheelytho.com/Wheelz/Docker-Install/raw/branch/main/install-docker.sh | bash -s -- --current-user

Install Docker and add a specific user to the docker group:

curl -fsSL https://gitea.wheelytho.com/Wheelz/Docker-Install/raw/branch/main/install-docker.sh | bash -s -- --user obin

Install Docker, add the current SSH/login user, and install Portainer CE:

curl -fsSL https://gitea.wheelytho.com/Wheelz/Docker-Install/raw/branch/main/install-docker.sh | bash -s -- --current-user --portainer

Install Docker and Portainer CE only:

curl -fsSL https://gitea.wheelytho.com/Wheelz/Docker-Install/raw/branch/main/install-docker.sh | bash -s -- --portainer

Non-interactive install without adding a docker user:

curl -fsSL https://gitea.wheelytho.com/Wheelz/Docker-Install/raw/branch/main/install-docker.sh | bash -s -- --yes

Local usage

git clone https://gitea.wheelytho.com/Wheelz/Docker-Install.git
cd Docker-Install
chmod +x install-docker.sh
./install-docker.sh --current-user

The old Docker-Install.sh filename still exists as a compatibility wrapper.

Options

--user USER        Add USER to the docker group after install.
--current-user     Add the invoking SSH/login user to the docker group.
--no-docker-user             Do not add anyone to the docker group.
--portainer                  Install or start Portainer CE after Docker install.
--portainer-port PORT        Host port for Portainer HTTPS UI. Default: 9443.
--portainer-edge-port PORT   Host port for Portainer Edge agent tunnel. Default: 8000.
--portainer-image IMAGE      Portainer image to run. Default: portainer/portainer-ce:lts.
-y, --yes                    Non-interactive defaults. Skips docker group unless --user/--current-user is supplied.
-h, --help                   Show help.

After adding a user to the docker group

Group membership does not apply to already-open shells. Log out and back in, or run:

newgrp docker

Then verify Docker works without sudo:

docker run --rm hello-world

Portainer

When --portainer is supplied, the installer creates a persistent Docker volume named portainer_data and starts Portainer CE with:

  • HTTPS UI: https://<server-ip>:9443
  • Edge agent tunnel: <server-ip>:8000
  • Container name: portainer
  • Restart policy: always

Portainer uses a self-signed certificate by default, so the browser warning is expected on first visit.

Custom Portainer UI port example:

curl -fsSL https://gitea.wheelytho.com/Wheelz/Docker-Install/raw/branch/main/install-docker.sh | bash -s -- --current-user --portainer --portainer-port 9444

Supported systems

  • Ubuntu
  • Debian

The installer uses Docker's official apt repository for the detected OS and codename.

S
Description
No description provided
Readme
87 KiB
Languages
Shell 100%