{"id":2347,"date":"2025-07-21T12:41:21","date_gmt":"2025-07-21T12:41:21","guid":{"rendered":"https:\/\/hostrago.com\/knowledge-base\/?p=2347"},"modified":"2025-07-21T12:41:24","modified_gmt":"2025-07-21T12:41:24","slug":"install-redis-on-cpanel-server","status":"publish","type":"post","link":"https:\/\/hostrago.com\/knowledge-base\/install-redis-on-cpanel-server\/","title":{"rendered":"How to Install Redis and PHP Redis on a cPanel Server? (Complete Guide)"},"content":{"rendered":"\n<p>When it comes to enhancing your website\u2019s performance, Redis is a name that often comes up. If you are hosting your website on a <strong>cPanel server<\/strong>, knowing how to <strong>Install Redis<\/strong> along with the PHP Redis extension can be a game changer. Redis is an in-memory data structure store widely used as a caching system, database, and message broker. This tutorial will guide you step by step to <strong>Install Redis<\/strong> and the PHP Redis module on your cPanel server.<\/p>\n\n\n\n<p>Installing Redis on a <a href=\"https:\/\/cpanel.net\/\" target=\"_blank\" rel=\"noopener\">cPanel <\/a>server is essential if you want to optimize your server&#8217;s speed and ensure faster response times for your websites, especially WordPress, Magento, or custom PHP sites. At Hostrago, we always recommend enabling Redis cache to accelerate web applications, reduce server load, and improve overall user experience. Now, let&#8217;s dive into the step-by-step installation process for Redis and the PHP Redis extension.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Redis?<\/h2>\n\n\n\n<p>Redis stands for <strong>Remote Dictionary Server<\/strong>, an open-source (BSD licensed) in-memory data store. It\u2019s often used as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <strong>cache<\/strong> to speed up web applications.<\/li>\n\n\n\n<li>A <strong>database<\/strong> supporting strings, lists, hashes, sets, and more.<\/li>\n\n\n\n<li>A <strong>message broker<\/strong> in scalable and real-time systems.<\/li>\n<\/ul>\n\n\n\n<p>By using Redis on your cPanel server, you can drastically reduce the time it takes for your application to retrieve data, making your websites significantly faster.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Install Redis on a cPanel Server?<\/h2>\n\n\n\n<p>Here are a few reasons why installing Redis on your cPanel server is beneficial:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Boost Website Speed<\/strong>: Redis can cache frequently accessed data.<\/li>\n\n\n\n<li><strong>Improve Database Performance<\/strong>: It reduces database load by serving cached queries.<\/li>\n\n\n\n<li><strong>Supports PHP Sessions<\/strong>: Storing PHP sessions in Redis is faster than file-based sessions.<\/li>\n\n\n\n<li><strong>Highly Scalable<\/strong>: Great for high-traffic sites needing faster data processing.<\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udc49 <strong>Read More<\/strong>: <a href=\"https:\/\/hostrago.com\/knowledge-base\/best-web-hosting-in-india\/\">Best Web Hosting In India &#8211; Hostrago<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites to Install Redis on cPanel<\/h2>\n\n\n\n<p>Before starting, ensure the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>SSH Access<\/strong> with root privileges to the cPanel server.<\/li>\n\n\n\n<li><strong>EasyApache 4<\/strong> installed on your cPanel server.<\/li>\n\n\n\n<li>A <strong>Stable Network Connection<\/strong> to download packages.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">To Install Redis<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Log in to your cPanel Server via SSH<\/strong><\/h3>\n\n\n\n<p>First, connect to your cPanel server using SSH as the root user.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Download the Required RPM Files for Redis<\/strong><\/h3>\n\n\n\n<p>Run the following commands to download the necessary rpm files:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm<br>wget http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-6.rpm<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Install Redis<\/strong><\/h3>\n\n\n\n<p>Once the downloads are complete, install Redis using:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm<br>yum install -y redis<br><\/code><\/pre>\n\n\n\n<p>With these commands, Redis will be installed on your cPanel server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Enable Redis to Start on Boot<\/strong><\/h3>\n\n\n\n<p>To ensure that Redis starts automatically upon server reboot, run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chkconfig redis on<br><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 5: Configure Redis<\/strong><\/h3>\n\n\n\n<p>Next, you\u2019ll need to configure Redis settings by editing the configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vi \/etc\/redis.conf<br><\/code><\/pre>\n\n\n\n<p>At the end of the file, add these lines:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>maxmemory 256mb<br>maxmemory-policy allkeys-lru<br><\/code><\/pre>\n\n\n\n<p>This configuration limits the maximum memory usage to 256MB and sets the eviction policy to <strong>allkeys-lru<\/strong>, which helps in efficiently managing cache memory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">To Install PHP Redis Extension<\/h2>\n\n\n\n<p>1. Log in to WHM with root access.<\/p>\n\n\n\n<p>2. Select the\u00a0<strong>Software <\/strong>> <strong>Module Installers<\/strong>\u00a0option from the navigation menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"500\" src=\"https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Select-the-Software-option-1024x500.webp\" loading=\"lazy\" alt=\"Select the Software option\" class=\"wp-image-2345\" srcset=\"https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Select-the-Software-option-1024x500.webp 1024w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Select-the-Software-option-300x147.webp 300w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Select-the-Software-option-768x375.webp 768w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Select-the-Software-option-1536x751.webp 1536w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Select-the-Software-option-2048x1001.webp 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>4. Click&nbsp;<strong>Manage<\/strong>&nbsp;for&nbsp;<strong>PHP Pecl<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"795\" src=\"https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Manage-for-PHP-Pecl-1024x795.webp\" loading=\"lazy\" alt=\"Manage for PHP Pecl\" class=\"wp-image-2344\" srcset=\"https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Manage-for-PHP-Pecl-1024x795.webp 1024w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Manage-for-PHP-Pecl-300x233.webp 300w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Manage-for-PHP-Pecl-768x596.webp 768w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Manage-for-PHP-Pecl-1536x1193.webp 1536w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Manage-for-PHP-Pecl.webp 1847w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>5. Type \u201c<strong>redis<\/strong>\u201d in the\u00a0<em>Search<\/em>\u00a0box and click\u00a0<strong>Go<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"433\" src=\"https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Search-box-and-click-Go-1024x433.webp\" loading=\"lazy\" alt=\"Search box and click Go\" class=\"wp-image-2343\" srcset=\"https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Search-box-and-click-Go-1024x433.webp 1024w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Search-box-and-click-Go-300x127.webp 300w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Search-box-and-click-Go-768x325.webp 768w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Search-box-and-click-Go-1536x650.webp 1536w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Search-box-and-click-Go-2048x866.webp 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>6. The search will return the appropriate PHP Redis module. Click\u00a0<strong>Install<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"186\" src=\"https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Click-Install-1024x186.webp\" loading=\"lazy\" alt=\"Click Install\" class=\"wp-image-2346\" srcset=\"https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Click-Install-1024x186.webp 1024w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Click-Install-300x55.webp 300w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Click-Install-768x140.webp 768w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Click-Install-1536x279.webp 1536w, https:\/\/hostrago.com\/knowledge-base\/wp-content\/uploads\/2025\/07\/Click-Install-2048x373.webp 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Final Step: Restart Apache and Redis Services<\/h2>\n\n\n\n<p>For all changes to take effect, restart Apache (httpd) and Redis using SSH:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service httpd restart<br>service redis restart<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Final Thoughts<\/h2>\n\n\n\n<p>By following these steps, you can easily <strong>Install Redis<\/strong> and the PHP Redis extension on your cPanel server. Redis significantly boosts website speed, enhances database query handling, and supports advanced caching mechanisms essential for dynamic sites like WordPress, Magento, and Laravel.<\/p>\n\n\n\n<p>If you need expert help or <strong>managed hosting solutions with Redis support<\/strong>, explore our services at <strong><a href=\"https:\/\/hostrago.com\/\">Hostrago Hosting Plans<\/a><\/strong>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When it comes to enhancing your website\u2019s performance, Redis is a name that often comes up. If you are hosting your website on a cPanel&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2348,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[621,121,622,623,624,620,625],"class_list":["post-2347","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","tag-cpanel-redis","tag-cpanel-tutorial","tag-install-redis","tag-php-redis-module","tag-redis-cache","tag-redis-on-cpanel","tag-whm-redis-installation"],"menu_order":0,"_links":{"self":[{"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/2347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/comments?post=2347"}],"version-history":[{"count":1,"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/2347\/revisions"}],"predecessor-version":[{"id":2349,"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/2347\/revisions\/2349"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/media\/2348"}],"wp:attachment":[{"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=2347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/categories?post=2347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostrago.com\/knowledge-base\/wp-json\/wp\/v2\/tags?post=2347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}