{"id":390,"date":"2025-05-13T14:35:12","date_gmt":"2025-05-13T12:35:12","guid":{"rendered":"https:\/\/www.24x7serverguard.com\/blog\/?p=390"},"modified":"2025-05-13T14:35:12","modified_gmt":"2025-05-13T12:35:12","slug":"summary-of-the-redis-installation-process-on-debian-9-using-source","status":"publish","type":"post","link":"https:\/\/www.24x7serverguard.com\/blog\/uncategorized\/summary-of-the-redis-installation-process-on-debian-9-using-source\/","title":{"rendered":"Summary of the Redis Installation Process on Debian 9 (Using Source)"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li><strong>1. Update the OS Packages<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apt-get update<br>sudo apt-get upgrade<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install Build Dependencies<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apt-get install build-essential tcl wget curl<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Download and Extract Redis Source<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cd \/opt\/<br>wget http:\/\/download.redis.io\/redis-stable.tar.gz<br>tar -xvzf redis-stable.tar.gz<br>cd redis-stable<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Compile and Install Redis<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">make<br>sudo make install<br><br><strong>Optional: Test Build<\/strong><br>make test<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install Redis as a Service<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">cd utils\/<br>sudo .\/install_server.sh<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Accept the default values when prompted.<\/li>\n\n\n\n<li>This script creates startup scripts and sets up Redis under a specific port (usually <code>6379<\/code>).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Enable and Start Redis Service<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">sudo systemctl enable redis_6379<br>sudo systemctl start redis_6379<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Configure Redis<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Create Directories and Redis User<\/strong><br>sudo mkdir \/etc\/redis<br>sudo mkdir \/var\/www\/redis<br>sudo adduser &#8211;system &#8211;group &#8211;no-create-home redis<br>sudo chown redis:redis \/var\/www\/redis<br>sudo chmod 770 \/var\/www\/redis<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Copy and Edit the Config<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo cp \/opt\/redis-stable\/redis.conf \/etc\/redis\/<br>sudo nano \/etc\/redis\/redis.conf<br><br><strong>Recommended Config Changes<br><\/strong>port 6379<br>supervised systemd<br>logfile \/var\/log\/redis.log<br>dir \/var\/www\/redis\/<br>bind 127.0.0.1  # or your actual IP address, depending on your security needs<br>Security Tip: If Redis is bound to a public interface, ensure you secure it with a password and firewall rules.<br><br><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a Systemd Unit File<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">sudo nano \/etc\/systemd\/system\/redis.service<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Paste the following content:<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">[Unit]<br>Description=Redis In-Memory Data Store<br>After=network.target<br><br>[Service]<br>User=redis<br>Group=redis<br>ExecStart=\/usr\/local\/bin\/redis-server \/etc\/redis\/redis.conf<br>ExecStop=\/usr\/local\/bin\/redis-cli shutdown<br>Restart=always<br><br>[Install]<br>WantedBy=multi-user.target<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Reload Systemd, Start and Check Status<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo systemctl daemon-reexec<br>sudo systemctl daemon-reload<br>sudo systemctl start redis<br>sudo systemctl enable redis<br>sudo systemctl status redis<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd12 Security Notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Version 4.0.10 is outdated<\/strong> (as of now). The latest Redis version is 7.x (or later). For security, use a newer Redis version unless there&#8217;s a specific compatibility reason.<\/li>\n\n\n\n<li>Restrict network access with a firewall (<code>ufw<\/code> or <code>iptables<\/code>) or bind Redis only to localhost.<\/li>\n\n\n\n<li>Use <code>requirepass<\/code> in <code>redis.conf<\/code> for basic authentication if Redis is exposed to any network.<\/li>\n\n\n\n<li>Avoid direct exposure to the public internet unless absolutely necessary.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd04 Upgrade Suggestion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of using Redis 4.0.10, consider updating this guide to install the <strong>latest stable version<\/strong> from the <a class=\"\" href=\"https:\/\/github.com\/redis\/redis\/releases\">official Redis GitHub releases<\/a> or use Docker to simplify and isolate the setup process.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>sudo apt-get updatesudo apt-get upgrade sudo apt-get install build-essential tcl wget curl Download and Extract Redis Source cd \/opt\/wget http:\/\/download.redis.io\/redis-stable.tar.gztar -xvzf redis-stable.tar.gzcd redis-stable Compile and Install Redis makesudo make install Optional: Test Buildmake test cd utils\/sudo .\/install_server.sh Enable and Start Redis Service sudo systemctl enable redis_6379sudo systemctl start redis_6379 Create Directories and Redis Usersudo mkdir [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-390","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/comments?post=390"}],"version-history":[{"count":1,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/390\/revisions"}],"predecessor-version":[{"id":391,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/390\/revisions\/391"}],"wp:attachment":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media?parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/categories?post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/tags?post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}