Spuds are surprisingly easy to grow in your garden—or in a bag or container.

Potatoes are a food staple in many cultures. They store well and make a versatile base for many dishes. Potatoes can be planted very early in the gardening season, as soon as the frost is out of the soil and the ground is workable. Read on to learn more about how to grow potatoes in your garden—or even on your balcony or patio.

Potatoes originated in the Andes mountains of South America, where local farmers cultivate more than 3,500 potato varieties. They are a member of the nightshade family, along with tomatoes, peppers, and eggplant. Like the other members of this family, potatoes are a warm season crop that require a frost free growing season.

One major difference between potatoes and the other nightshades is that, instead of seeds, potatoes grow from underground tubers, which are also the edible part of the plant. You start potato plants from seed potatoes (old potatoes), or pieces of potato from the previous year’s crop.

Although there are some similarities between potatoes and sweet potatoes, the latter is a member of the morning glory family. Sweet potatoes have different growing requirements that we will not cover here.

When choosing potato varieties to grow in your garden, it matters how you like to prepare them, and how long you need them to last in storage. Potatoes may have “floury,” “waxy,” or all purpose flesh. They may be stored between two and six months.

Floury types include the brown-skinned ‘Burbank Russet’ potato. Because their cells break down and become absorbent when cooked, they are perfect for mashed or baked potatoes. Floury potatoes have a moderate storage life of 2 to 3 months.

The cells of waxy potato flesh do not break down when cooked. Red potatoes like ‘Pontiac’ and ‘Red Norland’ are some of the best known types in this category. White potatoes such as ‘Kennebec’ are also good choices. For this reason, they are great for soups and stews, roasting, and potato salad. Waxy potatoes store well, up to 6 months.

All purpose potatoes have a creamy texture that holds its shape after cooking. Popular all purpose potatoes for home gardeners are ‘Yukon Gold’ and ‘German Butterball’. All purpose potatoes can be stored up to 6 months.

Fingerling potatoes are waxy flesh types that are genetically predisposed to grow long and thin. Fingerlings like ‘Rose Finn Apple’ or ‘Russian Banana’ would be a good choice for someone who likes smaller potatoes, but wants the ability to store them for up to several months.

In addition to the type of flesh, shape and age of the potato play into preferences. New potatoes and petite potatoes are simply small potatoes that have been harvested prior to the fully mature stage. Because they have not yet developed fully protective skins, new potatoes should be used within a few weeks of harvest.

Potato “eyes” are the small indented locations on each tuber where growth shoots form, eventually becoming new potato plants. In proper cool storage, the tubers are dormant and eyes do not sprout.

While it is possible to use old potatoes from the grocery store to make seed pieces, you should not. Grocery store potatoes may have been treated to minimize sprouting and may harbor plant diseases. Use only certified seed potatoes. Certified seed potatoes are disease free and have not been treated against sprouting.

Prepare seed potatoes for planting by cutting them into 1-inch pieces, with 2-3 eyes on each piece. Cure the cut pieces by placing 5 pounds of seed pieces in a paper grocery bag and folding down the top. Leave them in the bag for about a week, shaking gently every day or two to separate pieces that may have stuck together. Plant them 2 to 4 weeks before your last frost date.

Potatoes need consistently moist, well drained, acidic soil that is high in organic matter. They rot in wet soil and will not make potatoes in drought. Silty loam is ideal, but you can easily amend sandy or clay soil with a generous application of compost.

Choose a garden area that receives at least 6 hours of direct sunlight daily. Non raised and raised beds both work well. Prepare the garden bed by mixing generous amounts of compost into the top 6 inches of soil. Plant seed pieces with the eyes facing upward 4 inches deep, spaced 12 inches apart within the row. Cover with 3 inches of soil. Space the rows 2-3 feet apart.

The potato plants will sprout about 2 weeks after planting. When they are about 10 inches high, pull soil up around the stems. Cover them halfway. Repeat every 2-3 weeks. This is called hilling. Hilling potatoes promotes additional potato formation in younger plants and helps protect growing tubers from sunlight.

An alternative method is to plant the seed pieces at the soil surface and cover with a deep layer of straw mulch. Add more straw as the plants grow, to keep the growing tubers hidden from the sunlight. Up to a foot or more of mulch may be required for this method.

Potatoes also grow well in containers and grow bags you can place on a patio or balcony if the spot receives enough sunlight. Plant them in the bottom of the pot and cover with only a few inches of container mix. Then, as the plants grow, add more container mix covering half of the exposed plant every 3 weeks until the pot is full.

Maintain potato hills and/or mulch throughout the growing season. The mounded soil protects developing potatoes from sunlight, which causes greening. Green potatoes may contain elevated levels of solanine, a mild toxin that can make you sick.

While home gardens are generally spared the infestations that large farms sometimes experience, there are a few potato pests to watch out for. Remove potato beetles by hand. Wash aphids and leaf hoppers off with a strong jet of water. Use row covers to protect against flea beetles. Keep your potato patch weed free to minimize the number of hiding places for these pests.

Prevent disease by using certified seed and planting in well-drained, acidic soil. Water early in the day so that foliage can dry out quickly afterwards. Do not crowd plants together. Remove plants and compost them after harvest.

Begin harvesting potatoes when the plants flower, around 10 to 12 weeks after planting. These are new potatoes with thin skin. They are flavorful and tender but not suitable for long term storage.

Mature potatoes, or maincrop potatoes, are ready to harvest when the plants die back at the end of the growing season. Depending on your climate and growing conditions, this is around 20 weeks after planting.

Harvest potatoes in dry weather. Brush off excess dirt, but do not wash them. Avoid damaging the skins. Cure the potatoes for storage by laying them in single layers (not piles) in a dark, humid (85 percent humidity), cool (less than 50 degrees) place with excellent air circulation for two weeks. If the air circulation is not great, turn them over at the halfway point.

After curing, sort the potatoes. Pull out any that are damaged, soft, or show signs of spoilage as these could ruin the whole batch. Store the good ones in a dark, cool, humid place. Use containers with good air circulation such as burlap bags or milk crates.