VPS1Euro Dashboard Wiki

Complete client guide: infrastructure, services, account and support.

FR EN

Redis database (cache and sessions)

Install Redis to speed up your web applications via caching.

What this tutorial does

The tutorial "Redis database (cache and sessions)" helps you achieve this goal:

Install Redis to speed up your web applications via caching.

← Back to tutorials
1 profiles 18 steps 7 commands ~20 min

Debian/Ubuntu

  1. Install Redis: apt install -y redis-server
  2. Start and activate: systemctl enable --now redis-server
  3. --- Secure Redis ---
  4. Edit /etc/redis/redis.conf:
  5. bind 127.0.0.1 (listen only locally)
  6. requirepass strong_password (enable password)
  7. Restart Redis: systemctl restart redis-server
  8. --- Test Redis ---
  9. redis-cli
  10. AUTH strong_password
  11. SET test "hello"
  12. GET test (doit retourner "hello")
  13. --- Use Redis for PHP sessions ---
  14. Install PHP extension: apt install -y php-redis
  15. In php.ini, add:
  16. session.save_handler = redis
  17. session.save_path = "tcp://127.0.0.1:6379?auth=strong_password"
  18. Restart Apache: systemctl restart apache2