After the seminal work of Connes and Tretkoff on the Gauss-Bonnet theorem for the noncommutative 2-torus and its extension by Fathizadeh and myself, there have been significant developments in understanding the local differential geometry of these noncommutative spaces equipped with curved metrics. In this talk, I will review a series of joint works with Farzad Fathizadeh in which we compute the scalar curvature for curved noncommutative tori and prove the analogue of Weyl's law and Connes' trace theorem. Our final formula for the curvature matches precisely with the one computed independently by A. Connes and H. Moscovici. I will then report on our recent work on the computation of scalar curvature for noncommutative 4-tori (which involves intricacies due to violation of the Kähler condition). We show that metrics with constant curvature are extrema of the analogue of the Einstein–Hilbert action. A purely noncommutative feature in these works is the appearance of the modular automorphism from Tomita–Takesaki theory of KMS states in the final formulas for the curvature.