Learn how to deploy Redis with persistence enabled to Hop in seconds
Hop is a deployment platform that makes it easy to deploy any application. If something can run as a Docker image, it can run on Hop. That includes Redis!
Redis is available on Docker Hub, and it’s also available as a Preset on Hop which means that all the configuration is done for you.
In 5 seconds
This will deploy Redis with our default configuration. This is a good place to start if you’re not sure what you need.
- Hit Cmd+K (or Ctrl+K if using Windows) on your keyboard
redisand hit enter twice
- It’s deployed! Now head over to using your new deployment.
You can edit Hop’s default Redis runtime settings by deploying Redis through the preset menu.
- Go to Ignite on the sidebar, then New deployment
- Select Redis from the list of presets
- Optionally configure the start command, environment variables and volume size
- Hit Deploy
Using your new deployment
Now that Redis is deployed, let’s put it to use.
Connecting to Redis from your local machine
You can use the hop fwd CLI command to connect to your new Redis deployment from your local machine. Redis runs on port 6379 so make sure to select that when forwarding.
Once the forwarding is set up, you can open another terminal and connect to Redis using the forwarded port using redis-cli.
Connecting to Redis from another Hop deployment
Let’s say you want to allow your API deployment to access your new Redis instance. Luckily, Hop makes this easy. You can create an Internal Gateway to give your Redis deployment an internal domain, such as redis.hop. You can then use that domain within any other deployment in your project, and it’ll point to your Redis deployment.