There's no need to let space limitations prevent you from growing your own fruit, vegetables and herbs -- even if your space is just a patio or balcony.

Most plants will grow in containers, provided the environment, soil, sunlight and pots match the plants' needs. But planning is essential.

What do you like to eat? What are the environmental conditions in your space? How can you best use that space? Does it have sufficient light? Can you avoid taller plants shading shorter ones?

Your water source also is a consideration. Is there a spigot nearby, or will you be hand watering? Can you set up a drip system for when you are away, or will you need someone to water your plants then?

The answers to these questions help determine the type of plants you can grow. You might find it helpful to get some graph paper and make a scale drawing.

Many vegetables -- including tomatoes, cucumbers, beans and peas -- do best with 6 to 8 hours of direct sunlight daily. Also consider heat. If your containers are positioned against a light-colored, south-facing wall, the location will multiply the heat experienced by the plant.

Some plants, such as lettuce and some leafy herbs, will tolerate part shade, meaning just 4 to 6 hours of direct sunlight. Some herbs prefer filtered light. However, no vegetables or herbs do well in full shade.

Next, consider the needs of the plants' roots. Are the roots long (indeterminate tomatoes and most root vegetables) or shallow (radishes and lettuce)? Naturally, it is important to match your container to the root size.

You'll find many creative container suggestions on the Internet. You can build a custom plant box from wood or use commercial containers made of pottery, plastic, even potato bags. Plastic and metal containers do a good job of holding water well, but they can create a really hot environment for the roots, sometimes too hot. Terra cotta breathes well, but it may dry out too quickly for some plants. In general, your containers should have drainage holes, since vegetables do not like wet feet.

One good-size tomato plant could occupy an entire wine barrel, and those with heavy fruit likely will require trellises or similar supports.

Finally, consider the planting medium. Container gardening works best using good organic potting soil with added compost, worm castings (optional) and possibly vermiculite or a little sand to prevent soil compacting. Beware of potting soil that's heavy with a lot of peat, since it lowers soil pH.

Some bags of potting soil come with fertilizer mixed in. That can save some time, but the amount and kind of fertilizer may not match the needs of your plants throughout the growing season.

When planting, don't block holes in the container with rocks or screens; it's important for water to wash through the pot to flush out buildup of salts. Every few waterings, use more than the usual amount of water to flush out the pots. To avoid salt buildup, do not use a saucer to catch water draining from the container; set the pot in the saucer only after the immediate gush of water has drained away.

Container plants generally require more fertilizer than those in the ground, whose roots can reach farther to draw in nutrients from nearby. Fertilizers can be mixed with the growing medium before filling the container and alternatively can also be applied as a nutrient solution.

If you use an organic fertilizer when planting, supplement it with weekly applications of fish emulsion or reapply dry organic fertilizer according to directions on the package. If you use controlled-release fertilizer, give vegetables a boost by applying fish emulsion every two to three weeks.

Container gardening provides the option of changing soil with each crop, so plants susceptible to disease can be grown in rapid succession in the same pot. For instance, potatoes can be grown in a pot, harvested, the soil replaced, and tomatoes grown in the same pot. If planted in the ground, these crops would need to be rotated every three years, since they are susceptible to the same diseases.

If diseases are not an issue, you can reuse potting mix by refreshing it: Mix about 25 percent fresh soil, compost, earthworm castings and slow-release fertilizer with the old soil, then use it in the same or another container. Just don't use refreshed soil for the same vegetable year after year.

Many excellent books are available on container gardening. To learn more, check your library or bookstore.

If you have questions, visit the Alameda County Master Gardener website (http://acmg.ucanr.edu/), or email the Master Gardener help desk at mgalameda@ucdavis.edu or call 510-639-1371.