The aim of this paper is to investigate the nonlinear static stability of nanocomposite multilayer organic solar cells (NMOSC) on elastic foundations under axial compressive loading in thermal environment. In the previous literatures, the NMOSC consists of five isotropic layers including Al, P3HT:PCBM, PEDOT:PSS, ITO and glass. However, the disadvantages of ITO are high cost, scarcity and low chemical stability. Therefore, the graphene material is chosen to replace the ITO layer in this study. The material properties of graphene layer are assumed to depend on temperature while the elastic moduli of four remaining isotropic layers are constants. For methodology, the geometrical compatibility and nonlinear equilibrium equations are derived based on the Hamilton's principle and classical plate theory. These equations are solved by using the Galerkin method in order to obtain the expression of critical buckling load and compressive loading - deflection amplitude curves. For geometric optimization problem, three optimization algorithms including social group optimization, basic differential evolution and enhanced colliding bodies optimization algorithms are applied to find the maximum value of the critical buckling loading of NMOSC depending on four geometrical and material variables. Parametric studies are conducted to indicate the influences of temperature increment, geometrical parameters, initial imperfection and elastic foundations on the static stability characteristics of the NMOSC.