MacPorts installs from a signed .pkg installer specific to your macOS version. Unlike Homebrew's curl-pipe-bash workflow, MacPorts wants the formal installer route — partly because it has to set up the /opt/local prefix with strict root permissions and a specific user/group structure.
The prerequisite is the Xcode Command Line Tools. MacPorts compiles from source, so you need a working toolchain. xcode-select --install handles that.
After the installer finishes, the very first thing to do is sudo port selfupdate. This fetches the latest port definitions (the equivalent of brew update). MacPorts' port tree updates frequently, and a fresh install ships with whatever was current on the day of the .pkg release — which can be months old.