Enable HTTP2 in Apache on Ubuntu 16.04

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?

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

Thank you very much, that is a great solution. Ondrej's repository works like a charm. I agree with you that it's worth to make the tradeoff in terms of stability if you consider the vast improvements of HTTP2.

Don't forget that after installing the new version of Apache, you need to activate the module manually:

I'm not sure if Ubuntu decided to include HTTP/2 support in 16.04's Apache packages because HTTP/2 support is still considered experimental in Apache.

Instead, you might try using ServerPilot which enables HTTP/2 in Nginx and configures your server with Nginx as a reverse proxy in front of Apache so that you can still use Apache just like normal with .htaccess files and such. Your code never knows that Nginx is there and you get the benefits of Nginx's scalability, handling slow clients, and HTTP/2 support.

Now, I am having a different problem. Wordpress - Permalinks issues. I am not able to customise the page (permalinks). I know this is not relevant in this article but just thought of seeking your help.

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.