<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Web Hosting Community Forum for Webmasters - Linux]]></title>
		<link>https://forums.hostperl.com/</link>
		<description><![CDATA[Web Hosting Community Forum for Webmasters - https://forums.hostperl.com]]></description>
		<pubDate>Sun, 24 May 2026 23:05:52 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[How To Install And Configure Redis on Ubuntu 22.04]]></title>
			<link>https://forums.hostperl.com/showthread.php?tid=577</link>
			<pubDate>Sat, 06 May 2023 06:57:48 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forums.hostperl.com/member.php?action=profile&uid=1">hostperl</a>]]></dc:creator>
			<guid isPermaLink="false">https://forums.hostperl.com/showthread.php?tid=577</guid>
			<description><![CDATA[In this article, we have covered steps to install and configure Redis-cli 6.0.16. We will install Redis on Ubuntu 22.04.<br />
<a href="http://redis.io" target="_blank" rel="noopener" class="mycode_url">Redis</a> is used as a database, cache and message broker, in-memory open source (BSD licensed), data structure store. It assists data structures such as strings, lists, sets, hashes, sorted sets with range bitmaps, queries, geospatial indexes and hyperloglogs with radius questions and streams.<br />
Redis was designed for use by trusted clients in a trusted environment, and has no robust security features of its own. Redis does, however, have a few security features like a basic unencrypted password as well as command renaming and disabling.<br />
Below we are about to see steps required for installation and configuration of Redis.<br />
Prerequisites<ul class="mycode_list"><li>A Ubuntu 22.04 installed <a href="https://hostperl.com/managed-dedicated-server.html" target="_blank" rel="noopener" class="mycode_url">dedicated server</a> or KVM VPS.<br />
 <br />
</li>
<li>A root user access or normal user with sudo privileges.<br />
 <br />
</li>
</ul>
Step 1 – Keep the server up to date<br />
apt update &amp;&amp; apt upgrade -y<br />
Step 2 – Install Redis<br />
Run following DNF package manager command to install Redis.<br />
apt install redis-server -y<br />
This is important configuration change to make in the Redis configuration file. supervised directive allows you to delivery an init system to manage Redis as a service.<br />
Edit <span style="font-weight: bold;" class="mycode_b">"redis.conf"</span> file.<br />
nano /etc/redis/redis.conf<br />
Find <span style="font-weight: bold;" class="mycode_b">supervised no</span>. Uncomment it and change the supervised value to systemd like shown below:<br />
...<br />
supervised systemd<br />
Save and exit the Redis configuration file. After editing the file, start and enable the Redis service:<br />
systemctl restart redis<br />
systemctl status redis<br />
To verify that Redis has installed successfully, we can run following command:<br />
redis-cli ping<br />
Output:<br />
PONG<br />
At this point, Redis is running on our server and we can begin configuring it to enhance its security.<br />
Step 3 – Configure Firewall<br />
If you are using UFW. Add port in the UFW<br />
ufw allow 6379/tcp<br />
Step 4 – Configure a Redit password<br />
Configuring a Redis password enables one of its built-in security features. The auth command, which requires clients to authenticate before being allowed access to the database. Like the bind setting, the password is configured directly in Redis’s configuration file, /etc/redis/redis.conf. Reopen that file:<br />
nano /etc/redis/redis.conf<br />
Find requirepass.<br />
# requirepass foobared<br />
Uncomment it by removing the #, and change foobared to a very strong password of your choosing. <br />
After setting the password, save and close the file then restart Redis:<br />
systemctl restart redis<br />
To test that the password works, open the Redis client:<br />
redis-cli<br />
A sequence of commands used to verify whether the Redis password is working is as follows. Before authenticating, the first command tries to set a key to a value:<br />
127.0.0.1:6379&gt; set key1 23<br />
That won’t work as you have not yet authenticated, so Redis returns an error:<br />
Output<br />
(error) NOAUTH Authentication required.<br />
The following command authenticates with the password specified in the Redis configuration file:<br />
127.0.0.1:6379&gt; auth your_redis_password<br />
Redis will acknowledge that you have been authenticated:<br />
Output<br />
OK<br />
After that, running the previous command again should be successful:<br />
127.0.0.1:6379&gt; set key1 23<br />
Output<br />
OK<br />
The get key1 command queries Redis for the value of the new key:<br />
127.0.0.1:6379&gt; get key1<br />
Output<br />
"23"<br />
This last command exits redis-cli. You may also use exit:<br />
127.0.0.1:6379&gt; quit<br />
Step 5 – Rename Commands<br />
Redis allows us to rename commands as a security feature. Also we can disable certain commands.<br />
To Rename commands, follow this steps:<br />
Edit Redis configuration file.<br />
nano /etc/redis/redis.conf<br />
Add following line:<br />
rename-command FLUSHDB FDB<br />
To disable commands, add follow line:<br />
rename-command FLUSHDB ""<br />
Empty string will disable that command.<br />
Save and exit the configuration file. Then apply the changes by restarting Redis:<br />
systemctl restart redis<br />
You can verify it by running the command in the <span style="font-weight: bold;" class="mycode_b">"redis-cli"</span>.<br />
<span style="font-weight: bold;" class="mycode_b">WARNING:</span> avoid using this option if possible. Instead use ACLs to remove commands from the default user, and put them only in some admin user you create for administrative purposes.<br />
<span style="font-weight: bold;" class="mycode_b">Remember:</span> The best time to rename/disable a command is, before your Redis-using application has been deployed<br />
We have seen, how to install and configure Redis on Ubuntu 22.04. Here is the recommended guide by Redis developers in the <a href="http://redis.io/topics/security" target="_blank" rel="noopener" class="mycode_url">official Redis security guide</a>.<br />
<br />
<a href="https://docs.hostperl.com/how-to-install-and-configure-redis-on-ubuntu-2204/" target="_blank" rel="noopener" class="mycode_url">https://docs.hostperl.com/how-to-install...untu-2204/</a>]]></description>
			<content:encoded><![CDATA[In this article, we have covered steps to install and configure Redis-cli 6.0.16. We will install Redis on Ubuntu 22.04.<br />
<a href="http://redis.io" target="_blank" rel="noopener" class="mycode_url">Redis</a> is used as a database, cache and message broker, in-memory open source (BSD licensed), data structure store. It assists data structures such as strings, lists, sets, hashes, sorted sets with range bitmaps, queries, geospatial indexes and hyperloglogs with radius questions and streams.<br />
Redis was designed for use by trusted clients in a trusted environment, and has no robust security features of its own. Redis does, however, have a few security features like a basic unencrypted password as well as command renaming and disabling.<br />
Below we are about to see steps required for installation and configuration of Redis.<br />
Prerequisites<ul class="mycode_list"><li>A Ubuntu 22.04 installed <a href="https://hostperl.com/managed-dedicated-server.html" target="_blank" rel="noopener" class="mycode_url">dedicated server</a> or KVM VPS.<br />
 <br />
</li>
<li>A root user access or normal user with sudo privileges.<br />
 <br />
</li>
</ul>
Step 1 – Keep the server up to date<br />
apt update &amp;&amp; apt upgrade -y<br />
Step 2 – Install Redis<br />
Run following DNF package manager command to install Redis.<br />
apt install redis-server -y<br />
This is important configuration change to make in the Redis configuration file. supervised directive allows you to delivery an init system to manage Redis as a service.<br />
Edit <span style="font-weight: bold;" class="mycode_b">"redis.conf"</span> file.<br />
nano /etc/redis/redis.conf<br />
Find <span style="font-weight: bold;" class="mycode_b">supervised no</span>. Uncomment it and change the supervised value to systemd like shown below:<br />
...<br />
supervised systemd<br />
Save and exit the Redis configuration file. After editing the file, start and enable the Redis service:<br />
systemctl restart redis<br />
systemctl status redis<br />
To verify that Redis has installed successfully, we can run following command:<br />
redis-cli ping<br />
Output:<br />
PONG<br />
At this point, Redis is running on our server and we can begin configuring it to enhance its security.<br />
Step 3 – Configure Firewall<br />
If you are using UFW. Add port in the UFW<br />
ufw allow 6379/tcp<br />
Step 4 – Configure a Redit password<br />
Configuring a Redis password enables one of its built-in security features. The auth command, which requires clients to authenticate before being allowed access to the database. Like the bind setting, the password is configured directly in Redis’s configuration file, /etc/redis/redis.conf. Reopen that file:<br />
nano /etc/redis/redis.conf<br />
Find requirepass.<br />
# requirepass foobared<br />
Uncomment it by removing the #, and change foobared to a very strong password of your choosing. <br />
After setting the password, save and close the file then restart Redis:<br />
systemctl restart redis<br />
To test that the password works, open the Redis client:<br />
redis-cli<br />
A sequence of commands used to verify whether the Redis password is working is as follows. Before authenticating, the first command tries to set a key to a value:<br />
127.0.0.1:6379&gt; set key1 23<br />
That won’t work as you have not yet authenticated, so Redis returns an error:<br />
Output<br />
(error) NOAUTH Authentication required.<br />
The following command authenticates with the password specified in the Redis configuration file:<br />
127.0.0.1:6379&gt; auth your_redis_password<br />
Redis will acknowledge that you have been authenticated:<br />
Output<br />
OK<br />
After that, running the previous command again should be successful:<br />
127.0.0.1:6379&gt; set key1 23<br />
Output<br />
OK<br />
The get key1 command queries Redis for the value of the new key:<br />
127.0.0.1:6379&gt; get key1<br />
Output<br />
"23"<br />
This last command exits redis-cli. You may also use exit:<br />
127.0.0.1:6379&gt; quit<br />
Step 5 – Rename Commands<br />
Redis allows us to rename commands as a security feature. Also we can disable certain commands.<br />
To Rename commands, follow this steps:<br />
Edit Redis configuration file.<br />
nano /etc/redis/redis.conf<br />
Add following line:<br />
rename-command FLUSHDB FDB<br />
To disable commands, add follow line:<br />
rename-command FLUSHDB ""<br />
Empty string will disable that command.<br />
Save and exit the configuration file. Then apply the changes by restarting Redis:<br />
systemctl restart redis<br />
You can verify it by running the command in the <span style="font-weight: bold;" class="mycode_b">"redis-cli"</span>.<br />
<span style="font-weight: bold;" class="mycode_b">WARNING:</span> avoid using this option if possible. Instead use ACLs to remove commands from the default user, and put them only in some admin user you create for administrative purposes.<br />
<span style="font-weight: bold;" class="mycode_b">Remember:</span> The best time to rename/disable a command is, before your Redis-using application has been deployed<br />
We have seen, how to install and configure Redis on Ubuntu 22.04. Here is the recommended guide by Redis developers in the <a href="http://redis.io/topics/security" target="_blank" rel="noopener" class="mycode_url">official Redis security guide</a>.<br />
<br />
<a href="https://docs.hostperl.com/how-to-install-and-configure-redis-on-ubuntu-2204/" target="_blank" rel="noopener" class="mycode_url">https://docs.hostperl.com/how-to-install...untu-2204/</a>]]></content:encoded>
		</item>
	</channel>
</rss>