The paper presents a method for determining the mutual impedance of two dipoles located on a multilayer dielectric structure. Determining the mutual impedance of linear antennas is a complex issue and we are unable to obtain an exact solution, it is influenced by many elements (location, dimensions, electrical parameters of the earth, thickness of the substrate, thickness and antenna conductivity, etc.) In the case of antennas on a dielectric substrate, the coupling analysis is even more complicated, because the operation of these antennas is significantly influenced by the occurrence of surface waves conducted through an open dielectric structure. The problem was solved by the method of moments using the Galerkin method as its special case. The work uses a method developed by Richmond for obtaining the elements of the impedance matrix, based on the concept of reaction between sections of the base and testing functions. Their mutual interaction was described by the reaction of the electric field caused by the current flowing through one dipole with the current flowing through the other dipole. Based on this analysis, the mutual impedance of two arbitrarily oriented dipoles located on a multilayer dielectric was determined, where the current distribution and antenna lengths are arbitrary. A computer program was developed that allowed to determine the mutual impedance for freely oriented dipoles.