A multichannel CO2 laser interferometer is planned for electron density profile measurements in the Wendelstein 7-X stellarator under construction. This article describes the mathematical methods used to find the optimum orientation of the various sightlines. The problem of reconstructing local densities from line integrated density measurements can be formulated as a matrix inversion. The quality of the reconstruction is largely determined by the condition number of the matrix describing the problem, which has to be minimized, i.e., the sightlines have to be chosen such that the information content of different channels is maximally distinct. For the W7-X interferometer four-and eight-sightline arrangements are investigated and their orientations are optimized for standard conditions of magnetic configuration and density profile. The optimized arrangements are tested by simulating the inversion of hypothetical reference density profiles in a number of different magnetic configurations. In the ideal case the error of a reconstruction using four sightlines is typically a few times larger than that with eight sightlines. The robustness of the optimization is demonstrated by a variation of the position of the whole interferometer, and the influence of noisy phase data on the reconstructed profiles is investigated. These factors significantly narrow the difference between the four- and eight-beam setups. Finally, the use of regularization methods for the analysis of experimental data is briefly discussed.