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
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).
# 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:
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:
megaport-cli ports buy --interactive
? 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:
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:
megaport-cli ports buy --json '{
"name": "My First Port",
"locationId": 3,
"portSpeed": 10000,
"term": 12,
"marketPlaceVisibility": false
}'
Or load the configuration from a file:
megaport-cli ports buy --json-file ./port-config.json
Required fields
| Flag | JSON key | Values | Notes |
|---|---|---|---|
--name | name | String, 1–64 chars | Shown in Portal and on invoices |
--location-id | locationId | Numeric ID | From locations list |
--port-speed | portSpeed | 1000, 10000, 100000 Mbps | 1G, 10G, or 100G |
--term | term | 1, 12, 24, 36 months | Longer term = lower monthly rate |
--marketplace-visibility | marketPlaceVisibility | true / false | false = private |
Optional fields
| Flag | JSON key | Notes |
|---|---|---|
--diversity-zone | diversityZone | blue / red for redundant pairs at the same DC |
--cost-centre | costCentre | Billing label for cost allocation |
--promo-code | promoCode | Apply a promotional discount |
--resource-tags | resourceTags | Key-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.
# 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:
- Connect to AWS — provision a Direct Connect VXC
- Connect to Azure — provision an ExpressRoute VXC
- Create a Megaport Internet VXC — turn your Port into an internet upstream
- Port Lifecycle — full reference for update, lock, tag, delete, and restore
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.