Plant basil, marigolds, thyme, and onions alongside eggplant for pest control and better growth

Eggplant grows best when planted near herbs and vegetables that repel its main pests or improve soil conditions without competing for space. Basil is the strongest companion—it repels spider mites and flea beetles, the two insects that damage eggplant most often. Marigolds deter nematodes in the soil and whiteflies. Thyme and onions both repel spider mites and take up minimal root space. These four are the practical choices for a raised bed because they grow at different heights and don't shade the eggplant or steal water and nutrients it needs.

The reason companion planting works in a raised bed is that you control the soil depth and spacing precisely. Eggplant roots go down 12 to 18 inches and spread sideways about 18 inches from the stem. Shallow-rooted herbs like basil and thyme stay in the top 6 inches, so they don't compete. Onions and marigolds have moderate root systems that sit beside rather than under the eggplant. In a traditional garden bed, these plants might shade each other or dry out the soil faster; in a raised bed with good drainage and consistent watering, they coexist without stress.

Key Takeaways

  • Basil planted 12 inches from eggplant repels spider mites and flea beetles, the two pests that cause the most damage to eggplant leaves and fruit.
  • Marigolds reduce nematode populations in the soil and deter whiteflies, and they bloom continuously through the growing season without needing extra water.
  • Thyme and onions both repel spider mites and have shallow or narrow root systems that don't interfere with eggplant's deeper roots.
  • Space basil and thyme 12 inches away from the eggplant stem, and plant onions and marigolds 18 inches away to prevent shading and allow air circulation.
  • Avoid planting fennel, kohlrabi, or brassicas (cabbage, broccoli, kale) near eggplant because they compete for the same nutrients and attract overlapping pests.

Basil as your primary companion plant

Basil is the single most useful plant to grow with eggplant because it addresses the two problems eggplant growers face most: spider mites and flea beetles. Spider mites create fine webbing on the undersides of leaves and cause yellowing and spotting; flea beetles chew small round holes in young leaves. Basil's strong aromatic oils repel both insects. Plant basil 12 inches away from the eggplant stem, either in the same raised bed or in a pot nearby if space is tight.

Basil also grows quickly and produces leaves you can harvest throughout the season, so it pays for itself in the kitchen. It prefers the same watering schedule as eggplant—consistent moisture without waterlogging—and thrives in the same warm-season window (late spring through early fall). If you grow only one companion plant, basil is the one to choose. Plant it from seed or transplant after the last frost date, at the same time you plant eggplant.

Marigolds for soil health and whitefly control

Marigolds serve two purposes in a raised bed with eggplant: they reduce harmful nematode populations in the soil, and they repel whiteflies, which cluster on the undersides of eggplant leaves and weaken the plant by feeding on sap. Marigolds release compounds from their roots that nematodes avoid, so they actually improve the soil for next season's crops. Plant them 18 inches from the eggplant stem so they don't shade it as they grow.

Marigolds are extremely low-maintenance. They tolerate poor soil, need minimal water once established, and bloom continuously from planting until frost. They don't require fertilizer and don't compete with eggplant for nutrients. You can deadhead spent flowers to encourage more blooms, but it's not necessary. Plant marigold transplants at the same time as eggplant, or direct-seed them two weeks after the last frost date.

Thyme and onions for spider mite prevention

Thyme is a shallow-rooted perennial herb that repels spider mites and takes up almost no space in a raised bed. Plant it 12 inches from the eggplant stem. It grows only 6 to 12 inches tall and wide, so it won't shade the eggplant, and its roots stay in the top 6 inches of soil while eggplant roots go much deeper. Thyme is drought-tolerant once established, so it won't compete for water. You can harvest leaves throughout the season for cooking.

Onions (including scallions and bunching varieties) also repel spider mites and have narrow root systems that don't interfere with eggplant. Plant them 18 inches from the eggplant stem. Onions mature in 60 to 120 days depending on the variety, so you can harvest them before the eggplant reaches full size, freeing up space if needed. They require the same moderate watering as eggplant and don't need extra fertilizer. Plant onion sets or transplants at the same time as eggplant, or direct-seed them two weeks before.

Plants to avoid near eggplant

Fennel, kohlrabi, and brassicas (cabbage, broccoli, kale, cauliflower) should not be planted in the same raised bed as eggplant. Fennel releases compounds that inhibit the growth of many plants, including eggplant. Kohlrabi and brassicas compete with eggplant for nitrogen and potassium, and they attract some of the same pests—particularly flea beetles and cabbage moths—so planting them together increases pest pressure on both crops.

Potatoes and tomatoes are also poor companions for eggplant because all three are nightshades that attract the same pests and diseases, particularly early blight and spider mites. If you grow tomatoes or potatoes in a different raised bed, keep them at least 3 feet away from eggplant, or plant them in different seasons.

Spacing and layout for a typical raised bed

A standard 4-by-8-foot raised bed can hold one eggplant plant with room for companions. Place the eggplant in the center or toward one end, leaving 18 inches of space on all sides. Plant basil 12 inches away on one side, thyme 12 inches away on another side, and marigolds or onions 18 inches away at the corners or edges. This arrangement gives each plant enough light, air circulation, and root space without crowding.

If your raised bed is smaller (3 by 3 feet or 2 by 4 feet), choose two companions instead of four: basil and marigolds are the most effective pair. If your bed is larger or you're growing multiple eggplants, space each eggplant 24 inches apart and surround each one with basil and marigolds. Water the entire bed evenly; don't water individual plants, because the roots of companion plants will benefit from the moisture meant for eggplant and vice versa.

Timing and planting order

Plant eggplant, basil, marigolds, and onions at the same time, after the last frost date in your area. Thyme can go in earlier if you're using transplants, because it's more cold-tolerant than eggplant. If you're starting from seed, sow basil and marigolds indoors 6 to 8 weeks before the last frost date, and transplant them out at the same time as eggplant. Onions can be planted from sets (small bulbs) or transplants; direct-seeding onions takes longer and is less reliable in a raised bed.

Eggplant needs warm soil to germinate and grow, so wait until soil temperature reaches 60°F (ideally 70°F or warmer) before planting. In most regions, this means late May or early June. If you start eggplant from seed indoors, sow 8 to 10 weeks before your target transplant date. Basil, marigolds, and onions are more flexible and can go in as soon as the soil is workable, but they'll grow faster if you wait until the soil is warm.

Frequently Asked Questions

Can I plant eggplant with peppers in the same raised bed?

Peppers and eggplant are both nightshades and attract similar pests, particularly spider mites and flea beetles. Planting them together increases pest pressure on both crops. If you want to grow both, use separate raised beds or space them at least 3 feet apart in the same bed.

How close can basil grow to eggplant without shading it?

Basil grows 12 to 18 inches tall and doesn't shade eggplant if planted 12 inches away from the stem. Eggplant grows taller and bushier, so it will shade basil slightly, but basil tolerates partial shade and will still repel pests. If basil gets too shaded, harvest it regularly to encourage bushier growth and more leaf production.

Do I need to fertilize companion plants separately from eggplant?

No. Basil, thyme, marigolds, and onions all thrive in the same soil conditions as eggplant and don't need extra fertilizer. If you fertilize the eggplant, the companion plants will benefit from the nutrients. Avoid over-fertilizing with nitrogen, because it encourages leafy growth at the expense of eggplant fruit production.

What if I don't have space for all four companion plants?

Basil and marigolds are the most effective pair. If you can fit only one, choose basil for pest control. Thyme and onions are useful but less critical; they're good additions if you have the space, but eggplant will grow well without them.

Can I plant companion plants after eggplant is already growing?

Yes, but it's better to plant them at the same time. If eggplant is already established, wait until it's at least 6 inches tall and has several true leaves before planting basil or other companions nearby. Avoid disturbing eggplant roots when you dig holes for companion plants; plant at least 12 inches away from the eggplant stem.