Enable HTTP2 in Apache on Ubuntu 16.04

Hi there,

I’ve recently created a new droplet with Ubuntu 16.04 and was pleased to see that sudo apt-get install apache2 gets me Apache 2.4.18. I was hoping that would allow me to enable HTTP2 support; alas, the respective mod_http2 is not included. Is there any way to manually install the module or to get a version of Apache that has it included?

Many thanks, Florian

Show comments

Submit an answer
Answer a question...

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!

Sign In or Sign Up to Answer

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.

Accepted Answer

Another option is using Ondrej’s Launchpad PPA. For example: (replacing REPOSITORY with string from that page for your Ubuntu version).

sudo add-apt-repository 'REPOSITORY'
sudo apt-get update
sudo apt-get dist-upgrade

This will give you the latest Apache rather than the version specifically for Ubuntu. Of course there are reasons Ubuntu ships slightly differently - stability, known degree of security/performance testing etc. but in my mind it is a worthwhile tradeof especially for HTTP/2

It was working fine for me but when I updated it recently it rolled back to HTTP 1.1, so I am looking out for answers who knows how to resolve this.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Please try if you know what you are doing. Neither Ubuntu nor other UNIX platforms support out of the box HTTP2 protocols. It is not recommended to run HTTP2 with these configurations on the production server unless you want to play along with it.