nginx-minimal: A Lightweight, Modular NGINX Build for Debian/Ubuntu
nginx-minimal is a purpose-built NGINX package that includes only the essentials—no bloat, no unnecessary modules, just a fast, secure, minimal web server. It’s ideal for servers where every byte matters or where you need a stripped-down base.
What is nginx-minimal?
nginx-minimal is an alternative NGINX package that:
• Includes only core modules (HTTP, rewrite, gzip, SSL)
• Excludes rarely-used modules (mail, stream, image filter)
• Uses modern compiler flags for optimization
• Provides a smaller binary footprint
• Maintains full compatibility with standard NGINX config
When to Use nginx-minimal
Use nginx-minimal when:
• Running on resource-constrained systems (VPS, embedded)
• Building Docker images (smaller layers)
• Deploying in Kubernetes (faster startup)
• Performance is critical (every bit counts)
• You control modules explicitly
Don’t use nginx-minimal if:
• You need mail module (for mail proxying)
• You need stream module (for TCP/UDP load balancing)
• You need image filter or other specialized modules
• You prefer pre-built binaries with everything included
Included Modules
nginx-minimal includes:
**Core Modules:**
• ngx_http_core_module — HTTP request handling
• ngx_http_rewrite_module — URL rewriting
• ngx_http_gzip_module — Response compression
• ngx_http_ssl_module — HTTPS/TLS support
• ngx_http_v2_module — HTTP/2 support
• ngx_http_proxy_module — Proxying to backend
• ngx_http_upstream_module — Load balancing
**Optional (compiled in):**
• ngx_http_auth_basic_module — Basic authentication
• ngx_http_charset_module — Character encoding
• ngx_http_access_module — IP-based access control
• ngx_http_stub_status_module — Status endpoint
• ngx_http_geo_module — Geographic routing
**Explicitly Excluded:**
• ngx_mail_module — Mail protocol support
• ngx_stream_module — TCP/UDP load balancing
• ngx_image_filter_module — Image optimization
• ngx_xslt_module — XSLT transformation
Installation
Install from myguard repository:
Reading package lists…
Verify installation:
Compare binary sizes:
Docker Usage
nginx-minimal is ideal for Docker:
Docker image size comparison:
• nginx official: ~150MB
• nginx-minimal Debian base: ~70MB
• nginx-minimal Alpine base: ~30MB
Basic Configuration
nginx-minimal uses standard NGINX syntax:
For HTTPS, add SSL:
Performance Benefits
nginx-minimal provides measurable benefits over full NGINX:
**Memory Usage:**
• Baseline: ~10MB (minimal) vs. ~15MB (full)
• Per worker: ~2MB (minimal) vs. ~4MB (full)
**Startup Time:**
• nginx-minimal: ~50ms
• nginx-full: ~80ms
**Binary Size:**
• nginx-minimal: ~500KB
• nginx-full: ~800KB
In resource-constrained environments, this adds up.
Module Availability
If you need a module not in nginx-minimal, you have options:
**Option 1: Use nginx-full**
**Option 2: Compile NGINX from source**
**Option 3: Use Angie**
Angie includes more modules by default and is optimized for modern use cases:
Use Cases
**Web Application Gateway**
**Static File Server**
**Reverse Proxy with Caching**
Monitoring
Monitor nginx-minimal status:
Output:
Troubleshooting
Module Not Available
If you need a module not in nginx-minimal:
If missing, either upgrade to nginx-full or compile from source.
Compatibility
nginx-minimal is fully compatible with:
• Standard NGINX configs
• NGINX documentation
• Third-party modules (if you compile them)
• Load balancers and reverse proxies
The difference is only in included modules, not in behavior.
Security
nginx-minimal has the same security features as nginx-full:
• TLS 1.2/1.3 support
• Modern ciphers
• Security headers
• Access controls
Configuration is identical:
When to Switch Away from nginx-minimal
Switch to nginx-full if you need:
• Mail proxying (pop3, smtp, imap)
• TCP/UDP load balancing (stream module)
• Image filtering
• XSLT transformation
• Specialized modules
Or consider Angie for modern features with included modules.
Comparison
| Feature | nginx-minimal | nginx-full | Angie |
|———|————–|———–|——-|
| HTTP/2 | ✓ | ✓ | ✓ |
| TLS 1.3 | ✓ | ✓ | ✓ |
| Modules | Core only | 30+ | 40+ |
| Mail | ✗ | ✓ | ✓ |
| Stream | ✗ | ✓ | ✓ |
| Binary size | ~500KB | ~800KB | ~600KB |
| Memory | Low | Medium | Low |
Conclusion
nginx-minimal provides a lean, fast NGINX build for situations where you need HTTP load balancing and proxying without extra bloat. It’s perfect for Docker, resource-constrained servers, and performance-critical deployments.
For most users, nginx-minimal is worth evaluating.