Many modelling methods for the analysis of dc distribution grids only consider monopolar configurations and do not allow for mutual couplings to be taken into account. The modelling method presented in this paper aims to deal with both of these issues. A state-space approach was chosen for its flexibility and computational speed. The derived approach can be applied to any dc distribution system regardless of its configuration and takes into account mutual couplings between phase conductors. Moreover, the state-space matrices can be derived in a programmatic manner. The derived model was verified empirically and by a reference model created in Simulink using PowerLib blocks. Subsequently, an illustrative system was analyzed, which showed the utility of the presented method in analyzing the dynamics of dc distribution systems. The presented method could especially be useful for the analysis, design and optimization of, for example, the stability and control systems of dc distribution systems.