Skip to content
Beginner - Solutions Architect - Sales 5 minutes

Installation

Install the Megaport CLI on macOS, Linux, or Windows — or run it in Docker or your browser

Four ways to get the Megaport CLI: Homebrew, Go install, Docker, or use it live in your browser with no setup at all.

Option A — Homebrew (macOS / Linux)

The simplest way to install on macOS or Linux:

bash
brew tap megaport/tap
brew install megaport-cli

Verify the install:

bash
megaport-cli version

The latest version is v0.10.0.

Upgrade to a new release:

bash
brew update
brew upgrade megaport-cli

Option B — Go install

If you have Go 1.21+ installed, this is the fastest path:

bash
go install github.com/megaport/megaport-cli@latest

Verify the install:

bash
megaport-cli version

The latest version is v0.10.0.

The binary is placed in your $GOPATH/bin (usually ~/go/bin). Make sure this is in your $PATH.

Shell completion

Generate shell completion scripts for a better CLI experience:

bash
# bash
megaport-cli completion bash > /etc/bash_completion.d/megaport-cli

# zsh
megaport-cli completion zsh > "${fpath[1]}/_megaport-cli"

# fish
megaport-cli completion fish > ~/.config/fish/completions/megaport-cli.fish

Option C — Docker

No Go required. Run any megaport-cli command directly via Docker:

bash
docker run --rm \
  -e MEGAPORT_ACCESS_KEY=your_access_key \
  -e MEGAPORT_SECRET_KEY=your_secret_key \
  ghcr.io/megaport/megaport-cli:latest \
  locations list

Pin to a specific version:

bash
docker run --rm \
  -e MEGAPORT_ACCESS_KEY=your_access_key \
  -e MEGAPORT_SECRET_KEY=your_secret_key \
  ghcr.io/megaport/megaport-cli:latest \
  locations list --metro Sydney
💡

Best for Sales demos

Docker is the fastest path for customer demos and POCs. One command, no install, works on any machine with Docker.

Run a quick demo in under 60 seconds — no account setup needed for browsing public data like locations.


Option D — Browser (zero install)

The CLI is compiled to WebAssembly and runs entirely in a browser tab. No install, no binary, no PATH.

Using the hosted demo

Visit the Live Demo on this site to try the CLI right now.

Self-hosted with Docker

bash
# Clone the repo
git clone https://github.com/megaport/megaport-cli.git
cd megaport-cli

# Run the web terminal
./deploy.sh

Then open http://localhost:8080.

The deploy script accepts optional flags:

bash
# Custom port and session length
PORT=9000 SESSION_DURATION=8h ./deploy.sh

Available session durations: 30m, 1h (default), 8h, 24h.

ℹ️

Browser limitations

The WebAssembly build does not support config commands — profile management and credential storage run natively only. Authentication in the browser is done through the web UI session.


Verify your installation

After installing the native binary, confirm everything works:

bash
megaport-cli version

Expected output — the latest version is v0.10.0.

Then proceed to Authentication to connect your Megaport account.