We show how a lattice-Boltzmann approach can be extended to ternary fluid mixtures with the aim of modeling the diverse behavior of oil–water-surfactant systems. We model the mixture using a Ginzburg–Landau free energy with two scalar order parameters which allows us to define a lattice-Boltzmann scheme in the spirit of the Cahn–Hilliard approach to nonequilibrium dynamics. Results are presented for the spontaneous emulsification of an oil–water droplet and for spinodal decomposition in the presence of a surfactant.