﻿# Valkey

> [HTML Version](valkey.html)

Valkey is a high-performance NoSQL database management system designed based on Redis for modern cloud and distributed systems.

This article describes how to install Valkey 8.1.1 on Ubuntu Linux 22.04 and 24.04. You can obtain Valkey installation files for your OS from:

- [The official Valkey repository](https://github.com/valkey-io/valkey/releases).

- [The Repology service website](https://repology.org/project/valkey/versions).

It is recommended to install Valkey in the same Kubernetes environment as the BRIX application. For more details on infrastructure organization options, refer to [Prepare BRIX On-Premises infrastructure](infrastructure-preparation.md).

Additional information about Valkey can also be found in the following sources:

- [System requirements for BRIX On-Premises](elma365-enterprise-on-premises.md#valkey). This article describes supported Valkey versions for correct system operation.

- [Migrate from Redis to Valkey](redis-to-valkey.md). This article describes how to replace Redis with Valkey.

- [Official Valkey documentation](https://valkey.io/topics/quickstart/). It tells more about working with DBMS.

Valkey deployment steps:

	1. [Valkey installation](#install-valkey).

	2. [Valkey configuration](#configure-valkey).

	3. [Connection to Valkey](#valkey-connection).

## Step 1: Valkey installation

1. Install the packages:

````
sudo apt install -y apt-transport-https ca-certificates curl

2. ````
Import the keys:

````
sudo curl -fsSL https://repo.brix365.com/deb/brix365-keyring.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/brix365-keyring.gpg

3. ````
Add the repository:

````
echo "deb \[arch=amd64\] https://repo.brix365.com/deb \$(lsb\_release -cs) stable" | sudo tee /etc/apt/sources.list.d/brix365.list  
sudo apt update

4. ````
Install Valkey:

````
sudo apt install brix365-valkey-server

## ````
Step 2: Valkey configuration

````
начало примечание

````
**Note**

The password can contain the following characters:

- Uppercase Latin letters: A to Z

- Lowercase Latin letters: a to z

- Digits: 0 to 9

- Symbols: -\_

Reserved (invalid) characters:

\! \* ' ( ) ; : @ \& = + \$ , / ? % # \[ \]

````
конец примечание

````
Configure the database management system installed:

1. Enable connection to the Valkey server. To do it, edit the \[OBJECT\] configuration file by adding the IP address of the server, e. g. 192.168.10.10:

````
sudo nano /etc/valkey/valkey.conf  
bind 127.0.0.1 ::1 192.168.10.10

````
 **Enable TLS/SSL in Valkey**

  
To enable TLS/SSL in Valkey, in the \[OBJECT\]** **configuration file:

1. Disable unprotected connections by setting the \[OBJECT\] parameter** **to \[OBJECT\]. 

2. Set the port for TLS connections and uncomment the \[OBJECT\] parameter.

3. In the \[OBJECT\] parameter, specify the path to the server certificate file.

4. In the \[OBJECT\] parameter, specify the path to the private key file.

5. In the \[OBJECT\] parameter, specify the path to the root CA file.

````
port 0  
tls-port 6379  
tls-cert-file /path/Valkey.crt  
tls-key-file /path/Valkey.key  
tls-ca-cert-file /path/to/ca.crt

````
  
Learn more about TLS/SSL in Valkey in the [official Valkey documentation](https://valkey.io/topics/encryption/).

2.  Increase the maximum number of clients by setting the \[OBJECT\] parameter to** **\[OBJECT\]. Uncomment the line by removing the \[OBJECT\] sign:

````
maxclients 20000

3. ````
Set the key eviction policy by setting the \[OBJECT\] parameter to \[OBJECT\]. Uncomment the line by removing the \[OBJECT\] sign:

````
maxmemory-policy allkeys-lfu

4. ````
Disable creation of **snapshots** by setting the \[OBJECT\] parameter to null. Uncomment the line by removing the \[OBJECT\] sign:

````
save ""

5. ````
Disable the **AOF** (**Append Only File)** to prevent saving of Valkey data in a file. To do it, set the \[OBJECT\] parameter to \[OBJECT\]. Uncomment the line by removing the \[OBJECT\] sign:

````
appendonly no

6. ````
Optional. Add a password to access Valkey using allowed characters:

````
requirepass SecretPassword

7. ````
Disable the protected mode if the \[OBJECT\] parameter is used or the \[OBJECT\] **option **is not set:

````
protected-mode no

8. ````
Restart Valkey:

````
sudo systemctl restart valkey-server

## ````
Step 3: Connection to Valkey 

Connection string for Valkey:

````
redis://<valkey-server-address>:6379/0

````
Connection string for Valkey if access by password is enabled:

````
redis://:SecretPass@<valkey-server-address>:6379/0

````
Connection string for Valkey with TLS/SSL:

````
rediss://<valkey-server-address>:6379/0

````
Connection string for Valkey with TLS/SSL if access by password is enabled:

````
rediss://:SecretPass@<valkey-server-address>:6379/0
````