Modeling droplet nucleation processes requires a molecular-scale approach to describe the interfacial tension (IFT) of spherical interfaces. Density gradient theory (DGT), also referred to as square gradient theory in some publications, has been widely used to compute the IFT of many pure and mixed systems at the molecular scale. However, the application of DGT to droplet interfaces is limited by its setup in open systems in which a stable droplet cannot be achieved. In this paper, we propose a mass-conserved DGT model in a closed system, i.e., with no-flux boundary conditions, where no mass exchange is allowed with the outside environment. As opposed to the traditional approach, this model enforces a canonical ensemble and guarantees energy dissipation. The proposed model has been successfully applied to systems with planar interfaces as well as spherical interfaces, especially for IFT calculation for droplets in the nucleation process. By extending the DGT model from open to closed systems, we demonstrate the potential of DGT as an inhomogeneous model for a wider range of academic and industrial applications.