Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the new 64-bit z/Architecture. Hercules runs under Linux, Windows (98, NT, 2000, and XP), Solaris, FreeBSD, and Mac OS X (10.3 and later).
The installation instructions will aid you in setting Hercules up.
Site was last updated 10 years ago. Looks like an abandoned project. Does it still build?
I found a docker container that’s ‘just’ 4 years old: https://hub.docker.com/r/hermajordoctor/hercules/
The most up to date version that I know of is https://sdl-hercules-390.github.io/html/ , Keep in mind it only emulates the mainframe HARDWARE, kind of like VirtualBox which does the same for PC hardware. You still need some OS to use it in a meaningful way. There are some Linux distros that run on it from RedHat and Suse possibly others. IBM’s z/OS runs on it but they won’t license it for Hercules. That only leaves some very old (1980’s) versions of MVS, VM, MTS that one can run on it. Here http://wotho.ethz.ch/tk4-/ is an old MVS distro that runs on it.