Expose Redis instance remotely and connect from any server

How can I expose a Redis instance remotely? I want to get from my computer when developing locally.

I tried to expose a port by adding the following to my fly.toml but it doesn’t work

  [[services.ports]]
    handlers = []
    port = 9000

Stackoverflow suggests that I edit redis.conf but I cannot find that file when I ssh into my fly instance.

Do you have WireGuard installed locally?

If not, this guide explains the steps needed:

You should then be able to access .internal hostnames (like the Redis app will have) locally (which of course otherwise would not resolve) as if you were a Fly app using the private network within that same organization.

1 Like

@greg has the best answer. There’s a slightly simpler way that users Wireguard under the covers. Run fly proxy 6379: 6379 -a <name-of-redis-app> in one terminal, then you can connect to localhost:6379 from another process.

3 Likes

Thanks! This solved it for me :slight_smile:

1 Like