Using Landau-Ginsburg-Devonshire approach and available experimental results we constructed multiwell thermodynamic potential of the layered ferroelectric CuInP2S6 (CIPS). The analysis of temperature dependences of the dielectric permittivity and lattice constants for different applied pressures unexpectedly reveals the critically important role of a nonlinear electrostriction in this material. With the nonlinear electrostriction included we calculated the temperature and pressure phase diagrams and spontaneous polarization of a bulk CIPS, within the assumed range of applicable temperatures and applied pressures. Using the developed thermodynamic potential, we revealed the strain-induced phase transitions in thin epitaxial СIPS films, as well as the stress-induced phase transitions in СIPS nanoparticles, which shape varies from prolate needles to oblate disks. We also revealed the strong influence of a mismatch strain, elastic stress and shape anisotropy on the phase diagrams and polar properties of a nanoscale CIPS, and derived analytical expressions allowing for elastic control of the nanoscale CIPS polar properties.Hence obtained results can be of particular interest for the strain-engineering of nanoscale layered ferroelectrics.