Collective motion, where large numbers of individuals move synchronously together, is achieved when individuals adopt interaction rules that determine how they respond to their neighbors' movements and positions. These rules determine how group-living animals move, make decisions, and transmit information between individuals. Nonetheless, few studies have explicitly determined these interaction rules in moving groups, and very little is known about the interaction rules of fish. Here, we identify three key rules for the social interactions of mosquitofish (Gambusia holbrooki): (i) Attraction forces are important in maintaining group cohesion, while we find only weak evidence that fish align with their neighbor's orientation; (ii) repulsion is mediated principally by changes in speed; (iii) although the positions and directions of all shoal members are highly correlated, individuals only respond to their single nearest neighbor. The last two of these rules are different from the classical models of collective animal motion, raising new questions about how fish and other animals self-organize on the move.