Hops weren’t that popular until the 1400-1500s (or not used at all in some places like England) though
In continental Europe they were popular from roughly ~1000 onwards (see Behre 1999), in England from roughly 1500 onwards. In African and South American farmhouse brewing they're still not used. So it's a pretty complicated picture.
As the comment made clear, hops are only one component of what makes beer safe, though. Storable, safe beer for travel is documented already in Ancient Egypt.