👈 More articles are this way my dudes 🏄‍♀️

⚡️ Quick Tip ⚡️ Local Port Forwarding TCP Connections to VM

May 05, 2020 (1 min read)

I find that phpunit runs a lot faster on localhost so when I’m developing a Laravel app with Homestead I like to do this:

ssh -nNT -L 6379:192.168.10.10:6379 vagrant@192.168.10.10

This will forward calls on port 6379 (default for Redis) from localhost to the Redis instance in my VM and you can do this with any other service.

To forward MySQL for example:

ssh -nNT -L 3306:192.168.10.10:3306 vagrant@192.168.10.10

The port address on the left is your local port and the one on the right is in your VM.

Cheers!

Dan


Buy Me a Coffee at ko-fi.com...
© 2023, Built with 💖and Gatsby baby 🤙