It's a royal pain in the arse, had no luck on an Mac Mini using Snow Leopard (part of the reason I want a newer OS). I ended up downloading a vmware disk image for High Sierra, setting that up, finding an Apple page on downloading older OS versions, downloading the installer, that failed, so I used a 3rd party tool to download the complete installer app through the app store.
People wonder why I get pissed off with Apple and the way they do things, this crap is one of many!