Deployment Overview of Redis on Server¶
Prerequisites and Basic Requirements¶
The following requirements must be met before deploying Redis on the server:
-
Operating System: Ubuntu
-
Privileges: Root or sudo access to install packages and modify system configuration.
-
Network: The server must have network connectivity to allow package installation.
-
Ports: Port
6379is reserved for Redis client connections.
Application installation process¶
Redis is installed and configured as a native system service using the standard Ubuntu package repository. The installation process involves the following steps:
-
The
redis-serverpackage is installed using theaptpackage manager. -
The configuration file located at
/etc/redis/redis.confis automatically updated with specific parameters during the deployment. -
The Redis service is enabled to start on boot and is started immediately after configuration.
The installed version corresponds to the latest stable release available in the Ubuntu package repository at the time of installation.
File and Directory Structure¶
The Redis installation adheres to the following directory structure for configuration and data:
-
Configuration file:
/etc/redis/redis.conf -
Data directory: Default location managed by the
redis-serverservice (typically/var/lib/redis). -
Log files: Managed by the system logger (syslog) or defined in
/etc/redis/redis.conf.
Databases¶
Redis operates as an in-memory key-value store. The connection and storage settings are configured as follows:
-
Connection Method: Localhost connection via TCP.
-
Binding Address:
127.0.0.1(Localhost only). -
Port:
6379. -
Authentication: Password authentication is enabled. The password is configured via the
requirepassdirective in the configuration file. -
Supervised Mode: The service runs under
systemdsupervision for process management and logging.
Available ports for connection¶
The following port is available for external or internal client connections:
- Port
6379: Used for standard Redis communication. Note that this port is bound only to127.0.0.1by default, restricting access to local connections unless the binding address is explicitly changed in the configuration.
Starting, Stopping, and Updating¶
The Redis service is managed using systemd. The following commands are used to control the service lifecycle:
-
Start the service:
-
Stop the service:
-
Restart the service (applies after configuration changes):
-
Check service status:
-
Enable auto-start on boot:
Location of configuration files and data¶
-
Main Configuration:
/etc/redis/redis.conf -
Data Storage:
/var/lib/redis(Default RDB and AOF file locations) -
Service Unit File:
/lib/systemd/system/redis-server.service
The configuration file /etc/redis/redis.conf contains the following critical parameters: | Parameter | Value | Description | |-----------|-------|-------------| | bind | 127.0.0.1 | IP address to bind the Redis server to. | | port | 6379 | TCP port for client connections. | | supervised | systemd | Process supervision mode. | | requirepass | [Set via variable] | Password required for AUTH command. |
Access Rights and Security¶
Security is enforced through the following mechanisms:
-
Network Isolation: Redis is bound to
127.0.0.1, preventing direct external network access. -
Authentication: A password is required to issue commands to the Redis instance. This is enforced via the
requirepassdirective in/etc/redis/redis.conf. -
Service User: The service typically runs under the
redissystem user with restricted permissions. -
Firewall: No external firewall rules are explicitly defined in the deployment, as the binding to localhost provides inherent network isolation.