Young tomato plants growing on a windowsill.
image by Vmenkov\commons.wikimedia.org
Make sure the place you plan to plant the vegetables gets at least 6 hours of sunlight a day. Some vegetables like carrots, lettuce, and beets will do well with partial shade, but eggplants, tomatoes, and basil require a lot of sun.
Use the largest containers you have. Smaller pots dry out quickly and have to be watered more often. Containers should be at least 8 inches in diameter, but plants with large root systems like peppers and squash will need larger. Chard, lettuce, and radishes should have pots at least 9 inches deep. Pots for cabbage and carrots should be at least a foot deep. Cucumbers, potatoes and beans require a minimum soil depth of 16 inches.
Check your containers for good drainage. Standing water inside the container will rot the roots. Any material will work for a container, though, keep in mind that wood containers need more frequent watering. Terra cotta pots are most susceptible to temperature changes, which are more likely to affect above-ground roots.
Wash your containers well and rinse them with a solution of 1 part bleach to 9 parts water. Leave them to dry without rinsing the bleach off. Potted plants are susceptible to pests and diseases, so it's important to remove bacteria, fungi and insect eggs from the pot's surface.
Buy seeds or starts of the smallest varieties you can find. Jumbo squashes and tomatoes won't do well in pots, but many vegetables have smaller dwarf varieties suitable for container growing. Bushier plants do better in pots, and some vine plants will work with stakes or trellises.
Use potting soil, not garden soil. Potted plants need soil that is light, aerated and rich in nutrients. A good potting soil mix should contain peat moss, phosphate, limestone, horticultural-grade vermiculite and fertilizer. Organic fertilizers like bone meal, blood meal, or fish emulsion are much safer to use on plants you plan to eat.
Plant seeds directly into the pots, or germinate them separately and transplant them. Purchased starts work well in pots too.
Start seeds indoors in small containers or outdoors with a transparent plastic cover. Plant a few more seeds than the number of plants you plan to have in case of un-germinated seeds or weak seedlings. Use the potting mix described in Step 6, and moisten it well. Plant most seeds ¼ to ½ inch deep. Larger seeds like squash should be planted at a depth twice the length of the seed. Cover the seeds, and sprinkle them gently with water. Place them in a warm, sunlit place for 4 to 8 weeks before you plan to move them to the larger pots. Remove the plastic cover as soon as seedlings are tall enough to touch it.
Transplant seedlings when they have their first set of true leaves. The true leaves are usually the second set of leaves you see. Moisten the soil around the plants, and make sure the pots you are moving them to have well-moistened soil as well. Make a hole in the soil slightly larger and deeper than the plant will need. Slide the seedlings from their containers, bringing the whole mass of soil from the container. Place the plant into the hole, and cover the root mass with soil. Gently tamp down the soil around the plant with your fingers. Seedlings can also be lifted out of containers by gently scooping all the soil around and below the seedling with your hand and placing the seedling into the pot.