By Azura · Updated June 2026 · Raised Garden Hub is reader-supported. When you buy through links on our site, we may earn an affiliate commission at no extra cost to you.

Tomatoes are the star of most raised beds — and they grow better with the right neighbors. Companion planting works by using plant diversity to break up pest habitat, attract beneficial insects, and fill space that would otherwise go to weeds. Done right, it turns a single-crop bed into a small ecosystem.

Why companion planting works

A monoculture — one crop, row after row — makes life easy for pests. They find the food, multiply, and spread. A mixed planting disrupts that pattern. Pests have trouble locating hosts when the surrounding smell and color is different. Flowering companions attract predatory insects like ladybugs and hoverflies that feed on aphids and caterpillar eggs. Ground-level plants suppress weeds and keep soil moisture steady.

None of this is magic, and companion planting won’t replace good watering, quality raised bed soil, or proper spacing. Think of it as one more tool — a low-cost way to add resilience to a bed you’ve already invested in.

Rule of thumb: if a companion is flowering, it’s probably helping — draw in pollinators and pest predators before your problems start.

Best companions for tomatoes

Basil

Basil is the classic tomato companion for good reason. The aromatic oils in its leaves appear to deter aphids, thrips, and whiteflies. It’s also a fast grower you can harvest throughout the season. Plant it 12–18 inches from your tomato stem and pinch the flower heads regularly so it doesn’t bolt and go woody. One or two plants per raised bed is plenty.

Marigolds (French marigolds especially)

French marigolds (Tagetes patula) are one of the few companion plants with consistent research support. Their roots produce a compound called alpha-terthienyl that suppresses root-knot nematodes — microscopic soil worms that damage tomato roots and are nearly impossible to see until the plant is struggling. Above ground, marigolds attract aphid predators and their orange blooms are easy color in any bed. Plant them around the perimeter or between tomato plants.

Nasturtiums

Nasturtiums are a trap crop: aphids prefer them over tomatoes, so they draw the pests away and concentrate them where you can deal with them (blast with water, or just remove the infested nasturtium). Both the flowers and leaves are edible, so you get a side benefit. They also spread low, which makes them a good fill for bare corners of a raised bed.

Carrots and lettuce

These two are worth growing together with tomatoes for pure space efficiency. Carrots grow deep and don’t compete much at the surface. Lettuce stays small and loves the partial shade that tomato foliage provides as the season heats up — a classic companion-planting trick for extending your cool-season crops. Check the raised bed plant spacing chart to make sure you’re not crowding roots.

Alliums — garlic, onions, and chives

Garlic, onions, and chives all produce sulfur compounds that confuse and deter many flying pests, including some aphid species. They’re shallow-rooted, so they fit easily along the edges of a raised bed without competing with tomato roots. Chives also flower in a way that attracts pollinators and predatory insects. Garlic is worth planting in fall for harvest the following summer — it takes up almost no space in a tomato bed.

Borage

Borage is underused in raised beds. It produces small blue star-shaped flowers that attract bumblebees and hoverflies throughout the season. Hoverfly larvae are voracious aphid predators. One borage plant per bed is enough; it can get large, so keep it to one corner where it won’t shade smaller plants.

Plants to keep away from tomatoes

Brassicas

Cabbage, broccoli, kale, cauliflower, and brussels sprouts are all heavy feeders that compete directly with tomatoes for nitrogen and other nutrients. They also attract cabbage loopers and other caterpillars that will happily move over to your tomatoes. Keep brassicas in a separate bed or section of the garden.

Fennel

Fennel is allelopathic — it releases root chemicals that stunt or kill many neighboring plants, including tomatoes. It also has a habit of cross-pollinating with dill, which is another common garden herb. Give fennel its own container or a corner far from your raised beds.

Potatoes

Tomatoes and potatoes are in the same family (Solanaceae) and share their most serious disease: late blight (Phytophthora infestans). If blight hits one, it can jump to the other quickly. Keep them physically separated, ideally in different parts of the garden. This is also worth keeping in mind when you rotate crops year to year — don’t follow a tomato crop with potatoes in the same bed. If you’ve had blossom end rot or other tomato problems, rotating out of the nightshade family entirely for a season is the right call.

Corn

Corn and tomatoes share a common pest: the corn earworm and the tomato fruitworm are the same moth (Helicoverpa zea). Plant them near each other and you’re effectively doubling the attractant. In a small raised bed, corn is also a poor use of space — it needs to be planted in blocks of at least 4 for wind pollination and it grows too tall to share sun well with tomatoes.

Black walnut

If your garden is near a black walnut tree, be aware that walnut roots release juglone, a chemical that is toxic to tomatoes and several other garden plants. This can extend well beyond the canopy of the tree. Raised beds provide some protection, but if you’re seeing unexplained tomato decline near a walnut, juglone toxicity is worth considering.

A raised-bed layout that works

For a standard 4×4 raised bed, put one tomato (use a determinate or compact variety — indeterminate types need a dedicated 4×4 or larger) in the center with a cage in place from planting day. Ring the tomato with two or three basil plants and a couple of French marigolds along the edges. Tuck lettuce into the shadier side and carrots along one border. A single nasturtium in a corner handles the trap-crop role.

If you’re working with a larger bed, you can fit two tomatoes and add a garlic or chive border around the perimeter. Use the raised bed size calculator to plan how many plants actually fit before you buy.

For deeper help choosing a bed that’s the right depth and material for tomatoes, see how deep a raised garden bed should be — tomatoes need at least 12 inches of soil depth, and 18 is better for robust root development.

If you’re just getting started, the raised bed gardening for beginners guide covers everything from bed setup to first harvest, and the planting calendar tells you when to get transplants in the ground in your region.

The short version

Good tomato companions — basil, marigolds, nasturtiums, carrots, lettuce, alliums, borage — do real work. They deter pests, attract beneficial insects, and fill your raised bed space efficiently. Bad neighbors — brassicas, fennel, potatoes, corn — compete, spread disease, or invite the same pests you’re trying to avoid. A little planning at the start of the season saves a lot of trouble later.

Frequently asked questions

What should you not plant near tomatoes?

Avoid brassicas (cabbage, broccoli, kale), fennel, potatoes, and corn. Brassicas compete heavily for nutrients, potatoes share late blight disease, fennel releases root chemicals that stunt nearby plants, and corn attracts the same caterpillar — the corn earworm is the same species as the tomato fruitworm. Black walnut trees also poison tomatoes through the chemical juglone, so don't plant within their root zone.

Can tomatoes and basil grow together?

Yes — basil is one of the most popular tomato companions. It's easy to grow in the same bed, and many gardeners report that the oils in basil leaves deter aphids and whiteflies. Whether basil actually improves tomato flavor is debated, but there's no downside to planting them together. Keep basil from shading itself out by trimming flower heads regularly.

Do marigolds really help tomatoes?

Marigolds (especially French marigolds, Tagetes patula) have solid evidence behind them. Their roots release a compound that suppresses soil nematodes, which are microscopic worms that damage tomato roots. They also deter aphids and attract hoverflies that prey on pests. Plant them at the border of your raised bed or between tomato plants for best effect.

What are the best companion plants for tomatoes in a raised bed?

In a raised bed, the most practical companions are basil, French marigolds, nasturtiums, carrots, lettuce, and garlic or chives. These plants either deter pests, attract beneficial insects, or use vertical and horizontal space efficiently without competing with tomatoes for light and nutrients. Nasturtiums work especially well as a trap crop around the bed edges.

Can you plant tomatoes and peppers together?

You can, since they have similar water and sun needs, but it's not ideal. Both are in the nightshade family, which means they share pests and diseases. If one plant gets early blight or aphids, it can spread quickly to the other. In a small raised bed, you're better off using that space for companions from a different plant family.

How far apart should companion plants be from tomatoes in a raised bed?

Basil and marigolds can go as close as 12 inches from the tomato stem. Carrots and lettuce fill the ground-level space underneath the canopy and don't need much clearance. Garlic and onions can ring the bed perimeter. The key is making sure companions don't shade the tomato's lower leaves or compete directly at the root zone — raised bed spacing is naturally tighter, so stick to low or shallow-rooted companions.