
{"id":26048,"date":"2025-09-18T13:04:56","date_gmt":"2025-09-18T11:04:56","guid":{"rendered":"https:\/\/contabo.com\/blog\/?p=26048"},"modified":"2026-01-16T12:46:29","modified_gmt":"2026-01-16T11:46:29","slug":"how-to-enable-http2-on-your-server","status":"publish","type":"post","link":"https:\/\/contabo.com\/blog\/how-to-enable-http2-on-your-server\/","title":{"rendered":"How to Enable HTTP\/2 on Your Server\u00a0"},"content":{"rendered":"\n<p>HTTP\/2 is the upgraded version of the Hypertext Transfer Protocol. It enables faster, more efficient communication between browsers and servers by allowing multiple files to load at once through a single connection.&nbsp;<\/p>\n\n\n\n<p>But to benefit from it, your server must be properly configured. Whether you\u2019re running <strong>Apache<\/strong> or <a href=\"https:\/\/contabo.com\/blog\/what-is-nginx\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>NGINX<\/strong><\/a>, here\u2019s how to enable HTTP\/2 step by step.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-http-2\">What Is HTTP\/2\u00a0<\/h2>\n\n\n\n<p>HTTP\/2 is a new upgrade from HTTP\/1.1. It introduces <strong>multiplexing<\/strong>, which lets browsers load several files simultaneously over a single connection. This reduces latency and makes your site feel faster and smoother.&nbsp;<\/p>\n\n\n\n<p>Keep in mind: <strong>HTTP\/2 only works over HTTPS<\/strong>, so make sure your domain already has a valid SSL certificate installed before proceeding.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-enabling-http-2-on-apache\">Enabling HTTP\/2 on Apache\u00a0<\/h2>\n\n\n\n<p>If you\u2019re running <strong>Apache version 2.4.17 or newer<\/strong>, it only takes a few steps.&nbsp;<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Activate the required modules:<\/strong>&nbsp;<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2enmod http2&nbsp;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2enmod ssl&nbsp;<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Edit your SSL configuration file:<\/strong>&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>Open the configuration file for your site, typically located in:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/apache2\/sites-available\/&nbsp;<\/code><\/pre>\n\n\n\n<p>Within the <code>&lt;VirtualHost *:443&gt;<\/code> block, add:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Protocols h2 http\/1.1&nbsp;<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Restart Apache:<\/strong>&nbsp;<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart apache2&nbsp;<\/code><\/pre>\n\n\n\n<p>Once restarted, your Apache server will start communicating over HTTP\/2.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-enabling-http-2-on-nginx\">Enabling HTTP\/2 on NGINX\u00a0<\/h2>\n\n\n\n<p>For<strong> NGINX version 1.9.5 or newer<\/strong> (compiled with OpenSSL), the setup is equally simple.&nbsp;<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Modify your SSL server block:<\/strong>&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>Locate your SSL configuration and modify the listen directive to include HTTP\/2:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>listen 443 ssl http2;&nbsp;<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Test your configuration:<\/strong>&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>Before reloading, test your configuration to avoid syntax errors:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nginx -t&nbsp;<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Reload NGINX:<\/strong>&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>If everything looks fine, reload NGINX:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx&nbsp;<\/code><\/pre>\n\n\n\n<p>Your NGINX server now supports HTTP\/2 connections.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-check-if-http-2-is-working\">How to Check If HTTP\/2 Is Working\u00a0<\/h2>\n\n\n\n<p>Once configured, verify that HTTP\/2 is active. You can:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open your browser\u2019s <strong>Network tab<\/strong> and inspect the protocol column.&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Or use this simple command:&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>curl -I &#8211;http2 https:\/\/yourdomain.com&nbsp;<\/p>\n\n\n\n<p>If the response includes <strong>HTTP\/2 200<\/strong>, congratulations &#8211; it\u2019s working perfectly.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-quick-tips-for-smooth-setup\">Quick Tips for Smooth Setup\u00a0<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Enable <\/strong><a href=\"https:\/\/contabo.com\/blog\/ultimate-guide-to-ssl\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>SSL<\/strong><\/a><strong> first:<\/strong> HTTP\/2 only functions over HTTPS.&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Use Let\u2019s Encrypt:<\/strong> It\u2019s a reliable and free SSL option.&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Test after changes:<\/strong> Always verify configurations before restarting services.&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-performance-optimization\">Performance Optimization\u00a0<\/h2>\n\n\n\n<p>To push your performance even further, consider pairing HTTP\/2 with <a href=\"https:\/\/contabo.com\/blog\/object-storage\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Contabo Object Storage<\/strong><\/a> or <a href=\"https:\/\/contabo.com\/blog\/how-to-use-litespeed-for-high-traffic-websites\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>LiteSpeed<\/strong><\/a>. Both enhance resource efficiency and improve website responsiveness under heavy load.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-watch-our-video-on-enabling-http-2\">Watch Our Video on Enabling HTTP\/2\u00a0<\/h2>\n\n\n\n<p>If you prefer a visual walk-through, you can see the exact setup process for both Apache and NGINX in action &#8211; from configuration to verification on our YouTube.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container \" style=\"height: 100%;\"><iframe loading=\"lazy\" title=\"How to enable HTTP\/2 on your server\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/h5l2RO1HEXA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-final-assessment\">Final Assessment\u00a0<\/h2>\n\n\n\n<p>Enabling HTTP\/2 is one of the simplest yet most impactful upgrades you can make for your website. With just a few configuration changes, your server becomes faster, more secure, and ready for modern web standards.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTTP\/2 is the upgraded version of the Hypertext Transfer Protocol. It enables faster, more efficient communication between browsers and servers by allowing multiple files to load at once through a single connection.&nbsp; But to benefit from it, your server must be properly configured. Whether you\u2019re running Apache or NGINX, here\u2019s how to enable HTTP\/2 step [&hellip;]<\/p>\n","protected":false},"author":77,"featured_media":26052,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[18],"tags":[],"ppma_author":[3116],"class_list":["post-26048","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"uagb_featured_image_src":{"full":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/enable-HTTP2.png",1200,630,false],"thumbnail":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/enable-HTTP2-150x150.png",150,150,true],"medium":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/enable-HTTP2-600x315.png",600,315,true],"medium_large":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/enable-HTTP2-768x403.png",768,403,true],"large":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/enable-HTTP2.png",1200,630,false],"1536x1536":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/enable-HTTP2.png",1200,630,false],"2048x2048":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/enable-HTTP2.png",1200,630,false]},"uagb_author_info":{"display_name":"Anika Kopte","author_link":"https:\/\/contabo.com\/blog\/author\/anika\/"},"uagb_comment_info":0,"uagb_excerpt":"HTTP\/2 is the upgraded version of the Hypertext Transfer Protocol. It enables faster, more efficient communication between browsers and servers by allowing multiple files to load at once through a single connection.&nbsp; But to benefit from it, your server must be properly configured. Whether you\u2019re running Apache or NGINX, here\u2019s how to enable HTTP\/2 step&hellip;","authors":[{"term_id":3116,"user_id":77,"is_guest":0,"slug":"anika","display_name":"Anika Kopte","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/1c425caa652c679ae47e3f85a48de4e19f09d37bcb5593ba88a7aa4a08bb1d81?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/26048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/comments?post=26048"}],"version-history":[{"count":3,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/26048\/revisions"}],"predecessor-version":[{"id":27396,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/26048\/revisions\/27396"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media\/26052"}],"wp:attachment":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media?parent=26048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/categories?post=26048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/tags?post=26048"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=26048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}