The canon explanation is given in the novel Tarkin.
The Empire used a combination of secluded and inhospitable bases which each supported only part of the project. This made sure no single person (except the Emperor and Tarkin) knew about the project as a whole.
The Death Star was constructed in orbit over the planet Geonosis, and the planet's irradiated surface discouraged anyone from even traveling to the planet. Geonosis was also heavily defended:
Harassment of Imperial installations by pirates and malcontents was nothing new, but in almost all cases the assaults had been hit-and-run sorties, and none had taken place so close to heavily defended Geonosis.
...
The epicenter of a bustling throng of construction droids, supply ships, and cargo carriers, safeguarded by four Star Destroyers and twice as many frigates, the deep-space mobile battle station hovered in fixed orbit above secluded and forbidding Geonosis. When viewed from mid-system or from even as close as the asteroid belt that further isolated the planet from celestial interchange, one could be fooled into believing that the irradiated world had added another small moon to its collection.
Tarkin, p. 25, 257
Wilhuff Tarkin, who was in charge of the overall project, was stationed on Sentinel Base; this base was located on an extremely remote system that didn't even have name:
For those in the know, then, it seemed inexplicable that Wilhuff Tarkin should be assigned to a desolate moon in a nameless system in a remote region of the Outer Rim. The closest planets of any note were the desert world Tatooine and equally inhospitable Geonosis, on whose irradiated surface the Clone Wars had begun and which had since become a denied outlier to all but an inner circle of Imperial scientists and engineers.
Tarkin, p. 5
A different base, called Rampart Station, served as the marshaling depot for supplies:
Coreward from Sentinel in the direction of the planet Pii, Rampart was a marshaling depot for supply ships bound for Geonosis, where the deep-space weapon was under construction.
Tarkin, p. 10
The people who delivered supplies to this base had no idea what the supplies were for.
The Death Star's hyperdrive generator came from a separate base called Desolation Station:
There was probably no harm in sharing with Amedda information about the expected shipments of matériel from Desolation Station to Geonosis—including vital components for the battle station’s complex hyperdrive generator—but he was under no obligation to do so.
Tarkin, p. 29
Although millions of individuals were involved in the construction of the Death Star, even Imperial Moffs could not see the whole picture and thus figure out what the Empire was actually constructing:
What bothered him was that, compliant with a strategy that no base commander—Moff, admiral, or general—should have unrestricted access to information regarding shipments, scheduling, or construction progress, no single person was in charge of the project, unless of course the Emperor was considered to be that person. But the Emperor’s visits had been few and far between, and it was anyone’s guess just how much information was getting past the Imperial Ruling Council the Moffs and others answered to and actually reaching the Emperor’s ear. Certainly he was being briefed, but briefings were no longer enough. The project had reached a point where it had to rely on countless suppliers; and though each was being kept in the dark regarding the final destination of their contributions, millions of beings, perhaps tens of millions of beings galaxywide, were now involved with the battle station in one capacity or another.
Tarkin, p. 27
The Death Star was constructed using slave labor and recruited workers from nearby areas. These laborers were not in a position to tell anyone else about what they worked on.
For three years the only non- or near-humans he had seen or had direct contact with had been slaves or recruited laborers at outlying bases or at the battle station’s construction site.
Tarkin, p. 56
The distributed network of bases involved in the construction meant that very few people knew what the Empire was actually building, and the workers themselves were not in a position to tell anyone what they were building.