Report this

What is the reason for this report?

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

Posted on May 1, 2019

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



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

@techiebraj

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 https://github.com/google/brotli.git
cd brotli
sudo cp ~/brotli/docs/brotli.1 /usr/share/man/man1 && sudo gzip /usr/share/man/man1/brotli.1
./bootstrap
./configure
make
sudo make install
sudo ldconfig

After that check version with this command brotli --version

Hope this helps

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.