HACHENBURG, Germany—Behind the walls of a 12th-century castle here, perched above a wooded valley 30 miles by winding forest road from the nearest big town, Germany is training its first line of defense against foreign instability.

Long ago, Schloss Hachenburg was a palace for local counts. Now it is home to an elite academy for about 350 young men and women. The castle offers only one degree: central banking. The typical student? “Risk-averse,” says the school’s rector, Erich Keller.

Germany’s currency disappeared in 2002 with the arrival of the euro, and the nation appoints just one of the 25 members of the European Central Bank’s governing council, the same as Malta. Yet the Bundesbank, Germany’s central bank, remains a hallowed institution, and its in-house university here, called Deutsche Bundesbank University of Applied Sciences, is still churning out graduates.

Around one-quarter of the Bundesbank’s roughly 10,000 staffers are graduates of the three-year program, including many in its upper echelons. More than four of five graduates still work for the Bundesbank 10 years after graduation.

In a European Union unsettled by high unemployment, terrorism, an influx of refugees, below-zero interest rates and a possible British exit from the bloc, Schloss Hachenburg remains an island of stability.