The shape derivative of the flux cost functional in a Bernoulli-type problem is derived under mild regularity assumptions on the solution of the state problem.