One-Command WNMP Stack: Quickly Deploy Nginx, PHP, and MariaDB on Linux & WSL
The WNMP one‑click package installs Nginx, PHP, and MariaDB with built‑in Mroonga, automatically optimizes kernel and network settings, configures WebDAV and SSL certificates, and provides a lightweight, reproducible web environment for small‑to‑medium sites on Debian‑based Linux or Windows 11 WSL.
Overview
WNMP is a one‑click bundle that installs Nginx 1.28.0, PHP 8.2‑8.5, and MariaDB 10.6/10.11 (with the Mroonga full‑text search engine). It automatically applies kernel and network optimizations (enables BBR and FQ, adjusts net.core.somaxconn, raises file‑handle limits, disables Transparent Huge Pages, writes appropriate /etc/sysctl.conf and /etc/security/limits.conf entries) and configures WebDAV and TLS certificates. Certificate automation uses acme.sh, prefers Cloudflare DNS‑01 and falls back to webroot verification, then reloads Nginx to apply the new certificate.
The stack targets Debian‑derived Linux distributions (Debian 13/12, Ubuntu 22.04/24.04/25.10) and Windows 11 WSL. Minimum hardware is 1 GB RAM (required for MariaDB). All components are installed under a unified directory layout for easy maintenance.
Installation
apt install -y curl
curl -fL https://wnmp.org/zh/wnmp.sh -o wnmp.sh
chmod +x wnmp.sh
bash wnmp.shRun the script as root on a clean system. The script will install Nginx, optional PHP, and MariaDB, then apply the tuning and certificate steps.
Core components and directory layout
Nginx 1.28.0 with dav_ext, http2, and stream modules.
PHP 8.2‑8.5, compiled with common extensions; default extensions include swoole, apcu, inotify, and redis.
MariaDB 10.6 or 10.11, built‑in Mroonga engine for full‑text search.
Directory structure : /usr/local/nginx – Nginx binaries and configuration. /usr/local/php – PHP binaries and configuration. /home/wwwroot – Web root for virtual hosts; each domain gets its own subdirectory and SSL subdirectory.
Key features
One‑click ready web runtime : installs the full LEMP stack with sensible defaults.
Kernel and network tuning : enables BBR/FQ, sets somaxconn, raises open‑file limits, disables THP, and writes sysctl/limits files; adapts to WSL security constraints.
Certificate automation : integrates acme.sh, prefers Cloudflare DNS‑01, falls back to webroot, and reloads Nginx automatically.
Multi‑site and WebDAV support : one‑click virtual‑host creation, built‑in phpMyAdmin protection, per‑domain WebDAV accounts with separate password files.
Maintainable configuration layout : unified directories ( /usr/local/nginx, /usr/local/php, /home/wwwroot) and clear default site/SSL locations.
Secure defaults : disables hidden directories and risky script extensions, applies reasonable timeout and cache settings, and disables unnecessary PHP options.
Common management commands
Normal install : bash wnmp.sh Check status : bash wnmp.sh status SSH key login setup : bash wnmp.sh sshkey Add WebDAV account : bash wnmp.sh webdav Configure default site and certificate : bash wnmp.sh default Create virtual host with certificate : bash wnmp.sh vhost Run only kernel/network tuning : bash wnmp.sh tool Restart all services : bash wnmp.sh restart Full cleanup : bash wnmp.sh remove Cleanup Nginx only : bash wnmp.sh renginx Cleanup PHP only : bash wnmp.sh rephp Cleanup MariaDB only : bash wnmp.sh remariadb WSL initialization :
bash wnmp.sh wslinitSupported platforms and default settings
Supported OS: Windows 11 (WSL), Debian 13/12, Ubuntu 22.04/24.04/25.10. The stack does not include MySQL; MariaDB is the default database. PHP version is locked to 8.2 or newer. Default PHP extensions are swoole, apcu, inotify, and redis. Minimum memory requirement is 1 GB (required for MariaDB). The solution is optimized for VPS or low‑resource environments and will continue to be maintained on active Debian branches.
For more details see https://www.wnmp.org/zh.html.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
