1.6 KiB
1.6 KiB
Setting Up and Configuring Redis Server
1. Install Redis Server
Update your package list and install Redis server:
apt update && apt install redis-server -y
2. Update Redis Configuration
Edit the Redis configuration file:
vim /etc/redis/redis.conf
Change Supervision Service to Systemd
Locate the supervised directive and change its value to systemd:
supervised systemd
Restart the Redis Service
Restart the Redis service to apply changes:
systemctl restart redis
3. Test Redis Server
Use the Redis CLI to test the server:
redis-cli
Run the following commands:
- Test connectivity:
Expected output:
pingPONG - Test basic operations:
Expected output:
set test "This is test" get test"This is test"
4. Configure Binding
Edit the Redis configuration file:
vim /etc/redis/redis.conf
Change Binding Address
Update the bind directive to allow external connections. For example:
bind 0.0.0.0
Note: Replace
0.0.0.0with the specific IP addresses you want to allow, if necessary.
5. Set a Password
Secure your Redis server by setting a password:
vim /etc/redis/redis.conf
Find the requirepass directive and set your desired password:
requirepass <password>
Test Authentication
To test the password configuration:
redis-cli
auth <password>
Run the ping command again:
ping
Expected output:
PONG
Now your Redis server is installed, configured, and secured!