We develop a nonlinear theory for self-modulation of a circularly polarized electromagnetic wave in a relativistic hot weakly magnetized electron-positron plasma. The case of parallel propagation along an ambient magnetic field is considered. A nonlinear Schrodinger equation is derived for the complex wave amplitude of a self-modulated wave packet. We show that the maximum growth rate of the modulational instability decreases as the temperature of the pair plasma increases. Depending on the initial conditions, the unstable wave envelope can evolve nonlinearly to either periodic wave trains or solitary waves. This theory has application to high-energy astrophysics and high-power laser physics.CONICyTFONDECyT 1110135 1080658Brazilian agency CNPqBrazilian agency FAPESPMarie Curie International Incoming Fellowshiphospitality of Paris ObservatoryInstitute for Fusion Studie