Removable massage modules provide a mattress with a massage function. The mattress is compressed and shipped in a packing box with the massage modules separate from the mattress. The end customer then inserts the massage modules. The mattress has a bottom foam layer with cavities whose walls are perpendicular to the outer surface of the foam layer. Each massage module includes a massage motor encased in molded foam. The molded foam is attached to a foam section with cylindrical holes that pass from an outer side to the molded foam and allow hot air to escape the massage motor. The top and bottom sides of each massage module have the shape formed by the walls of the cavities. The massage modules are connected by power cords to a module controller that receives RF signals from a remote control device. The massage modules can also be inserted into a mattress topper.