Redis tutorial: Install redis on linux ubuntu 23.04

To install Redis on Ubuntu 22.04, you can follow these steps:

  1. Update system packages:

    sudo apt update
    ```
    
    
  2. Install Redis:

    sudo apt install redis-server
    ```
    
    
  3. After the installation is complete, the Redis service will start automatically. You can check the status of the Redis service using the following command:

    sudo systemctl status redis-server
    ```
    
    如果服务正在运行,你将看到类似以下内容的输出:
    

    ● redis-server.service - Advanced key-value store
    Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
    Active: active (running)…

    
    
  4. Optional: Configure Redis (as needed):

    • Enter the Redis configuration file directory:
      cd /etc/redis
      
    • Open redis.confthe file for editing:
      sudo nano redis.conf
      
    • Modify the parameters in the configuration file according to your needs. For example, you can change the IP address, port number, and other options that Redis listens on. When finished, save and close the file.
  5. Optional: Restart the Redis service (if you made configuration changes):

    sudo systemctl restart redis-server
    ```
    
    

Now, Redis has been successfully installed on Ubuntu 22.04. You can use Redis's command line interface (redis-cli) or a programming language library that interacts with Redis for operation and management.
Insert image description here

Guess you like

Origin blog.csdn.net/a772304419/article/details/133499959