If you’re growing herbs in containers or raised beds, space is precious. It’s tempting to cluster everything together — rosemary next to basil, mint trailing over the edge, tomatoes in the bed right alongside. It looks great. The problem is that rosemary (Salvia rosmarinus) has very specific growing needs that put it at odds with a surprising number of popular garden plants.
Rosemary is a Mediterranean herb that thrives in full sun, warm temperatures, and well-draining, slightly dry soil. It’s drought-tolerant, low-maintenance, and perfectly suited to container and raised bed life — as long as its neighbors don’t undermine it. Plants that need rich soil, frequent watering, or high moisture create conditions that can cause rosemary to develop root rot, lose its fragrance and flavor, or simply decline and die.
Here’s a quick look at rosemary’s ideal growing conditions before we get into the bad neighbors.
Rosemary Growing Conditions in Containers and Raised Beds
Rosemary does best with six to eight hours of direct sun daily and warm temperatures between 55 and 80°F. It wants well-draining, sandy or loamy soil with a slightly acidic pH around 6.0 to 7.0. In containers, that means a mix amended with perlite rather than standard moisture-retaining potting soil. Let the soil dry out between waterings — overwatering is the fastest way to kill a potted rosemary. In raised beds, rosemary thrives in a dedicated spot where neighboring plants aren’t pulling in heavy irrigation.
Good companions in a container or raised bed setting include other Mediterranean herbs like thyme, oregano, and lavender — all of which share rosemary’s love of dry, sunny conditions. Now, here are the plants to keep on the other side of the garden.
For more on setting up the right container for your herbs, see our guide to Container Depth for Growing Herbs.
What Not to Plant with Rosemary
Mint
Mint is one of the most popular herbs for urban gardeners, and for good reason — it’s vigorous, useful, and almost impossible to kill. That vigor is exactly the problem when it comes to rosemary. Mint spreads aggressively, competing for space and nutrients that rosemary needs. More critically, mint likes consistently moist soil, while rosemary needs things to dry out between waterings. In a shared container, you simply can’t satisfy both plants. You’ll either drown the rosemary trying to keep the mint happy, or starve the mint of moisture trying to protect the rosemary. Give mint its own pot entirely — it’ll thank you for it, and so will your rosemary.
Basil
Basil and rosemary are kitchen staples that often end up planted together, which makes sense on a recipe level but not a gardening one. While basil does like full sun and similar soil pH, it needs consistent moisture to produce well. Rosemary wants the opposite — dry conditions between waterings. In a shared raised bed section or combination pot, one plant will always lose. Either the rosemary develops root rot from the extra watering basil demands, or the basil wilts and turns bitter from insufficient moisture. Keep them in separate containers where you can water each on its own schedule. If you’re a basil grower looking to get more from your plants, check out our guide on How to Grow Basil in a Pot on Your Patio.
Tomatoes
Tomatoes are the centerpiece of many backyard raised beds, and they share rosemary’s preference for full sun and slightly acidic soil — so planting them together seems logical. The watering needs tell a different story. Tomatoes need consistently moist, nutrient-rich soil to produce fruit, and they need it frequently. That level of irrigation is far more than rosemary can tolerate and will almost certainly cause root rot in the herb. Tomatoes also benefit from heavy feeding that would push rosemary toward soft, flavorless growth. If you’re growing tomatoes in your raised bed or in containers, give your rosemary its own dedicated pot nearby so it gets the sun without the soaking. See our post on Growing Tomatoes in Fabric Pots for tips on keeping your tomatoes thriving on their own terms.
Fennel
Fennel is one plant that causes problems for almost everything around it, and rosemary is no exception. Fennel releases allelopathic chemicals from its roots into the surrounding soil that can interfere with the growth of nearby plants, including rosemary. In a raised bed, where plants share close root space, this can result in stunted growth and reduced vigor in your rosemary. Fennel also prefers moist, fertile soil — exactly the conditions that rosemary struggles in. In a container garden, it’s easy to eliminate this problem entirely: simply don’t pot fennel anywhere near your rosemary. In a shared raised bed, keep fennel in its own dedicated section or a separate container altogether.
Cucumbers
Cucumbers are a favourite among backyard urban gardeners because they produce well in raised beds and large containers. But they are heavy water users and create a humid microclimate around their foliage — both of which are bad news for rosemary. The frequent irrigation cucumbers need is far more than rosemary can handle, increasing the risk of root rot. Cucumbers also benefit from nitrogen-rich soil and regular feeding, which can dull the fragrance and flavor of nearby rosemary. If you’re working with a steel or fabric raised bed and want to maximize your growing space, keep rosemary in a dedicated container on the side rather than sharing bed space with your cucumbers. Our guide to Best Steel Raised Beds can help you plan out separate growing zones.
Pumpkins
Pumpkins are a tough fit for most small urban gardens simply due to size, but if you’re growing them along a fence or at the edge of a backyard plot, keep them well away from your rosemary. Pumpkin vines spread aggressively and will crowd out smaller container plants and raised bed herbs without hesitation. They’re also moisture-loving and prone to powdery mildew, which can spread to neighboring plants. The damp environment pumpkins create around their root zone is precisely the kind of conditions that cause rosemary to develop root rot and fungal problems. In a small backyard setting, pumpkins and rosemary should be treated as entirely separate growing zones.
What to Grow with Rosemary Instead
In a container or raised bed, rosemary’s best companions are other Mediterranean herbs that share its low-water, full-sun preferences. Thyme, oregano, lavender, and sage all thrive under similar conditions and won’t pull your rosemary into a watering compromise. Compact varieties of these herbs can even share a large container or a dedicated section of a raised bed, creating a fragrant, low-maintenance Mediterranean herb corner that practically takes care of itself.
If you’re planning out a more self-sufficient backyard growing setup, our post on Backyard Self-Sufficiency is a good place to think through how to zone your space so each plant gets exactly what it needs.
The bottom line: rosemary is one of the most rewarding herbs you can grow in a small urban space, but it needs neighbors that respect its dry, sunny comfort zone. Get the companion planting right, and it will thrive in your containers and raised beds for years.



