MacPorts version 2.8.1 is available in various formats for download and installation (note, if you are upgrading to a new major release of macOS, see the migration info page):
Install MacPorts for your version of the Mac operating system:.Install Apple's Command Line Developer Tools: xcode-select -install.