Professionally farming maggots: how to create an ideal growing environment?

Some of the world's biggest problems include managing organic waste and producing sufficient livestock feed. Luckily, there's an innovative solution that solves these two problems simultaneously.
In the past we've already discussed mealworm farming in this blog, now it's time for maggot farming. We're talking about the larvae of the black soldier fly (BSF), also known by its scientific name Hermetia illucens.
Farming the maggots of the BSF is a sustainable way to produce protein-rich livestock feed from organic waste, with organic fertiliser as a byproduct, in two to three weeks. The larvae can be fed to poultry, pigs, and fish without danger.
Just like mealworms, the BSF larvae need a specific growing environment to thrive. This blog will help you determine the ideal growing set-up, focusing on the importance of remote monitoring of environmental parameters like CO₂, temperature, and relative humidity (RH).
Egg laying
Every larva starts as an egg, which is why it's also important to note the key factors to ensure good ovipositioning of the adult flies. The optimal temperature for egg laying is 27.5°C to 37.5°C and relative humidity of 60%, while an environment with RH of 70% may increase the survival rate of adult flies by two to three days (Salam et al., 2022).
Adult flies need sufficient daylight to mate for egg production. Sunlight with an intensity of ol m2 s−1 is required for almost 85% of mating events. The lack of natural daylight during the winter directly affects the lower mating rates in this season. Artificial light may be generated with quartz iodide lamps producing a wavelength between 450 and 700 nm (Salam et al., 2022).
Light can be measured with lux meters, as is done in poultry houses or pigsties.

Sufficient fresh air
Larvae need sufficient oxygen to reach optimal growth rates, which is why CO₂ measuring is important during BSF farming. BSF rearing also emits CO₂ in proportion to larval growth, so tracking it is a good proxy for overall activity.
“Increasing aeration from 0.04 to 0.36 mL min−1 g dry weight−1 tripled the harvest dry weight of larvae and increased yield by a factor of five. Increasing aeration beyond 0.36 mL min−1 g dry−1 did not significantly change either the harvest weight of larvae or yield.” - Palma et al. (2018)
Rearing the larvae in substrates that don't allow for sufficient oxygen diffusion can lead to suffocation of the maggots. Ensure that there is always sufficient ventilation to prevent this. CO₂ sensors can come in use to track the levels in your growing room. They can even send out alarm notifications if the CO₂ levels become dangerously high (900 ppm). This allows for immediate action. Ammonia sensors, too, might be useful for monitoring your set-up as prelonged ammonia exposure of 20 ppm is too high for the BSF and 50 ppm is too high for immediate exposure.
Humidity for maggot farming
Relative humidity levels ranging from 70 to 75% are ideal for BSF larvae growth, low RH may even increase the mortality rate of the larvae as they can dehydrate. Overly moist environments, on the other hand, come with their own issues: suffocation. Larvae breathe through the pores of their exoskeleton, which becomes increasingly difficult in wet environments.
A temperature and humidity sensor is a great way to monitor these parameters.
Substrate moisture levels
The moisture levels of the substrate (organic waste) the larvae are in should also be measured (for the same reasons as described previously). We don't want our larvae to dry out or suffocate. The ideal range is 60-70%.
A volumetric soil moisture sensor like the SMT100 is ideal to measure substrate moisture levels.
Temperature for maggot breeding
The BSF maggots prefer temperatures from 27°C to 35°C.
A 2019 study by Joshua Villazana and Andrei Alyokhin reports that about 92% of larvae will survive after 72 hours in the refrigerator at 4°C, but that temperatures this low are not ideal for larvae rearing. Another study shows that temperatures beyond 47°C are fatal too. A temperature sensor helps you accurately measure and monitor temperatures in your BSF rearing set-up.

Avoid sunlight
Larvae of the black soldier fly hate bright light (they're photophobic), which is why the growing environment of the maggots should be kept rather dark.
pH should not be acidic
BSF larvae reach optimal growth and development at pH levels of six and higher. This means that the maggots prefer neutral and alkaline environments over acidic ones.
How do maggots grow?
Producers typically rear in shallow, stackable trays on nutrient-rich substrates (e.g., agri-food side-streams). Larvae feed and bulk up, then wander off-feed (prepupae) before pupating. Keep tray depth modest (≈4–10 cm) to prevent heat build-up and ensure oxygen penetration.
What is essential when breeding maggots?
If you want to get started as a professional BSF breeder, you will need the necessary materials. These include:
- A dark grow room with temperature control, a ventilation and humidity control system.
- Stackable growing trays that are easy to clean and allow for drainage, such as plastic trays.
- A workflow to separate life stages and harvest prepupae efficiently.
- A trolley to move stacks of culture trays.
- A high-pressure washer to keep the grow room hygienic.
- A shredder to process coarse food for the larvae.
- Hygiene materials (wash-down cart, disinfectants), scales, and sieves.
- A sensor module that measures CO₂, temperature and relative humidity, such as Reporter.
Remote monitoring
Four variables dominate maggot farming efficiency: CO₂, room humidity, room temperature, and substrate moisture. It is impossible to manually check these parameters. Remote monitoring is therefore a good solution to keep a live eye on what is going on in your growing room. Even more convenient is to receive alarm notifications when a maximum or minimum value is to be exceeded.
In short: you must be able to monitor live and receive automated alarm notifications. In other industries, like livestock farming, monitoring these parameters is equally important. The monitoring of ventilation systems in poultry houses or suffocation prevention in pigsties, for example. For these cases Crodeon developed a plug & play system called Reporter.
Maggot farming with the aid of Reporter
Pair Reporter with our CO₂ sensor (CO₂ + temperature + RH in one) and watch all your measurements in real-time on the Crodeon Dashboard. You can add more sensors later via Reporter's other connectors. Data streams to the cloud and is stored for analysis and audits or our REST API connection to your own systems.
Live data monitoring and intervention
Through the Crodeon Dashboard you can monitor the CO2 levels, humidity and temperature in your grow room in real-time. When a set limit on a parameter is exceeded you're sure to be notified through an alarm message per email or phone. In addition, all data is also collected and saved. This allows you to see how farming maggots can be made even more efficient in the future.
With the relay control module you can remotely operate heating, cooling, ventilation or humidification by switching it on or off. You will then be able to monitor in real-time whether the maximum or minimum exceedance of your set values resolves itself.
This screenshot shows the Crodeon Dashboard with graphs for relative humidity, temperature and CO2 (in two different rooms). (Crodeon, 2022)
Farming maggots in the most modern way
Do you want to optimise growth, cut losses and manage your rooms remotely? Start using Reporter, or explore our solutions for Smart Livestock.
Curious how it looks? Start for free in the live demo. Or just reach out!

Sources
- Rossi, G., Ojha, S., Berg, W., Herppich, W. B., & Schlüter, O. K. (2024). Estimating the dynamics of greenhouse gas emission during black soldier fly larvae growth under controlled environmental conditions. Journal of Cleaner Production, 470, 143226.
- Palma, L., Ceballos, S. J., Johnson, P. C., Niemeier, D., Pitesky, M., & VanderGheynst, J. S. (2018). Cultivation of black soldier fly larvae on almond byproducts: impacts of aeration and moisture on larvae growth and composition. Journal of the Science of Food and Agriculture, 98(15), 5893–5900.
- Salam, M., Shahzadi, A., Zheng, H., Alam, F., Nabi, G., Dezhi, S., Ullah, W., Ammara, S., Ali, N., & Bilal, M. (2022). Effect of different environmental conditions on the growth and development of Black Soldier Fly Larvae and its utilization in solid waste management and pollution mitigation. Environmental Technology & Innovation, 28, 102649.
- Bob Holtermans. (2022, October 26). Q&A: What are the best humidity levels for farming BSF? Insect School.
- Nakyanzi, L. (2024, December 13). Harvesting black soldier fly larvae. Kimd Group of Companies.
- Villazana, J., & Alyokhin, A. (2019). Tolerance of immature black soldier flies (Diptera: stratiomyidae) to cold temperatures above and below freezing point. Journal of Economic Entomology, 112(6), 2632–2637.
- Chia, S. Y., Tanga, C. M., Khamis, F. M., Mohamed, S. A., Salifu, D., Sevgan, S., Fiaboe, K. K. M., Niassy, S., Van Loon, J. J. A., Dicke, M., & Ekesi, S. (2018). Threshold temperatures and thermal requirements of black soldier fly Hermetia illucens: Implications for mass production. PLoS ONE, 13(11), e0206097.
More information about ammonia emission by BSF farming can be found here:
Coudron, C., Berrens, S., Van Peer, M., Deruytter, D., Claeys, J., & Van Miert, S. (2024). Ammonia emissions related to black soldier fly larvae during growth on different diets. Journal of Insects as Food and Feed, 10(8), 1469–1483.
Boakye-Yiadom, K. A., Ilari, A., & Duca, D. (2022). Greenhouse Gas Emissions and Life Cycle Assessment on the Black Soldier Fly (Hermetia illucens L.). Sustainability, 14(16), 10456.