Bacterial microcompartments, BMCs, are proteinaceous organelles that encase a specific metabolic pathway within a semi-permeable protein shell. Short encapsulation peptides can direct cargo proteins to the lumen of the compartments. However, the fusion of such peptides to non-native proteins does not guarantee encapsulation and often causes aggregation. Here, we report an approach for targeting recombinant proteins to BMCs that utilizes specific de novo coiled-coil protein–protein interactions. Attachment of one coiled-coil module to PduA (a component of the BMC shell) allows targeting of a fluorescent protein fused to a cognate coiled-coil partner. This interaction takes place on the outer surface of the BMC. The redesign of PduA to generate an N-terminus on the luminal side of the BMC results in intact compartments to which proteins can still be targeted via the designed coiled-coil system. This study provides a strategy to display proteins on the surface or within the lumen of the BMCs.