In general, buying a farm in Spain is a process more complex than purchasing a rural property here since, in addition to the usual due diligence required to buy a rural property, other legal matters have to be considered.
Such legal considerations will vary according to the kind of livestock included in the sale: pigs, chickens, calves, sheep, hens, turkeys, ducks, cows or housing milk goats, among others.
Just as in any other business, in order to be able to open an industrial farm, you are required to have certain permits. The most important one is registration in the Exploitation Registry of the Autonomous Community where the farm is located; this registration is identified by a registry number.
It is essential that the farm you wish to purchase has this registry number as, otherwise, you will not be purchasing a working farm but just buying a property in Spain with animals that cannot be used to produce any livestock product.
Buying a farm in Spain: not for the faint hearted!
Likewise, the holder of the livestock farm has to complete some courses to be allowed to apply and use the necessary products to disinfect the stalls where the animals are kept. Also, it is always necessary to count on a professional to manage the solid and liquid wastes produced by such animals.
Wastes are very important in farming, as there are many ways to ruin the soils and waters. Farming is a responsibility.
As regards the administrative arrangements, it is compulsory to register as self-employed by choosing the appropriate tax classification in the Spanish Tax Office (Hacienda), plus VAT and IRPF (Personal Income Tax).
An alternative way could be to set up a company, whether private or public limited, single-member, partnership, etc.; although in most cases it is requested that the company is formed by several people to be able to establish it.
It is not our place to say whether or not such a purchase is appropriate for foreigners buying a property in Spain. However, while it is certainly very appealing to an important subsection of all foreign buyers of property here, there is no doubt that it is a lot more complex and, much more difficult to dispose of if the lifestyle is not to your liking. Caveat emptor!