LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

vagrant-port

Display Vagrant VM port forwarding mappings

TLDR

Show port mappings
$ vagrant port
copy
Show for specific VM
$ vagrant port [name]
copy
Show host port for a specific guest port
$ vagrant port --guest [80]
copy
SSH using the forwarded port
$ ssh -p $(vagrant port --guest 22) vagrant@localhost
copy

SYNOPSIS

vagrant port [options] [name]

DESCRIPTION

vagrant port displays guest to host port mappings. Shows forwarded ports configured for the VM. Useful for finding the host port to access services in the guest.

PARAMETERS

--guest port

Show only the host port that maps to the specified guest port. Returns an error if the port is not forwarded. Useful for scripting.
--machine-readable
Machine-readable output format for automation.

SEE ALSO

Copied to clipboard
Kai