No person shall erect, occupy or use for a stable any building in a city, or in a town having more than five thousand inhabitants, unless such use is licensed by the board of health, and, in such case, only to the extent so licensed. The fee for such licenses shall be established in a town by town meeting action and in a city by city council action, and in a town with no town meeting by town council action, by adoption of appropriate by-laws and ordinances to set such fees, but in no event shall any such fee be greater than forty dollars. This section shall not prevent any such occupation and use authorized by law on May fourth, eighteen hundred and ninety-five, to the extent and by the person so authorized, but the board of health of such a city or town may make such regulations or orders as, in its judgment, the public health requires relative to drainage, ventilation, size and character of stalls, bedding, number of animals and storage and handling of manure in any stable in its city or town.
Mass. Gen. Laws ch. 111, § 155