you’re growing it in a container beside a doorway, choose the sunniest practical position.
Use Well-Draining Soil
Poor drainage is one of rosemary’s biggest problems.
The plant prefers soil that allows excess water to escape easily. Sandy or gritty soil can work well, while heavy, constantly wet soil can increase the risk of root problems.
Planting
When planting outdoors, choose a suitable time for your local climate and avoid periods when severe frost is expected.
If planting several rosemary bushes, give them enough space for air circulation and mature growth.