https://github.com/tmiland/nginx-installer
Automatic nginx install script
https://github.com/tmiland/nginx-installer
install-script installation installation-automation installation-script installation-scripts installer installer-script modules nginx nginx-configuration nginx-module nginx-modules nginx-proxy nginx-server
Last synced: 14 days ago
JSON representation
Automatic nginx install script
- Host: GitHub
- URL: https://github.com/tmiland/nginx-installer
- Owner: tmiland
- License: mit
- Created: 2025-07-05T18:03:12.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-07-31T12:19:51.000Z (6 months ago)
- Last Synced: 2025-07-31T14:22:46.344Z (6 months ago)
- Topics: install-script, installation, installation-automation, installation-script, installation-scripts, installer, installer-script, modules, nginx, nginx-configuration, nginx-module, nginx-modules, nginx-proxy, nginx-server
- Language: Shell
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nginx-installer
Automatic nginx install script
[](https://github.com/tmiland/nginx-installer/releases) [](https://github.com/tmiland/nginx-installer/blob/main/LICENSE) 
## Usage
- Note: Use either headless or extra modules option
```bash
Usage: nginx_installer.sh [options]
If called without arguments, installs stable nginx using /opt/nginx
--help |-h display this help and exit
--nginx |-ng nginx version of choice
--stable |-s stable nginx version 1.28.0
--mainline |-m mainline nginx version 1.29.0
--headless |-h headless install
--modules-extra |-me extra modules
--dir |-d install directory
--verbose |-v increase verbosity
--nproc |-n set the number of processing units to use
--enable-debug-info |-edi enable debug info
--changelog |-cl view changelog for nginx version
--update |-upd check for script update
--uninstall |-u uninstall nginx
```
- Options / modules can be overridden, just like [nginx-autoinstall](https://github.com/angristan/nginx-autoinstall)
- (This is the same option as extra modules option.)
```bash
HEADLESS=y \
PAGESPEED=n \
BROTLI=n \
HEADERMOD=y \
GEOIP=y \
GEOIP2_ACCOUNT_ID= \
GEOIP2_LICENSE_KEY= \
FANCYINDEX=y \
CACHEPURGE=y \
SUBFILTER=y \
LUA=y \
WEBDAV=y \
VTS=y \
RTMP=y \
TESTCOOKIE=y \
REDIS2=y \
HTTPREDIS=n \
SRCACHE=y \
SETMISC=y \
NGXECHO=y \
ZSTF=y \
BADBOT=y \
./nginx_installer.sh 2>&1 | tee nginx-installer.log
```
### Installation
If root password is not set, type:
```bash
sudo passwd root
```
Log in as root
```bash
su root
```
- Latest release
```bash
curl -sSL https://github.com/tmiland/nginx-installer/releases/latest/download/nginx_installer.sh > nginx_installer.sh && \
chmod +x nginx_installer.sh && \
./nginx_installer.sh
```
- Master
```bash
curl -sSL https://github.com/tmiland/nginx-installer/raw/refs/heads/main/nginx_installer.sh > nginx_installer.sh && \
chmod +x nginx_installer.sh && \
./nginx_installer.sh
```
To install this script:
- Latest release
```bash
mkdir -p /opt/nginx-installer && \
curl -sSL https://github.com/tmiland/nginx-installer/releases/latest/download/nginx_installer.sh > /opt/nginx-installer/nginx-installer.sh && \
chmod +x /opt/nginx-installer/nginx-installer.sh && \
ln -s /opt/nginx-installer/nginx-installer.sh /usr/local/bin/nginx-installer && \
nginx-installer
```
- Master
```bash
mkdir -p /opt/nginx-installer && \
curl -sSL https://github.com/tmiland/nginx-installer/raw/refs/heads/main/nginx_installer.sh > /opt/nginx-installer/nginx-installer.sh && \
chmod +x /opt/nginx-installer/nginx-installer.sh && \
ln -s /opt/nginx-installer/nginx-installer.sh /usr/local/bin/nginx-installer && \
nginx-installer
```
## Compatibility and Requirements
- Debian 9 and later
#### Compile options With headless
```bash
nginx -V
nginx version: nginx/1.28.0
built with Nginx Installer @tmiland
built by gcc 12.2.0 (Debian 12.2.0-14+deb12u1)
built with OpenSSL 3.0.16 11 Feb 2025
TLS SNI support enabled
configure arguments: --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --user=nginx --group=nginx --with-cc-opt=-Wno-deprecated-declarations --with-cc-opt=-Wno-ignored-qualifiers --with-select_module --with-poll_module --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_v3_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-stream --with-stream_ssl_module --with-stream_realip_module --with-stream_ssl_preread_module --with-cpp_test_module --with-compat --with-pcre --with-pcre-jit
```
#### Compile options With extra modules option
```bash
nginx -V
nginx version: nginx/1.28.0
built with Nginx Installer @tmiland
built by gcc 12.2.0 (Debian 12.2.0-14+deb12u1)
built with OpenSSL 3.5.1 1 Jul 2025
TLS SNI support enabled
configure arguments: --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --user=nginx --group=nginx --with-cc-opt=-Wno-deprecated-declarations --with-cc-opt=-Wno-ignored-qualifiers --with-select_module --with-poll_module --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_v3_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-stream --with-stream_ssl_module --with-stream_realip_module --with-stream_ssl_preread_module --with-cpp_test_module --with-compat --with-pcre --with-pcre-jit --add-module=/opt/nginx/modules/headers-more-nginx-module-0.39 --with-openssl=/opt/nginx/modules/openssl-3.5.1 --add-module=/opt/nginx/modules/ngx_cache_purge --add-module=/opt/nginx/modules/ngx_http_substitutions_filter_module --add-module=/opt/nginx/modules/fancyindex --with-http_dav_module --add-module=/opt/nginx/modules/nginx-dav-ext-module --add-module=/opt/nginx/modules/nginx-module-vts --add-module=/opt/nginx/modules/nginx-rtmp-module --add-module=/opt/nginx/modules/testcookie-nginx-module --add-module=/opt/nginx/modules/redis2-nginx-module --add-module=/opt/nginx/modules/srcache-nginx-module --add-module=/opt/nginx/modules/ngx_devel_kit-0.3.4 --add-module=/opt/nginx/modules/set-misc-nginx-module --add-module=/opt/nginx/modules/echo-nginx-module-0.63
```
## Credits
- Code is mixed and customized from these sources
- [nginx-autoinstall](https://github.com/angristan/nginx-autoinstall)
#### Disclaimer
*** ***Use at own risk*** ***
### License
[](https://github.com/tmiland/nginx-installer/blob/main/LICENSE)
[MIT License](https://github.com/tmiland/nginx-installer/blob/main/LICENSE)
