wsl debian install/uninstall routine for a lamp stack with node, and wp cli
  • PowerShell 68.9%
  • Shell 29.1%
  • Batchfile 2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-13 06:12:23 -04:00
provision Initial lamps installer 2026-10-13 06:12:23 -04:00
.gitattributes Initial lamps installer 2026-10-13 06:12:23 -04:00
.gitignore Initial lamps installer 2026-10-13 06:12:23 -04:00
install.cmd Initial lamps installer 2026-10-13 06:12:23 -04:00
install.ps1 Initial lamps installer 2026-10-13 06:12:23 -04:00
README.md Initial lamps installer 2026-10-13 06:12:23 -04:00
uninstall.cmd Initial lamps installer 2026-10-13 06:12:23 -04:00
uninstall.ps1 Initial lamps installer 2026-10-13 06:12:23 -04:00

lamps — one-command WSL2 Debian LAMP stack

Creates a dedicated WSL2 distro named lamps (it never touches an existing Debian distro) with:

Component Source
Apache 2 (mod_rewrite, headers, mod_php) Debian
MariaDB server/client Debian
PHP 8.3.x latest + mysql, curl, gd, mbstring, xml, zip, intl, bcmath, imagick, opcache packages.sury.org
Node.js LTS + npm NodeSource
WP-CLI (/usr/local/bin/wp) official phar

It also copies your Windows SSH keys (%USERPROFILE%\.ssh) into ~/.ssh with proper permissions (700 dir, 600 private keys, 644 for *.pub, known_hosts, config, authorized_keys).

Requirements

Windows 10 22H2 / Windows 11 with WSL enabled (wsl --install --no-distribution as admin, then reboot). WSL 2.4+ recommended (wsl --update).

Install

git clone <repo-url> lamps
cd lamps
install.cmd

Parameters (pass to install.cmd or install.ps1):

Param Default Purpose
-DistroName lamps WSL distro name
-InstallDir %LOCALAPPDATA%\lamps Where the virtual disk (ext4.vhdx) lives
-LinuxUser your Windows username (lowercased) Default Linux user (passwordless sudo)
-SkipSshKeys off Don't copy SSH keys
-SkipProvision off Only create the distro

Re-running is safe: an existing lamps distro is kept and just re-provisioned. provision/setup.sh honors PHP_VER (default 8.3) and NODE_MAJOR (default lts).

Use

wsl -d lamps

Web root: /var/www/html → http://localhost/ (info.php included). MariaDB: sudo mariadb.

Uninstall

uninstall.cmd                 # asks you to type "lamps" to confirm
uninstall.cmd -Backup         # wsl --export to Documents\lamps-backup-<date>.tar first
uninstall.cmd -Backup -BackupPath D:\bk\lamps.tar -Force

Only the lamps distro is terminated/unregistered and its install folder removed. Restore a backup with wsl --import lamps %LOCALAPPDATA%\lamps <file>.tar.