Switzerland Mandates Open Source for Government

Switzerland has written open source into federal law. The EMBAG, the Federal Act on the Use of Electronic Means for the Fulfilment of Government Tasks, came into force on January 1, 2024, and its Article 9 makes "open by default" the rule for software the federal government builds.

Precision matters here, because the headlines oversold it, and so did the first version of this article. The law doesn't say every piece of software the Swiss government uses must be open source. Federal offices still run Windows and buy commercial products. What it says is narrower, and more achievable.

What the law requires

  • Federal bodies must publish the source code of software they develop themselves or have developed for them by contractors, under an open source license.
  • Exceptions apply where third parties' rights or security considerations rule it out. A contractor's existing proprietary components, or the code of a security-sensitive system, don't have to be published.
  • Buying existing software isn't covered. The obligation applies to custom development, not to licensing an off-the-shelf product.
  • Agencies may offer services around their software, such as support and integration, to other public bodies at cost.

So the core principle is public money, public code: if taxpayers paid for software to be written, taxpayers and other governments should be able to see and reuse it. Federal offices have started publishing on GitHub under the swiss organization and their own accounts.

Why it's a good law

  • No paying twice. A canton building a tax form, a permit system or an appointment booker can start from what another office already built.
  • Accountability. Citizens and journalists can inspect how the software that administers their lives actually works.
  • Better code. Code written knowing it'll be published tends to be cleaner and more secure, and gets outside eyes.
  • Less lock-in. If the government owns and publishes the code, it can hire someone else to maintain it when the original contractor gets expensive.

How other countries compare

Switzerland isn't alone, and the record elsewhere is instructive:

  • The United States has a Federal Source Code Policy, from 2016, requiring agencies to share custom code with each other and release at least 20 percent as open source. It's a policy, not a law, and compliance is patchy. I wrote about it in the 4th of July and the open source movement.
  • The United Kingdom's Government Digital Service has required new government code to be published openly for years, as part of its Service Standard.
  • France keeps a recommended list of free software for public administrations, the SILL, and has a national open source program office inside its digital agency.
  • The European Union adopted the Interoperable Europe Act this year, encouraging member states to share and reuse public-sector software.
  • Germany's northernmost state, Schleswig-Holstein, announced this spring that it will move tens of thousands of government workstations from Microsoft Office to LibreOffice, with Linux to follow.

The cautionary tale: Munich

Any honest discussion has to include Munich. The city moved around 15,000 desktops to its own Linux distribution, LiMux, from 2004 to 2013. It was held up as the proof that a government could leave Microsoft. Then, after a change in city leadership and years of complaints about compatibility with partners still on Microsoft formats, the council voted in 2017 to move back to Windows. A later administration swung back toward open source in 2020.

The lesson isn't that open source failed in Munich. It's that desktop migrations are political and organizational projects as much as technical ones. They need sustained leadership, proper training and budget, and a plan for the documents and systems that come from outside. Publishing code you write, the Swiss approach, is a much easier and more durable win than replacing every desk's software.

What would make it work

For Switzerland's law, and any like it, to matter:

  • Publish in a usable way. A tarball nobody can build isn't open source in practice. Code needs a license, documentation and a real repository.
  • Fund maintenance. Published code that nobody maintains is a security liability for anyone who reuses it.
  • Write it into contracts. Procurement terms should require contractors to deliver code under an open license from the start, not argue about it at handover.
  • Build communities across governments, so that a shared component has more than one public body looking after it.

The Swiss law is a good model precisely because it's modest and enforceable. It doesn't ask the government to stop using commercial software. It asks the government to stop paying for code nobody else is allowed to see.

Since then

Added October 2026. The idea spread, often under the banner of digital sovereignty. In June 2025 Denmark's Ministry of Digitalisation announced it would replace Microsoft Office with LibreOffice, and several Danish cities said they'd follow. In the US, the SHARE IT Act made sharing custom-built federal code a legal requirement at the end of 2024.