This species lives in coral reefs, from the surface to 65 m depth. It can also be found in harbours, lagoons and on the outer slopes of reefs.
Adults form pairs and are territorial when breeding. It is one of the few species whose larvae do not live in the open water and whose fry are kept by the parents. They remain near the spawning site for several weeks or even months before dispersing. This fish gathers in shoals as it grows.