Abstract The purpose of this paper was to present the thermoporoelasticity model adapted for application in modelling processes, where phase transition may occur, such as during underground coal gasification (UCG). The mathematical model of the medium (soil/rock with pores filled with liquid/gas) in non-isothermal conditions is based on Biot's poroelasticity model. The poroelasticity model is expanded here by the influence of temperature and adjusted to the case where both liquid and highly compressible fluid are present in pores by using the gas laws. This requires considering temperature-dependent physical quantities such as pore fluid density, heat transfer coefficient and viscosity as functions of temperature. Based on the proposed mathematical model and the finite element method, a numerical model was built for the purpose of computing processes occurring in the vicinity of the UCG generator. The result of the authors’ work is a three-dimensional (3D) model, which was not only modified, but derived straight from the laws of thermodynamics, where fields of displacement, temperature and fluid flow are coupled. The model makes it possible to determine results significant to modelling of the UCG process, the reach of the gaseous phase's presence in pores, subsidence values, temperature distribution and directions and rate of seepage, without losing the simplicity and elegance of Biot's original concept. Next, the results of simulations for a hypothetical deposit to estimate the environmental impact of UCG are presented. After applying specific geometry and parameters, the model can be useful for verifying if the chosen technology of UCG in specific conditions will be safe for the environment and infrastructure.