In the local universe, it is well known that various properties of galaxies show a clear environmental dependence. Still, it is an open question when and how this environmental dependence was developed and shaped. In this presentation, I will address this intriguing question, showing our recent results on the build-up of passive galaxies over a wide redshift range, from z~2 to z~0.5, focusing on its environmental dependence.