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

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.

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.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel