I don’t know where you are located as far as climate. That will influence this quite a bit. When you start up, facilities costs can be pretty significant. You may never make enough money selling eggs to cover the initial cost. The closer you are to the equator generally the better off you are, you can go with cheaper, more open air builds. Or maybe you have a spare building that can be converted cheaply. For thousands of years small farmers have let their chickens totally free range at least during the day but they often lock them in a predator proof coop at night. Some let them sleep in trees at night but the predator risk is so much greater at night. It’s a pretty standard model to have them secured at night. That does not solve all the problems because practically any predator can hunt during the day but the risk is usually greater at night. Dogs are often a problem and they certainly hunt during the day.
Your greatest ongoing cost is food. If you are buying all they eat it can be really challenging to break even just from that cost, let alone start-up. For thousands of years those same small farmers pretty much let the chickens feed themselves during the good weather months and supplement the feed during the bad weather. Some people will tell you it won’t work, you just can’t do that. I grew upon one of those farms, it does work. But there is a huge limiting factor, what is the quality of the forage?
Those small farms did not keep everything neat and pretty like a back yard. The grass is not kept mowed and edged to perfection. There are plenty of places the grass and weeds are allowed to go to seed. There are usually large farm animals so the chickens scan scratch in the poop for all kinds of nice goodies. From March until butchering in October or November all our garden wastes and kitchen wastes went to the pigs, not the chickens. The garden was fenced to keep the chickens out. The chickens still had a lot of area with greatly varying forage to feed themselves during the good weather months. In winter we seldom had snow on the ground for very long at a time and they still found a lot to forage on. We did supplement their feed in winter, plus they scratched through the hay we fed to the cattle and horses for some good stuff to eat.
The amount of money out of our pockets to feed those chickens was zero if you don’t count the time we spent growing things for them to eat in winter. We got a lot of nice eggs from them. It’s hard to get much more cost effective than that. But this was not a commercial operation where we were selling a lot of eggs. We used all we got, if we did not eat all the eggs ourselves the excess went to the pigs.
Very few people on this forum can even think of doing something like this. Predators are a huge issue for most of us, even during the day, whether in the middle of suburbia or out in the country. Just one stray dog can do a tremendous amount of damage in a short time. Even a bigger issue, we generally don’t have the kind of forage the chickens can use to support themselves. If yours can forage for a lot of their feed you can reduce feed costs but each situation is pretty unique. Some people do make enough from egg sells to pretty much pay for the feed but profit is harder to come by. Still some people manage.