Skip to content
Beginner 10 minutes

Create a Port

Provision your first Megaport Port from the command line — find a location, choose speed and term, and verify the service is live

Prerequisites

  • Megaport CLI installed and authenticated

A Port is your physical or logical connection into the Megaport fabric — every other Megaport service (VXCs, MCRs, MVEs, IXs) attaches to one. This tutorial walks through buying a single Port end-to-end. For ongoing management — updates, locking, tagging, deletion — see Port Lifecycle.

What you'll provision

🔎Find locationlocations list
🛒Buy portports buy
Verifyports status

Step 1 — Find a location

Ports are provisioned at specific data centres. Find one near you (or near a cloud provider you plan to connect to later).

bash
# All locations in a metro
megaport-cli locations list --metro Sydney

# Filter by country
megaport-cli locations list --country "Australia"

# Get the ID for a specific data centre
megaport-cli locations list --metro Sydney --output json | jq '.[] | {id, name}'

Example output:

text
NAME                      COUNTRY    METRO   STATUS  MCR AVAILABLE
NextDC S1 Sydney          Australia  Sydney  ACTIVE  true
Equinix SY3 Sydney        Australia  Sydney  ACTIVE  true
Global Switch Sydney West Australia  Sydney  ACTIVE  true

Note the numeric ID of the location you want — you'll pass it as --location-id.

💡

Pick a location near your cloud target

If you plan to connect to AWS, Azure, or GCP later, choose a location where that cloud has on-ramps. Run megaport-cli partners list --location-id <id> to see which cloud providers are available at a given DC.


Step 2 — Buy the Port

The CLI offers three input modes for ports buy. Pick whichever fits your workflow.

Interactive mode

Walks you through every required field with prompts:

bash
megaport-cli ports buy --interactive
text
? Port name: My First Port
? Location ID (run 'locations list' to find IDs): 3
? Port speed [1000, 10000, 100000]: 10000
? Contract term in months [1, 12, 24, 36]: 12
? Marketplace visibility (visible to other Megaport customers)? No

Summary:
  Name:                  My First Port
  Location:              3 (NextDC S1 Sydney)
  Speed:                 10000 Mbps (10G)
  Term:                  12 months
  Marketplace visible:   false

? Confirm purchase? Yes

Port created: abc-1234-5678-def
Status: CONFIGURED

Flag mode

Reproducible from a single command:

bash
megaport-cli ports buy \
  --name "My First Port" \
  --location-id 3 \
  --port-speed 10000 \
  --term 12 \
  --marketplace-visibility false

JSON mode

Best for scripting and CI:

bash
megaport-cli ports buy --json '{
  "name": "My First Port",
  "locationId": 3,
  "portSpeed": 10000,
  "term": 12,
  "marketPlaceVisibility": false
}'

Or load the configuration from a file:

bash
megaport-cli ports buy --json-file ./port-config.json

Required fields

FlagJSON keyValuesNotes
--namenameString, 1–64 charsShown in Portal and on invoices
--location-idlocationIdNumeric IDFrom locations list
--port-speedportSpeed1000, 10000, 100000 Mbps1G, 10G, or 100G
--termterm1, 12, 24, 36 monthsLonger term = lower monthly rate
--marketplace-visibilitymarketPlaceVisibilitytrue / falsefalse = private

Optional fields

FlagJSON keyNotes
--diversity-zonediversityZoneblue / red for redundant pairs at the same DC
--cost-centrecostCentreBilling label for cost allocation
--promo-codepromoCodeApply a promotional discount
--resource-tagsresourceTagsKey-value tags as JSON, e.g. {"env":"prod"}
⚠️

Term is locked once provisioned

The contract term cannot be reduced after purchase. You can extend the term later, but not shorten it. Pick a term that matches your minimum commitment.


Step 3 — Verify the Port is live

The Port is created with status CONFIGURED while Megaport provisions it on the fabric. It transitions to LIVE automatically — usually within a few minutes.

bash
# Full details
megaport-cli ports get <PORT-UID>

# Status only
megaport-cli ports status <PORT-UID>

# Watch until it goes LIVE
megaport-cli ports status <PORT-UID> --watch

Once status shows LIVE, the Port is ready to accept VXCs.

💡

Save your Port UID

The UID returned by ports buy (e.g. abc-1234-5678-def) is the handle for every operation that follows. Store it somewhere you can reference — environment variable, config file, or ports list --port-name "My First Port".


What's next?

You now have a working Port. Connect it to something:

💡

For Sales demos

Three commands, under five minutes — that's the difference between Megaport and a traditional carrier port. Run this end-to-end live during a discovery call to anchor the speed advantage.