Connect to your Key Value Store instance
Zuletzt aktualisiert am
Prerequisites
Section titled “Prerequisites”- You have a running instance of STACKIT Key Value Store. If not, you can start with Create and manage instances for Key Value Store.
- You have a user with proper permissions for the database in your instance. If not, you can create one with Create and manage credentials for Key Value Store.
Connect to your key-value store instance
Section titled “Connect to your key-value store instance”After installing, open a shell of your choice and connect to your database. The valkey-cli command supports the connection string format. You need the connection string and the endpoint of your instance to provide the necessary flags. You can look up all these parameters in the Credentials tab of your instance. You will need to extract the endpoint from the connection string.
valkey-cli -u <Connection String> --tls --sni <Endpoint> --cacert /path/to/ca.pemIf you don’t want to expose the password directly in the command line history, you should use this connection format instead:
valkey-cli -h <Endpoint> -p <Port> --user <Username> --sni <Endpoint> --askpass --tls --cacert /path/to/ca.pemThe console will show something like this:
kvd4219b0-master-1.data.eu01.onstackit.cloud:53137>Now type ping to see if you are connected successfully:
kvd4219b0-master-1.data.eu01.onstackit.cloud:53137> pingIf you are connected properly, the database will answer with:
PONGNow you can start using the database.
Press CTRL + D to close the connection and return to your command prompt.
Redis Insight is a GUI tool used to access and manage the database. Follow the instructions on the Redis Insight install page or install it from the package manager of your operating system, if available.
After installing, open Redis Insight. Copy the connection string you saved during the user creation step.
- After opening Redis Insight click on + Add Redis database.
- Paste the connection URI/URL you obtained in the Create credentials section, into the Connection URL field.
- Then click on Connection Settings and switch to the Security tab


- Click on Use SNI and leave the prefilled field as it is.
- Ensure Use TLS is enabled.
- Click on Add Redis Database to establish the connection.
Handling TLS certificates
Section titled “Handling TLS certificates”Depending on where your Key Value Store instance is hosted, you require a specific CA (Certificate Authority) certificate to establish your secure TLS connection.
Exposed services (STACKIT portal)
Section titled “Exposed services (STACKIT portal)”If you created your instance through the STACKIT Portal, the service uses public certificates issued by SwissSign.
- Public projects: Modern operating systems natively trust SwissSign. You can usually connect by using the
--tlsflag without specifying a certificate. If your system does not trust it (e.g., minimal Docker containers), you must download the SwissSign Root and Intermediate CAs from the SwissSign Repository and pass them through the--cacertflag. - Internal projects (Schwarz): Corporate devices natively trust the internal network certificates by default. No manual certificate configuration is required.
Cloud Foundry runtime
Section titled “Cloud Foundry runtime”If your database runs within the Cloud Foundry runtime, it uses a private Certificate Authority. You must extract this certificate from your service key to connect.
-
Generate or view your Cloud Foundry service key.
-
Locate the
cacrtfield in the JSON output. -
Copy the entire certificate string (including
-----BEGIN CERTIFICATE-----and-----END CERTIFICATE-----). -
Replace the
\ncharacters with actual line breaks and save the output to a file namedcf_ca.pem. -
When connecting through the CLI, append the certificate to your command:
Terminal window valkey-cli -h <Endpoint> -p <Port> --user <Username> --askpass --tls --cacert /path/to/cf_ca.pem