Ophthalmic formulations containing nintedanib, or a pharmaceutically acceptable salt thereof are provided. The ophthalmic formulations can contain microparticles or nanoparticles of nintedanib. Also provided are methods of using the ophthalmic formulations for treating ocular surface diseases, such as dry eye disease.