How to install and enable brotli compression on LEMP on ubuntu 18.04

Posted May 1, 2019 6.6k views
NginxLEMPUbuntu 18.04

Hello fellows,

I need some help. I have enabled gzip compression but I also want to enable brotli compression on my server. I followed many articles available on google but none of them helped me to install and enable brotli.

I also don’t trust another source. I followed all the articled by the digital ocean to install my LEMP stack and WordPress. But I think there is no tutorial available for brotli. I also checked official doc of Nginx but there is not enough information. I followed their doc to install brotli but that did not work for me.

Please if anyone here can tell me the best and clean method to enable brotli. I will appreciate that.

Thanks & Regards,
Brajmohan Kumar

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


To install brotli you need to execute these commands:

sudo apt update
sudo apt install -y build-essential gcc make bc sed autoconf automake libtool git apt-transport-https tree
git clone
cd brotli
sudo cp ~/brotli/docs/brotli.1 /usr/share/man/man1 && sudo gzip /usr/share/man/man1/brotli.1
sudo make install
sudo ldconfig

After that check version with this command brotli --version

Hope this helps