Skip to content

Use Nginx Stream Module in Debian 12

In Debian 12, the Nginx stream module is not installed by default, if we configure /etc/nginx/nginx.conf to use stream, nginx -t will give error:

Bash
root@exia:~# nginx -t
2025/01/19 10:21:35 [emerg] 28999#28999: unknown directive "stream" in /etc/nginx/nginx.conf:12
nginx: configuration file /etc/nginx/nginx.conf test failed

To enable Nginx stream module, we need to install the stream package in Debian 12 like the following:

Bash
apt install libnginx-mod-stream

After the installation, rerun nginx -t, we'll see it works.

Bash
root@exia:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful