Let's start by saying this: You can grow garlic indoors, but you won’t get a head of garlic as you would when you plant cloves in the garden. What you'll get will be garlic sprouts or greens, the green tops of a bulb (much like what happens when a bulb sprouts on your kitchen counter). These greens are not the same as green garlic, which is early spring garlic or immature garlic bulbs and their edible green stalks. They are still quite delicious and can be used as seasoning or garnish. Their flavor is lighter and gentler than that of fresh garlic.
To grow garlic greens indoors: Plant three or four cloves in a pot filled with potting soil. Sit them on a sunny window ledge and water them lightly. The garlic greens will grow in just 7 to 10 days and can be snipped.
If you plan to have garlic greens on hand, you’ll need to keep up with planting new cloves in succession as the cloves will be exhausted once they have grown the greens.
To grow entire heads of garlic, you’ll need to plant outdoors because like other bulbs (think onions and daffodils), they need the cold winter dormancy to produce the scape (flower) and generate a head.