The epidermis and the stratum corneum (SC) as its outermost layer have evolved to protect the body from evaporative water loss to the environment. To morphologically represent the extremely flattened cells of the SC - and thereby the epidermal barrier - in a multicellular computational model, we developed a 3D biomechanical model (BM) based on ellipsoid cell shapes. We integrated the BM in the multicellular modelling and simulation platform EPISIM. We created a cell behavioural model (CBM) with EPISIM encompassing regulatory feedback loops between the epidermal barrier, water loss to the environment, and water and calcium flow within the tissue. This CBM allows a small number of stem cells to initiate self-organizing epidermal stratification, yielding the spontaneous emergence of water and calcium gradients comparable to experimental data. We find that the 3D in silico epidermis attains homeostasis most quickly at high ambient humidity, and once in homeostasis the epidermal barrier robustly buffers changes in humidity. Our model yields an in silico epidermis with a previously unattained realistic morphology, whose cell neighbour topology is validated with experimental data obtained from in vivo images. This work paves the way to computationally investigate how an impaired SC barrier precipitates disease.