Police noticed the strong smell of cannabis when they called at a Watford home on a different matter.
They arrested Daniel Evans, 32, and in a search found six containers full of skunk, St Albans crown court heard today.
Prosecutor Sally Mealing-McLeod said police went to Evans' home on June 9. She said the 192 grams of skunk cannabis would have a street value of £1,920.
When questioned, Evans told the officers he had been growing cannabis for the past six months for his own personal use. But, in a basis of plea put to the court, he admitted he was going to sell some of it.
Evans, of Stratford Road, Watford, pleaded guilty to being concerned in the production of cannabis. He had no previous convictions for drugs but had received two cautions for drug possession, in 1998 and 1999.
Richard Germain, defending, said: "Mostly he was growing the drug for his own use, but he accepts some of the cannabis was to be supplied.
"He has learnt his lesson. The arrest came as a shock. He is no longer involved in drugs and has a child on the way in February."
Recorder Tim Clark passed a 12 month community order with 80 hours' unpaid work. He must abide by a 7pm to 7am curfew for two months and pay £200 costs.
The judge told him: "I hope the courts don't see you again."