How to Install Redis® on Ubuntu 24.04?
If you want to skyrocket your app’s performance and speed, Redis® is one of the never-fail solutions. It is an in-memory key-value store that improves your database queries; thus, it enhances the performance of web applications. Redis finds applications in caching, real-time analytics, session management, etc. It is suitable for high-hit websites or fast back-ends to improve performance rapidly for other applications. It gives great enhancements to performance.
Cantech offers industrial-grade Linux VPS hosting, shared hosting, and reseller hosting solutions. For a Redis® database or cache, we assure you high availability, enhanced security, and smooth performance on our Linux VPS hosting. Our servers are optimally configured for Redis® to enable business or development to scale well.
Why Choose Redis®?
Redis is among the most considered in-memory data stores in the world. Here is why:
- Lightning-Fast Performance: Redis® keeps the data in RAM and offers much faster data retrieval than traditional databases.
- Data Persistence: Redis® uses two persistence methods: Append Only File (AOF) and Redis Database File (RDB).
- High scalability: Redis enables very high scalability with millions of requests processed per second; the most suitable solution for large applications.
- Rich data structures: It supports strings, lists, sets, sorted sets, hashes, bitmaps, geospatial indexes, and streams.
- Replication and high availability: Redis® features primary-replica replication with an option for automatic failover and high availability.
- Simple commands and easy configuration: It is straightforward for a beginner and an expert to get started on since the syntax is intuitive.
Cantech Networks enhances high-performance VPS hosting which can be dedicated to Redis to secure smooth operation, support web applications, databases, or caching and provide improved SSD storage.
Prerequisites
Before installing Redis®, ensure you have:
- An Ubuntu 24.04 server
- A non-root user with sudo privileges
- A stable internet connection
For seamless Redis® hosting, consider our dedicated Linux Server hosting plans with SSD storage and full root access.
Step 1: Update Your System
It’s always good practice to update your system packages before installing new software. Run the following command:
sudo apt update && sudo apt upgrade -y
This ensures your Ubuntu 24.04 system has the latest security updates and bug fixes.
Step 2: Install Redis® on Ubuntu 24.04
Now, install Redis® using the package manager:
sudo apt install redis-server -y
Once installed, verify the installation by checking the Redis® version:
redis-server --version
You should see an output similar to:
Redis server v=7.0.15
Step 3: Configure Redis® for Security and Performance
By default, Redis is set up to listen on 127.0.0.1. To modify the configuration, you have to edit the Redis configuration file.
sudo nano /etc/redis/redis.conf
Look for the following directives and modify them if needed:
bind 127.0.0.1 ::1 port 6379 daemonize yes
Save and exit the file (CTRL+X → Y → ENTER).
Restart Redis® to apply the changes:
sudo systemctl restart redis
Enable Redis® to start on boot:
sudo systemctl enable redis
Check if Redis® is running:
sudo systemctl status redis
If Redis® is active, you should see the following message:
Active: active (running)
Step 4: Secure Redis® with a Password
Security is a crucial aspect of managing Redis®. To set a password, open the Redis® configuration file:
sudo nano /etc/redis/redis.conf
Find the line starting with # requirepass and change it to:
requirepass your-strong-password
Save and restart Redis®:
sudo systemctl restart redis
Now, authenticate with your password:
redis-cli AUTH your-strong-password
A successful authentication returns OK.
For secure Redis® hosting, consider Cantech’s dedicated servers with DDoS protection and firewall security.
Step 5: Test Redis®
To confirm that Redis® is functioning correctly, try setting and retrieving a key-value pair:
redis-cli SET testkey "Hello, Redis!" GET testkey
If everything is set up correctly, you will see:
"Hello, Redis!"
Step 6: Enable Persistence (Optional but Recommended)
To ensure data isn’t lost on server reboots, enable Redis® persistence. Edit the Redis® configuration file:
sudo nano /etc/redis/redis.conf
Uncomment and set:
save 900 1 save 300 10 save 60 10000
Restart Redis®:
sudo systemctl restart redis
Conclusion
Congratulations! You have successfully installed and configured Redis® on Ubuntu 24.04. Whether you use it for caching, message brokering, or real-time analytics, Redis can significantly improve your applications overall performance .
If you are looking for a fast, reliable, and highly scalable hosting solution for your Redis-based applications, choose Cantech Networks Private Limited. The Linux VPS Hosting is perfectly suited for running Redis workloads.
🚀 Want to supercharge your installations? Get your hands on a high-performance VPS from Cantech Networks!
🔗 Find our hosting solutions: Linux VPS Hosting, Dedicated Server Hosting, Reseller Hosting, and much more! We are available 24/7, and our expert support staff will gladly help you. Find our contact by visiting Cantech.in.
Happy hosting!
Frequently Asked Questions (FAQs)
Is Redis® free to use?
Yes! Redis has open-source code with a free license; the current license is the BSD license. Therefore, developing on Redis and using it commercially will be allowed.
Can Redis® be used as a primary database?
Although Redis is generally a caching layer, some applications configure it as the primary database while ensuring that persistence is enabled.
What is the default port for Redis®?
Redis runs primarily on port 6379.
How can I monitor Redis® performance?
You can use the command:
redis-cli info
This provides key metrics about Redis® performance, memory usage, and connected clients.
Can I host Redis® on shared hosting?
Redis® requires specific server configurations and is best suited for VPS hosting or dedicated servers.
How do I restart Redis® if I make changes?
Simply run:
sudo systemctl restart redis