Indonesia, as the world’s largest Muslim-majority nation, faces persistent challenges in maintaining social cohesion amid rising religio-political tensions and multicultural fragmentation. Islamic boarding schools (pesantren) hold a distinctive role as institutions of religious socialization and cultural negotiation. This study explores how pesantren foster social cohesion through a qualitative multi-site case study of three prominent institutions in Java recognized for moderate Islamic thought and engagement with diversity. Data were collected via interviews, participant observation, and document analysis of classical texts (kitab kuning) and institutional curricula, analyzed through Berger’s theory of social construction and Durkheim’s concept of moral education and solidarity. Findings reveal that pesantren integrate universal values such as cooperation (ta’awun), tolerance (tasamuh), and justice (‘adalah) into formal curricula, while hidden curricula and communal practices provide experiential pluralism. Institutional traditions, including national celebrations and interfaith dialogues, further bridge religious identity with civic belonging. These layered processes cultivate graduates with “hybrid identities” that harmonize Islamic piety with commitment to the Indonesian nation-state. The study concludes that pesantren offer an indigenous model of fostering social cohesion neither fully secular nor exclusively religious highlighting their potential as long-term strategies against extremism and as significant contributors to the sociology of education and Islamic studies in contexts of modernity and pluralism.