MacOS is not copy-protected in the usual sense:
Apple software downloaded from the Mac App Store, including MacOS, is not copy protected. However, it IS tagged with the Apple-ID of the purchaser when "purchased" (or equivalent — Think of MacOS as purchased on sale for $0.) A valid Apple-ID is required at some point in the process for completing installation of almost all downloads from the Mac App Store.
You cannot update, upgrade, or install new software based on already-installed software UNLESS your Mac supplies the Apple-ID used for the original software.
If your old MacOS is badly damaged, or you completely erased your Mac, the Apple-ID is not available, and you get the “cannot contact the server…” message that should go on to say, “…with the Apple-ID provided or NO Apple-ID”.
In that case, you can try invoking Recovery with:
Shift-Option-Command-R
You are requesting the "shipped-in-the-box" version, which will be tagged ONLY with the serial number of your Mac, and does not require any Apple-ID to be already working on your Mac.