This work addresses the problem of the design and balancing of a modular multi-product line in a reconfigurable environment. The study emphasizes the importance of modularity in the reconfigurable manufacturing systems (RMS), which allows fast, efficient, and cost-effective adaptation to changes by rearranging, moving, or removing modules. The line consists of a fixed number of modular machines arranged linearly and connected by a material handling system. Each machine has a limited number of slots for modules. The line can handle several product types per batch, and each batch requires a specific line configuration to be produced. The objective consists in identifying the minimum number of modules needed and their arrangement in different configurations to produce each product type. To solve this problem, a compact integer linear programming (ILP) formulation is initially investigated. Then an ILP reformulation, based on a decomposition approach, as well as a heuristic that uses this ILP reformulation are developed. The results demonstrate the effectiveness of the proposed methods.