With the advent of device-independent quantum information processing, nonlocality is nowadays regarded as a resource that can be used for various tasks. Using the analogy of entanglement theory, we approach nonlocality from this perspective. In order to do so, we analyze in full detail the operations that can be implemented in this scenario and under which nonlocality cannot increase. This provides a theoretical basis from which to study how to order and quantify nonlocal behavior. Finally, we review several nonlocality measures and discuss their validity from this point of view.This article is part of a special issue of Journal of Physics A: Mathematical and Theoretical devoted to ‘50 years of Bell's theorem’.