{"id":2610,"date":"2024-12-01T17:58:57","date_gmt":"2025-09-17T11:22:06","guid":{"rendered":""},"modified":"2025-02-02T00:46:18","modified_gmt":"2025-02-01T23:46:18","slug":"how-to-compile-brotli-from-source-on-ubuntu-18-04-lts","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-compile-brotli-from-source-on-ubuntu-18-04-lts\/","title":{"rendered":"How to Compile Brotli from Source on Ubuntu 18.04 LTS"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<h1>\u00a0<\/h1>\n<p>Brotli is a modern compression algorithm that provides superior compression rates compared to other popular algorithms like Gzip. It is commonly used to compress web assets, improving site performance. In this guide, we will show you how to compile Brotli from source on Ubuntu 18.04 LTS. Whether you&#8217;re using a  or another hosting provider, compiling Brotli from source allows you to leverage the latest updates and optimize your server&#8217;s performance.<\/p>\n<h2>Prerequisites<\/h2>\n<p>Before you begin, ensure you have the following:<\/p>\n<ul>\n<li>An Ubuntu 18.04 LTS server, which can be hosted on a <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">UK Windows VPS<\/a>, <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Windows VPSVirtual Private Servers<\/a>, or another <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Windows VPS Hosting UK<\/a> solution.<\/li>\n<li>Root or sudo privileges on your server.<\/li>\n<li>Basic knowledge of the command line.<\/li>\n<\/ul>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before installing any packages, ensure that your system is up to date by running the following commands:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<h2>Step 2: Install Dependencies<\/h2>\n<p>Brotli requires several build tools and libraries to compile from source. Install the necessary dependencies by running:<\/p>\n<pre><code>sudo apt install build-essential cmake git python3 -y<\/code><\/pre>\n<h2>Step 3: Clone the Brotli Repository<\/h2>\n<p>Clone the official Brotli repository from GitHub to your local system:<\/p>\n<pre><code>git clone https:\/\/github.com\/google\/brotli.git<\/code><\/pre>\n<p>Navigate to the Brotli directory:<\/p>\n<pre><code>cd brotli<\/code><\/pre>\n<h2>Step 4: Build Brotli from Source<\/h2>\n<p>Run the following commands to compile Brotli:<\/p>\n<pre><code>mkdir out\r\ncd out\r\ncmake ..\r\nmake<\/code><\/pre>\n<p>Once the build process is complete, install Brotli to your system:<\/p>\n<pre><code>sudo make install<\/code><\/pre>\n<h2>Step 5: Verify Brotli Installation<\/h2>\n<p>After Brotli is successfully installed, you can verify the installation by running the following command:<\/p>\n<pre><code>brotli --version<\/code><\/pre>\n<p>This should return the installed version of Brotli, confirming that it was compiled and installed successfully.<\/p>\n<h2>Step 6: Using Brotli for Compression<\/h2>\n<p>Now that Brotli is installed, you can use it to compress files. For example, to compress a file named <code>example.txt<\/code>, run:<\/p>\n<pre><code>brotli example.txt<\/code><\/pre>\n<p>This will create a compressed file named <code>example.txt.br<\/code>.<\/p>\n<h2>Step 7: Configure Nginx to Use Brotli (Optional)<\/h2>\n<p>If you&#8217;re using Nginx as your web server, you can enable Brotli compression for web assets. First, install the Nginx Brotli module:<\/p>\n<pre><code>sudo apt install nginx-extras -y<\/code><\/pre>\n<p>Next, edit the Nginx configuration file to enable Brotli compression:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/nginx.conf<\/code><\/pre>\n<p>Add the following lines inside the <code>http<\/code> block:<\/p>\n<pre><code>brotli on;\r\nbrotli_comp_level 6;\r\nbrotli_types text\/plain text\/css application\/json application\/javascript text\/xml application\/xml application\/xml+rss text\/javascript;<\/code><\/pre>\n<p>Save and close the file, then restart Nginx to apply the changes:<\/p>\n<pre><code>sudo systemctl restart nginx<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>By following these steps, you have successfully compiled Brotli from source on Ubuntu 18.04 LTS. Brotli provides an efficient compression algorithm that helps reduce file sizes and improve the performance of websites. Whether you are using a , <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Microsoft SQL VPS Windows<\/a>, or another <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Windows VPSVirtual Private Server Hosting<\/a> solution, Brotli can significantly enhance your server&#8217;s efficiency in serving compressed web content.<\/p>\n<footer>\n<p>For more VPS hosting options, visit . They offer a variety of <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Windows VPSVirtual Private Servers<\/a> and <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Windows VPS Hosting UK<\/a> solutions tailored to your needs.<\/p>\n<\/footer>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Brotli is a modern compression algorithm that provides superior compression rates compared to other popular algorithms like Gzip. It is commonly used to compress web assets,\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2610"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2610\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}