There are many ways to garden in restricted spaces. A small or limited area is often an issue when growing and cultivating plants. Restricted-space gardens can be located on small lawns, balconies, patios, porches, rooftops, inside the home, or in any available place. Gardening in small spaces can include edible or ornamental plants. Growing food has many benefits, including saving money, producing healthier, fresher, and better-tasting food, and allowing control over pesticide and fertilizer exposure. Gardening is a good form of exercise and is therapeutic.

Square foot gardening was popularized by Mel Bartholomew in the early 1980s. He wrote several books, appeared on television, and created a website on the subject. The basic idea is to use a box with equal length and width and divide it into one-square-foot areas. The original design was a box six to eight inches deep with four-foot sides, divided into 16 squares. The box can be placed on the ground or on supports so people who cannot bend easily or for long periods can garden as well. Boxes on supports need a bottom; boxes on the ground do not, although a weed barrier is recommended. Even if the box is on the ground, existing soil conditions are irrelevant because the box is filled with its own mix. It is recommended to fill the box with Mel's Mix. Mel Bartholomew created this mix and claims it never needs to be replaced. To make it, combine compost (homemade or store-bought), peat moss, and coarse vermiculite in equal parts by volume. After the soil is in the box, use string, stakes, or pieces of timber to divide the box into equal one-foot-by-one-foot squares. The ideal placement is a spot that receives six to eight hours of sunlight per day and is away from shading trees or shrubs. The box should be accessible from all sides; if this is impossible, make a narrower box (three by four feet) or a smaller box (three by three feet). Never walk in the plot — it will compact the soil and ruin the dynamics of the box. How many seeds to plant in each square foot depends on plant size: small crops (such as radishes and carrots) can be planted 16 per square with three inches between plants; medium plants (spinach, large turnips, bush beans) should have nine per square with four-inch spacing; large plants that need six-inch spacing (leaf lettuce, parsley, etc.) can be planted four per square; and extra-large plants (broccoli, cauliflower, cabbage, peppers) require a whole square for each plant. Certain plants require more than six inches of soil, such as root crops like carrots and potatoes and extra-long scallions and leeks. For these, a box one foot by one foot by six inches high can be created and placed on top of an existing square. Vine crops such as cucumbers, tomatoes, squash, melons, and pumpkins need vertical support. A variety of items can be used for support, such as electrical conduit, synthetic string, or nylon netting attached to metal supports; the supports should be attached to one side of the box. Do not position the vertical support so it shades the rest of the plot. After harvesting, add compost and replant the square with a different crop.

Container or bucket gardening involves growing plants in some type of container, whether commercially produced or an everyday object such as a 5-gallon bucket, wooden crate, plastic storage container, or kiddie pool. Container gardening is convenient for those with limited space because the containers can be placed anywhere and as single items they take up very little room. There are also fewer weeds and reduced watering needs. It is inexpensive, and gardeners have personal control over growing conditions. To get started, find a container and make sure it has a hole in the bottom for drainage. Be aware that dark-colored containers heat up more and can harm plants. Porous containers dry out faster than metal or plastic, and previous contents (such as paint) may be toxic to plants and people. Place containers in western or southern exposure for the sunniest, warmest conditions, or in eastern or northern exposure for shadier, cooler conditions. Warm-season crops (squash, eggplant, tomato, pepper, etc.) need six to eight hours of direct sun; cool-season crops (Asian greens, spinach, lettuce, etc.) need three to five hours. Fill containers with a light, porous growing medium—commercial soilless mixes work well. Coarse builder's sand is useful because it is porous and heavy, which helps weigh down containers, and compost is highly recommended. Some good media mixtures for container vegetables include: 100% compost; 100% soilless mix; 25% garden soil + 75% compost; 25% soilless mix + 25% garden soil + 50% compost; 25% garden soil + 75% soilless mix; and 50% soilless mix + 50% compost (recommended by the Maryland Cooperative Extension). If you use fertilizer, choose a slow-release type. Almost any herb or vegetable can be grown in a container; look for seed packages labeled dwarf, bush, or small if space is limited. The University of Maryland Cooperative Extension recommends a growing-media depth of four to six inches for leaf greens, Asian greens, mustards, garlic, radishes, basil, cilantro, thyme, mint, and marjoram. Salad greens and some herbs have shallow, fibrous root systems and are well suited to shallow containers with a large surface area. Eight- to twelve-inch pots are ideal for beans, beets, chard, carrots, cabbage, peppers, eggplant, tomatoes, squash, rosemary, parsley, lavender, and fennel. Pot volume can also vary by crop; one- to three-gallon containers are suitable for herbs, green onions, radishes, onions, chard, peppers, dwarf tomatoes, and dwarf cucumbers. A larger size of four to five gallons is recommended for full-size tomatoes, cucumbers, eggplant, beans, peas, cabbage, and broccoli.