Computational homogenization may be used to evaluate effective properties of microstructured materials. As digital imaging techniques generally generate microstructure information on a regular grid, a common approach to compute the effective properties of the microstructured materials is to use fast Fourier transform (FFT)‐based methods. Traditionally, this approach involves periodic boundary conditions. However, for certain microstructure types, nonperiodic boundary conditions are of interest. In this work, we show how to efficiently impose Dirichlet boundary conditions for FFT‐based micromechanics on stochastic bicontinuous microstructures in combinations with a linear conjugate gradient (CG) solver. Consequently, we compute the effective properties of bicontinuous stochastic microstructures and compare the results to values reported in the literature computed by a finite element (FE) code.