This is needed for installing latest apache (that will have HTTP2 module included in the compiled binary). Remember that this is a trade off – Ubuntu doesn’t ship this by default and there is a reason for this – when it’s battle tested and passed all the required testing it will be included. But this is a good trade off if you need HTTP2 today.

What is left is to active the HTTP2 module:

sudo a2enmod http2

Update your apache config by specifying protocols to be used:

Protocols h2 h2c http/1.1

Restart Apache and test that HTTP2 protocol is working at: http2-test.