Skip to content

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 6379 is 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:

  1. The redis-server package is installed using the apt package manager.

  2. The configuration file located at /etc/redis/redis.conf is automatically updated with specific parameters during the deployment.

  3. 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-server service (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 requirepass directive in the configuration file.

  • Supervised Mode: The service runs under systemd supervision 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 to 127.0.0.1 by 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:

    systemctl start redis-server
    

  • Stop the service:

    systemctl stop redis-server
    

  • Restart the service (applies after configuration changes):

    systemctl restart redis-server
    

  • Check service status:

    systemctl status redis-server
    

  • Enable auto-start on boot:

    systemctl enable redis-server
    

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 requirepass directive in /etc/redis/redis.conf.

  • Service User: The service typically runs under the redis system user with restricted permissions.

  • Firewall: No external firewall rules are explicitly defined in the deployment, as the binding to localhost provides inherent network isolation.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×