You negotiate a contract with the client that spells out what they are and are not allowed to do. This may e.g. give the client a nonexclusive license to run a limited number of installations for their purposes. Consider perpetual vs limited duration licenses. Consider what your obligations are, e.g. providing updates and support. There are many different licensing schemes, e.g. Oracle also likes to limit the number of CPUs per server where the software may be installed. In addition to licenses to run the software in production, it may be important to discuss licenses for testing purposes, e.g. local installations on a developer's machine.
Note that this kind of licensing is completely unrelated to open source licenses. You should therefore not use an open source license like MIT or GPL for your code because that would give your client far more rights than you are probably comfortable with. Instead, negotiate a contract.
There are many ways how you can get pulled over the barrel in these negotiations, so its important to have the contract checked by your lawyer before you sign. This gets cheaper the more clients you get because you can reuse previous contracts as a template.