WSLStack
Features Stack Quickstart FAQ
Open Source WSL2 Ubuntu Debian

Laravel dev environment.
One command.

WSLStack sets up a complete Laravel stack natively inside WSL2 — PHP 8.4, Nginx, Composer, Node.js, MySQL, and phpMyAdmin. No manual configuration.

bash <(curl -sL wslstack.sh/install)
View on GitHub Quickstart
MIT Licensed
No sudo abuse
Idempotent
Inspectable

Setting up Laravel on WSL2 is tedious

Every developer hits the same friction. WSLStack removes all of it.

PPA conflicts & broken repos

PHP PPAs, Ondřej's repo, Node setup scripts — one wrong command breaks your apt state for hours.

MySQL native install pain

Native MySQL on WSL2 requires manual socket fixes, auth plugin tweaks, and service management workarounds.

Version mismatches

Default apt PHP on Ubuntu is outdated. Node via apt is old. Composer needs manual installation every time.

Everything wired up, nothing you didn't ask for

Clean installs. Sane defaults. Reproducible results.

PHP 8.4

From Ondřej's PPA. All Laravel-required extensions: mbstring, xml, curl, zip, bcmath, gd, and more.

Composer 2.x

Installed globally via the official installer with verified checksum. Available system-wide immediately.

Node.js LTS

Via NodeSource binary. Current LTS (v22) and npm. Not the outdated version from apt.

Nginx

Laravel-ready server block. PHP-FPM connected. Clean URLs, static assets, correct permissions out of the box.

MySQL 8.4

Installed natively, properly secured, configured for Laravel. Runs on port 3306, persistent and reliable.

phpMyAdmin

Configured and accessible at localhost/phpmyadmin. Auto-connected to MySQL.

Stable, tested, and intentional

Every version chosen for WSL2 compatibility and long-term stability.

COMPONENTS
PHP8.4.x · ondrej/php PPA
Composer2.x · global install
Node.jsLTS v24 · NodeSource
Nginxstable · apt
MySQL8.4.x · native apt
phpMyAdminlatest · /phpmyadmin

Native install, no abstraction layers

Direct apt packages

All tools installed via apt or official scripts. No wrappers. Your WSL2 distro owns everything.

Standard service management

Nginx and MySQL run as Linux services. Start, stop, and restart with familiar systemctl commands.

Standard Laravel .env

DB_HOST=127.0.0.1 and DB_PORT=3306. No special overrides needed.

Repeatable across machines

Run on a fresh Ubuntu or Debian distro and get the exact same environment every time.

From zero to Laravel in minutes

Prerequisites: WSL2 with Debian or Ubuntu installed and running.

01

Install WSL2

Enable WSL2 in Windows and install Ubuntu or Debian from the Microsoft Store.

wsl --install -d Ubuntu
02

Open your terminal

Launch your Ubuntu or Debian distro from Windows Terminal or the Start menu. Make sure you have internet access.

03

Run WSLStack

One command installs and configures the entire stack.

bash <(curl -sL wslstack.sh/install)
04

Create a project

Scaffold your Laravel project with Composer.

composer create-project laravel/laravel app

Transparent by design

WSLStack is MIT licensed and fully open. Read every line before running it. The script does exactly what it says and nothing else.

MIT License — use it, fork it, modify it
No telemetry, no phone-home, no hidden installs
Idempotent — safe to run multiple times
Clean uninstall script available
Community issues and PRs welcome on GitHub
View source on GitHub
install.sh
#!/usr/bin/env bash
# WSLStack — Laravel WSL2 Installer
# MIT License · github.com/you/wslstack
set -euo pipefail
require_wsl2() {
grep -qi microsoft /proc/version \
&& echo "✓ WSL2 detected" \
|| { echo "✗ Not WSL2"; exit 1; }
}
install_php84() {
apt-add-repository ppa:ondrej/php -y
apt-get install -y php8.4 php8.4-fpm \
php8.4-mbstring php8.4-xml \
php8.4-curl php8.4-zip ...
}
# ... full source on GitHub

After install — check your stack

Run these commands to confirm everything is working.

wslstack — verify
~ $ php -v
PHP 8.4.2 (cli) (built: Jan 15 2025)
~ $ composer --version
Composer version 2.8.1
~ $ node -v && npm -v
v22.13.0
10.9.2
~ $ nginx -v
nginx version: nginx/1.24.0
~ $ mysql --version
mysql Ver 8.0.40 for Linux on x86_64
~ $ systemctl status nginx mysql
● nginx.service active (running)
● mysql.service active (running)
~ $

Common questions

Does this work on Windows 10 and Windows 11?
Yes. WSLStack works on both Windows 10 (version 2004+, build 19041+) and Windows 11. WSL2 is required. Windows 10 Home is fully supported.
Which Linux distributions are supported?
Ubuntu 22.04 and 24.04, and Debian 11 and 12. These are the most widely tested. Other Debian-based distros may work but are not officially tested.
Do I need anything installed before running WSLStack?
Just WSL2 with a supported distro (Ubuntu or Debian) and an internet connection. WSLStack handles everything else — curl, apt updates, and all package sources.
Can I use a different PHP version?
WSLStack installs PHP 8.4 by default. Since it uses Ondřej's PPA, you can install additional PHP versions (8.3, 8.2) alongside it after WSLStack runs. It does not lock you to a single version.
Is it safe to run on an existing WSL setup?
WSLStack is designed to be idempotent and non-destructive. It checks for existing installations before acting. If you have conflicting configurations, review the source first. When in doubt, use a fresh WSL distro.
How do I uninstall WSLStack?
A clean uninstall script is provided. It removes all installed packages and restores your system. Run: bash <(curl -sL wslstack.sh/uninstall)
Can I use this for production?
WSLStack is designed for local development on Windows via WSL2. It is not intended for production deployment. For production, use a proper Linux server, Laravel Forge, or a cloud provider.
v1.0.0 · Stable

Start building, not configuring

WSLStack handles the entire stack setup so you can focus on shipping your Laravel application.

bash <(curl -sL wslstack.sh/install)
View on GitHub Read the FAQ