Redis and Memcached keep frequently used data in memory, so your application can skip repeated database queries. Neither is available on Domain India shared hosting: to use them, you install and run them yourself on a VPS. This guide explains what to use on shared hosting instead, and how to set up Redis or Memcached safely on your own server.
Redis and Memcached are not available on Domain India shared hosting (cPanel, DirectAdmin or Webuzo), and the App Platform has no Redis add-on. On shared hosting, use what is already there: OPcache, page caching and the cPanel caching proxy. If your app needs Redis or Memcached, run it on a Domain India VPS, which is self-managed: you install, secure and update it.
1. Redis vs Memcached
| Feature | Redis | Memcached |
|---|---|---|
| Data types | Strings, lists, sets, hashes, sorted sets, streams | Strings only |
| Persistence | Optional (RDB snapshots, AOF) | None; memory only |
| Extras | Pub/sub, atomic counters, locks, queues | Simple key-value cache |
| Typical use | WordPress object cache, Laravel cache, sessions and queues | Simple object or session cache |
| Recommended for | Most new applications | Existing setups that already use it |
For a new PHP or WordPress site, Redis (or Valkey, its open-source fork) is the usual choice.
2. What you can use on Domain India shared hosting
Shared hosting has no Redis or Memcached server, and the PHP extensions for them are not loaded, so enabling them from the panel is not possible. You still get useful caching:
- OPcache keeps compiled PHP in memory. It is enabled on our cPanel servers, and on our DirectAdmin servers for every PHP version except PHP 8.3. See PHP OPcache guide.
- Page caching plugins for WordPress, such as WP Super Cache or W3 Total Cache with disk caching, serve stored pages without running PHP for each visitor.
- The cPanel caching proxy: our cPanel servers run nginx in front of Apache, and it can keep serving a stored copy of a page for up to 120 minutes. Add
?t=1to a URL to check a change. - Laravel and other frameworks: use the
databaseorfilecache driver.
If the site is still slow, work through My website is slow before you move to a bigger setup.
Redis and Memcached are not offered on any shared hosting plan, and the App Platform has no Redis add-on (each plan includes PostgreSQL). If you need Redis, the route is your own VPS.
3. Install Redis on your VPS
A Domain India VPS is self-managed: you have root access and look after the software yourself.
# Ubuntu / Debian
sudo apt update
sudo apt install -y redis-server
sudo systemctl enable --now redis-server
# AlmaLinux / Rocky 9
sudo dnf install -y redis
sudo systemctl enable --now redis
# AlmaLinux / Rocky 10 ship Valkey, a compatible fork
sudo dnf install -y valkey
sudo systemctl enable --now valkeyCheck that it answers:
redis-cli ping # or: valkey-cli ping
# PONG4. Secure and size Redis
Edit the config file: /etc/redis/redis.conf on Ubuntu and AlmaLinux 9, or /etc/valkey/valkey.conf for Valkey.
# Listen on this server only
bind 127.0.0.1 -::1
protected-mode yes
# Require a password
requirepass your-strong-password
# Cap memory and evict the least recently used keys when full
maxmemory 256mb
maxmemory-policy allkeys-lruRestart the service after any change. Never open port 6379 in your firewall: an exposed Redis is one of the most common ways servers get taken over.
5. Install Memcached on your VPS (if you need it)
# Ubuntu / Debian
sudo apt install -y memcached
# AlmaLinux / Rocky
sudo dnf install -y memcached
sudo systemctl enable --now memcachedMake sure it listens on 127.0.0.1 only and has UDP disabled (-l 127.0.0.1 -U 0 in /etc/memcached.conf on Ubuntu, or OPTIONS in /etc/sysconfig/memcached on AlmaLinux). Memcached has no password by default, so it must never be reachable from the internet.
For PHP, install the matching extension from your OS packages (for example php-redis or php-memcached on Ubuntu), or with PECL. Note that memcached and memcache are different PHP extensions; most applications want memcached.
6. Connect WordPress and Laravel
- Install the plugin.In WordPress, add and activate the Redis Object Cache plugin.
- Add the connection to
wp-config.php,above the "That's all, stop editing" line:define('WP_REDIS_HOST', '127.0.0.1');,define('WP_REDIS_PORT', 6379);,define('WP_REDIS_PASSWORD', 'your-strong-password');and a uniquedefine('WP_REDIS_PREFIX', 'site1_');for each site. - Enable the object cache.Go to Settings › Redis, click Enable Object Cache, and check that the status shows Connected.
For Laravel, set CACHE_STORE=redis (Laravel 11 and later; older versions use CACHE_DRIVER) and the REDIS_* values in .env. Tags, locks and stampede prevention are covered in Laravel + Redis cache.
7. Monitor and troubleshoot
- Hit rate:
redis-cli INFO statsshowskeyspace_hitsandkeyspace_misses. For Memcached, sendstatsto port 11211 and compareget_hitswithget_misses. - Memory:
redis-cli INFO memory. If memory keeps growing, setmaxmemoryand an eviction policy. - Cannot connect: check the service with
systemctl status redis(orredis-server,valkey), the port, and that the password matches in the config and your app. - WordPress cache not working: check that
wp-content/object-cache.phpexists and that only one caching plugin handles the object cache.
For more on caching layers, see Server-side caching.
Can I enable Redis or Memcached on Domain India shared hosting?
No. Redis and Memcached are not available on Domain India shared hosting (cPanel, DirectAdmin or Webuzo), and the PHP extensions for them are not loaded. Use OPcache, a page caching plugin or your framework's database or file cache on shared hosting, or run Redis on a VPS.
Does the App Platform offer Redis?
No. The App Platform has no Redis add-on; each plan includes a PostgreSQL database. For Redis, use a VPS.
Do you install Redis on a VPS for me?
A Domain India VPS is self-managed, so you install and maintain Redis yourself with the commands in this guide.
Redis or Memcached for a new site?
Redis, in most cases. It has richer data types, optional persistence and wide plugin support. Memcached is fine if your application already uses it.
Is it safe to open the Redis port so another server can connect?
Not directly. Keep Redis bound to 127.0.0.1 and reach it from other servers through a private network or an SSH tunnel, with a password set.
Ready to run Redis? Choose a Domain India VPS. For help with caching on your hosting account, open a support ticket.
A self-managed VPS gives you root access to install Redis, Valkey or Memcached and tune them for your application.
View VPS plans