DEV.co
Open-Source DevOps · khs1994-docker

lnmp

LNMP is a Docker Compose-based development environment that bundles Nginx, MySQL/MariaDB, PHP-FPM, and Redis into a single-command setup. It supports local development, testing, and CI/CD workflows across Linux, macOS, Windows, and ARM platforms.

Source: GitHub — github.com/khs1994-docker/lnmp
678
GitHub stars
131
Forks
Dockerfile
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorykhs1994-docker/lnmp
Ownerkhs1994-docker
Primary languageDockerfile
LicenseApache-2.0 — OSI-approved
Stars678
Forks131
Open issues58
Latest releasev24.11.0 (2025-08-24)
Last updated2026-07-08
Sourcehttps://github.com/khs1994-docker/lnmp

What lnmp is

Docker Compose orchestration of containerized LNMP stack (Nginx 1.29.1, MySQL 8.0.33, PHP 8.4.11-FPM, Redis 7.0.0) with optional services (PostgreSQL, MongoDB, RabbitMQ, Memcached). Configuration via `.env` file; inter-container networking via Docker DNS; shell CLI for service management and SSL certificate generation via acme.sh.

Quickstart

Get the lnmp source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/khs1994-docker/lnmp.gitcd lnmp# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Local PHP Development Environment Setup

Eliminates manual server configuration. Developers clone the repo, run `./lnmp-docker up`, and have a working LNMP stack in minutes with service auto-discovery and standard tooling (Composer, PHPUnit, Laravel CLI).

Multi-Environment Consistency (Dev → Test → Prod)

Same Docker images run locally and in CI/CD pipelines (mentions Drone integration). Reduces 'works on my machine' issues and simplifies onboarding of new team members.

Rapid Prototyping of PHP Applications

Pre-configured Laravel, generic PHP, and optional add-on services (PostgreSQL, MongoDB) reduce boilerplate. Shell commands (`lnmp-php`, `lnmp-composer`) are quick-access wrappers for container execution.

Implementation considerations

  • Requires Docker and Docker Compose v2.17.0+ pre-installed; WSL mandatory for Windows 10/11.
  • All `.env` file modification for image mirrors (especially for China: `docker.cnb.cool`, `ccr.ccs.tencentyun.com`) or custom app roots; modifying other files not recommended (see issue #238).
  • PHP application code placed in `./app/` folder; nginx config in `./config/nginx/`; requires awareness of Docker service hostnames (e.g., `mysql`, `redis`) not `localhost`.
  • SSL certificate generation via `./lnmp-docker ssl` requires ACME.sh API keys in `.env` or system environment; self-signed option available.
  • Data persistence not explicitly detailed; bind mounts or volumes for MySQL, application code, logs assumed to work but requires verification for production use.

When to avoid it — and what to weigh

  • Production Workloads Without Additional Hardening — Default credentials (MySQL root: `mytest`) and examples are development-only. No production-specific security documentation evident. Requires security review and custom configuration.
  • Windows Development (Performance-Critical PHP) — README explicitly warns: 'Run Laravel on Docker For Windows very slow' due to I/O overhead. Better on native Linux or WSL2 with optimized bind mounts.
  • Highly Customized or Legacy Stack Requirements — Fixed versions of Nginx, MySQL, PHP, Redis. No built-in support for older PHP versions or non-standard service combinations without fork/rebuild.
  • Projects Requiring Commercial Docker Support — Uses community Docker images. No guaranteed SLA or vendor support channel. Relies on open-source community and maintainer (khs1994).

License & commercial use

Licensed under Apache License 2.0 (Apache-2.0), a permissive OSI-approved license allowing commercial use, modification, and distribution with attribution and liability disclaimer.

Apache-2.0 permits commercial use of LNMP orchestration code itself. However, bundled Docker images (Nginx, MySQL, PHP, Redis, etc.) are multi-licensed under their own terms (typically permissive open-source). Review each image's license and support model before production deployment. No commercial support or indemnification from LNMP maintainer stated.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Default MySQL root password (`mytest`) hardcoded in examples—must be overridden in `.env` before any non-local use. No explicit security scanning, vulnerability disclosure, or hardening guidelines provided. Docker images sourced from Docker Hub (official or khs1994) and third-party registries—audit image provenance and use image scanning tools (Trivy, etc.). acme.sh integration for SSL/TLS is standard but requires correct API key management.

Alternatives to consider

Laravel Valet / Valet+

Lightweight, native macOS/Linux development without Docker overhead; faster file I/O. Less portable; requires host dependencies; no multi-DB/cache service bundling.

Ddev

Docker-based like LNMP but with built-in Drupal, WordPress, TYPO3 support, automated SSL, DB snapshots, and stronger production-parity focus. Steeper learning curve; different CLI model.

Docker Desktop + Compose (manual setup)

Full control over image selection, versions, and configuration. No quick-start CLI; requires manual docker-compose.yml authoring and service management.

Software development agency

Build on lnmp with DEV.co software developers

LNMP Docker cuts setup time from hours to minutes. Evaluate the documentation at docs.lnmp.khs1994.com, test locally, and confirm security requirements for your team's workflow.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

lnmp FAQ

What is the default MySQL root password?
Default is `mytest`. Must be changed in `.env` or via environment variables before production or multi-user environments.
How do I access MySQL from a PHP container?
Use hostname `mysql` (not `127.0.0.1`): `new PDO('mysql:host=mysql;dbname=test;port=3306', 'root', 'mytest')`. Docker Compose DNS resolves service names automatically.
Why is Laravel development slow on Windows?
Docker Desktop for Windows has I/O overhead with bind mounts. README recommends WSL2 with optimized mount configuration. Refer to docs/laravel.md.
Can I use this in production?
Not recommended without significant hardening: change default credentials, review image provenance, implement persistent storage and backups, add monitoring/logging, and apply security scanning. This is a dev-environment tool, not a production-ready stack.

Software developers & web developers for hire

From first prototype to production, DEV.co delivers software development services around tools like lnmp. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source devops and beyond.

Ready to Standardize Your PHP Development?

LNMP Docker cuts setup time from hours to minutes. Evaluate the documentation at docs.lnmp.khs1994.com, test locally, and confirm security requirements for your team's workflow.