Sha256: dda13f765ae002464f3788ddd2258debff594f125d9e18a8e63b95e792981d09

Contents?: true

Size: 1.04 KB

Versions: 19

Compression:

Stored size: 1.04 KB

Contents

---
layout: "docs"
page_title: "vagrant port - Command-Line Interface"
sidebar_current: "cli-port"
description: |-
  The "vagrant port" command is used to display the full list of guest ports
  mapped to the host machine ports.
---

# Port

**Command: `vagrant port [name|id]`**

The port command displays the full list of guest ports mapped to the host
machine ports:

```
$ vagrant port
    22 (guest) => 2222 (host)
    80 (guest) => 8080 (host)
```

In a multi-machine Vagrantfile, the name of the machine must be specified:

```
$ vagrant port my-machine
```

## Options

* `--guest PORT` - This displays just the host port that corresponds to the
  given guest port. If the guest is not forwarding that port, an error is
  returned. This is useful for quick scripting, for example:

        $ ssh -p $(vagrant port --guest 22)

* `--machine-readable` - This tells Vagrant to display machine-readable output
  instead of the human-friendly output. More information is available in the
  [machine-readable output](/docs/cli/machine-readable.html) documentation.

Version data entries

19 entries across 15 versions & 4 rubygems

Version Path
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/website/source/docs/cli/port.html.md
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/website/source/docs/cli/port.html.md
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/website/source/docs/cli/port.html.md
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/website/source/docs/cli/port.html.md
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/website/source/docs/cli/port.html.md
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/website/source/docs/cli/port.html.md
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/website/source/docs/cli/port.html.md
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/website/source/docs/cli/port.html.md
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/website/source/docs/cli/port.html.md
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/website/source/docs/cli/port.html.md
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/website/source/docs/cli/port.html.md
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/website/source/docs/cli/port.html.md
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/website/source/docs/cli/port.html.md
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/website/source/docs/cli/port.html.md
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/website/source/docs/cli/port.html.md
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/website/source/docs/cli/port.html.md
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/website/source/docs/cli/port.html.md
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/website/source/docs/cli/port.html.md
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/website/source/docs/cli/port.html.md