This article formulates a deterrence theory of punishment based on Lockean premises. Following authors such as Warren Quinn and Daniel Farrell, it is claimed that a justification for the right to punish must be built upon the recognition of the importance of a right to issue retaliatory threats. Contrary to those authors, however, the articulation of such recognition is made within a Lockean theory of individual rights. This allows us to appreciate the specific role deterrence has in a plausible conception of punishment, and thus address certain objections that have been formulated recently, especially by David Boonin.