Temporarily forwarding a port on Vagrant

Sometimes when starting a new project it’s useful to set up a temporary port on vagrant, so a new port can be accessed without running vagrant reload. vagrant ssh can be used for port forwarding. To forward a port, run:

vagrant ssh -- -L 3001:localhost:3000

This will forward port 3001 on the host to port 3000 on the guest.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.