How to Install Valkey on Ubuntu 24.04
Installing Valkey on Ubuntu 24.04 uses the built-in `apt` package manager.
Valkey is a fast, in-memory database that stores data as key-value pairs. It’s a fork of the popular Redis project, meaning it continues to get new features and development.
You can use Valkey for things like making websites faster by caching data, managing user sessions, or analyzing data as it comes in. It works with data types such as simple text, lists, and sets.
This guide shows you how to get Valkey set up on your Ubuntu 24.04 computer, so you have a speedy database ready for your projects.
Install Valkey on Ubuntu 24.04 by first updating your package list with `sudo apt update`. Then, install Valkey using the command `sudo apt install valkey`. This will add Valkey to your system from the default repositories.
Install Valkey on Ubuntu
Before installing Valkey, update Ubuntu, then install Valkey. You don’t have to include additional repositories, as Valkey’s packages are included in Ubuntu’s default repositories.
sudo apt update
sudo apt install valkey
Once installed, its configuration file is located at /etc/valkey/valkey.conf.
Configure Valkey
You can configure Valkey on Ubuntu by editing its main settings file, valkey.conf, found in the /etc/valkey/ directory. This file lets you control how Valkey behaves, like restricting connections to just your own computer by changing the ‘bind’ setting. To open and edit this file, use the command: sudo nano /etc/valkey/valkey.conf.
sudo nano /etc/valkey/valkey.conf
Adjust settings based on your environment.
......
......
# listening interface
# localhost only by default
# if you'd like to connect from other Hosts,
# change to the own IP address or set to [0.0.0.0]
bind 127.0.0.1 -::1
# By default, outgoing connections (from replica to master, from Sentinel to
# Accept connections on the specified port, default is 6379.
# listening port
port 6379
# By default the server does not run as a daemon. Use 'yes' if you need it.
daemonize yes
# Set the number of databases. The default database is DB 0, you can select
# dbid is a number between 0 and 'databases'-1
databases 16
Once you’re done adjusting the settings, save and exit the file.
Then, restart Valkey by running the command below.
sudo systemctl restart valkey
Operation
Once Valkey is running on Ubuntu, you’ll use commands to interact with it and manage its operations. The valkey-cli tool is your primary way to send these commands. To connect to the Valkey server running on your own computer, simply type ‘valkey-cli’ in your terminal and press Enter.
Connect to the local Valkey server.
valkey-cli
Connect to another Valkey server.
valkey-cli -h node01.example.com
Show connected clients.
client list
Show stats and requests.
info
monitor
Exit from console
quit
That should do it!
Conclusion:
In summary, installing and configuring Valkey on Ubuntu 24.04 is straightforward. Following the abovementioned steps, you can quickly start with the in-memory key-value store. Here are the key takeaways:
- Ease of Installation: Valkey is readily available in Ubuntu’s default repositories, simplifying the installation process.
- Configuration Flexibility: The configuration file allows customization to fit various environments and use cases.
- Basic Commands: Familiarizing yourself with basic commands ensures Valkey’s efficient operation.
- Daemon Support: Valkey can run as a daemon or in a cluster, offering versatility for different deployment scenarios.
- Data Management: Supports a wide range of data types, making it suitable for diverse applications.
Valkey offers an efficient key-value store for anyone needing to manage data quickly. This option is powerful because Valkey version 7.2.5 provides fast data retrieval and storage, making it ideal for applications that require high performance.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!