You need source engine build (i.e. GitHub source code download) to do it. Installed builds (from Editor) don’t include everything you need. This tutorial (sorta outdated, but made edits up to 4.18) provides the methods in building Server/Editor targets.