Bootstrapper Debian/Ubuntu qui installe Ansible en premier, installe une CLI locale
stack-installer, puis lance un panneau interactif pour installer ou mettre à jour les composants choisis sur la machine locale.
curl -fsSL https://github.com/dev-toolings/stack-installer/raw/refs/heads/main/install.sh | sudo bashor with wget:
wget -qO- https://github.com/dev-toolings/stack-installer/raw/refs/heads/main/install.sh | sudo bashThe bootstrap installs Ansible first, installs the real local command /usr/local/bin/stack-installer, then launches the CLI automatically. When installed through curl ... | sudo bash, the menu is attached back to /dev/tty so it remains interactive.
The bootstrap is idempotent: it always update-or-creates /opt/stack-installer (existing install is refreshed, non-git directories are safely replaced), so rerunning it is safe.
On Ubuntu releases where the Ansible PPA is not published yet, the bootstrap uses the distribution package and removes stale ansible/ansible PPA source files that would otherwise break apt update.
install.sh is only the bootstrap layer:
- Detect Debian/Ubuntu.
- Install bootstrap dependencies.
- Install Ansible first.
- Update-or-create this project into
/opt/stack-installer. - Install the local CLI at
/usr/local/bin/stack-installer. - Launch the CLI.
stack-installer is the day-to-day command. The interactive menu shows a component tree and lets you choose groups or individual items by number instead of answering a long y/n wizard:
sudo stack-installerExample selection:
1,3 # Docker + Node.js
2.1,2.2,4.2 # PHP + Composer + Zsh syntax highlighting + autosuggest
all # everything
It runs Ansible locally with:
ansible-playbook -i localhost, -c local /opt/stack-installer/ansible/site.ymlThe interactive panel can install/update everything or only selected components:
| Component | Behavior |
|---|---|
docker |
Installs Docker CE from Docker's official apt repo |
php |
Installs PHP 8.x CLI/extensions without nginx/apache2 |
composer |
Installs/updates Composer and pulls PHP when needed |
nodejs |
Installs/updates current NodeSource LTS and bundled npm |
zsh |
Installs Zsh + Oh My Zsh and manages .zshrc |
zsh_plugins |
Installs/updates autosuggestions and syntax highlighting |
Zsh setup disables the default OMZ theme and installs a compact prompt using native Zsh prompt escapes, so completion redraws remain stable. The prompt shows:
- Current time
- Full current path
- Git segment (
[git:<branch>], in color) when inside a Git repository- Appending
*to[git:<branch>]means the repo has uncommitted/untracked changes.
- Appending
Examples:
23:12:34 * ~/Documents/lab/tools/stack-installer * [git:main] $23:12:34 ~ $- In non-git directories,
/home/kevis displayed as~.
Zsh plugins come from the official GitHub repositories:
- https://github.com/zsh-users/zsh-autosuggestions
- https://github.com/zsh-users/zsh-syntax-highlighting
The managed .zshrc enables zsh-autosuggestions automatically when the plugin is installed. zsh-syntax-highlighting is installed by zsh_plugins but not enabled by default to avoid redraw conflicts with completion-heavy sessions.
Apache2 and Nginx are never installed. If they already exist, the playbook stops/disables them unless KEEP_WEBSERVERS=1 is set.
On Ubuntu, PHP is installed from the distribution repositories to avoid release-specific PPA failures. On Debian, the Sury PHP repository is used.
By default, Node.js follows the current LTS channel dynamically through NodeSource:
https://deb.nodesource.com/setup_lts.x
That means rerunning the CLI later can move Node.js to the then-current LTS line. NODE_MAJOR is only an explicit override:
sudo NODE_MAJOR=22 stack-installer --components nodejsnpm is not upgraded with npm@latest; it remains the npm version bundled with Node.js LTS.
References:
- https://github.com/nodejs/Release
- https://nodejs.org/en/about/releases/
- https://github.com/nodesource/distributions
Interactive mode:
sudo stack-installerInstall/update everything:
sudo stack-installer --allInstall/update selected components:
sudo stack-installer --components php,nodejs,zsh,zsh_pluginsShow installed versions/status:
sudo stack-installer --statusBootstrap without launching the CLI:
curl -fsSL https://github.com/dev-toolings/stack-installer/raw/refs/heads/main/install.sh \
| sudo STACK_INSTALLER_NO_RUN=1 bash| Variable | Default | Effect |
|---|---|---|
STACK_INSTALLER_REPO |
https://github.com/dev-toolings/stack-installer.git |
Git repo cloned by the bootstrap |
STACK_INSTALLER_REF |
main |
Branch/tag cloned by the bootstrap |
STACK_INSTALLER_DIR |
/opt/stack-installer |
Local project install directory |
STACK_INSTALLER_NO_RUN |
unset | Install the CLI without launching it |
PHP_VERSION |
latest detected 8.x | Pin PHP, for example 8.3 |
NODE_MAJOR |
unset | Override dynamic LTS with a major line |
KEEP_WEBSERVERS |
unset | Do not stop/disable existing apache2/nginx |
- Ansible is installed before the component panel runs.
- The CLI is relaunchable for full updates or selective updates.
- Component tasks are idempotent.
- PHP is installed without Apache2/Nginx packages.
- Existing
~/.zshrcis backed up before replacement when it does not match the current managed schema. - Docker group changes and default-shell changes require a new login shell or SSH reconnect.
Syntax checks:
bash -n install.sh
bash -n bin/stack-installerAnsible syntax check:
ansible-playbook -i localhost, -c local ansible/site.yml --syntax-checkShellCheck, when Docker is available:
docker run --rm -v "$PWD:/mnt" koalaman/shellcheck:stable /mnt/install.sh /mnt/bin/stack-installergit pull in any other clone (for example ~/Documents/.../stack-installer) does not automatically update the active installer copy.
The CLI uses /opt/stack-installer by default (copied by install.sh as root), so keep that path updated too when testing changes.
Running curl ... | sudo bash now performs an update-or-create on /opt/stack-installer automatically.
To apply local file changes without waiting for another full bootstrap, from this repo run:
sudo STACK_INSTALLER_DIR="$PWD" stack-installer --components zsh,zsh_pluginsThen refresh your shell:
source ~/.zshrc
exec zshstack-installer --status
ansible --version
docker --version && docker compose version
php -v
composer --version
node --version && npm --version
zsh --versionMIT - © 2026 MakFly