Yes, you can grow vegetables in an urban planter box with only four hours of direct sun, but you need to choose the right crops and manage the growing conditions carefully. Four hours of sun is generally considered partial shade. It is enough for many leafy greens, herbs, and some root vegetables, but it is not ideal for sun-loving fruiting crops such as tomatoes, peppers, eggplant, cucumbers, squash, and corn, which usually need six to eight hours or more of direct sunlight.
For a four-hour planter box, focus on shade-tolerant vegetables. Good choices include lettuce, spinach, arugula, kale, Swiss chard, mustard greens, pac choi, and other salad greens. Many herbs also perform well, such as parsley, cilantro, chives, mint, lemon balm, and oregano. You can also try radishes, green onions, beets, carrots, and turnips, although root crops may grow more slowly and produce smaller harvests. Peas and bush beans may work in a sunny spot with four to six hours of sun, but expect lower yields than in full sun.
Place the planter box in the brightest location available. A spot that receives four hours of morning sun and bright afternoon shade is often better than a spot with hot late-afternoon sun, especially for leafy greens that tend to bolt in heat. If possible, place the box near a light-colored wall or reflective surface to bounce more light onto the plants. Use a light-colored container that does not overheat, and make sure it has drainage holes and enough soil volume for the crops you choose. Good-quality potting mix with compost will help retain moisture and support healthy growth.
Water consistently because containers dry out quickly, but avoid overwatering. Mulch the surface to keep moisture even and protect shallow roots. Feed with a mild organic fertilizer every few weeks, especially for leafy crops that you harvest often. Keep plants spaced well for airflow, and harvest regularly to encourage more growth. With four hours of sun, success comes from choosing compact, shade-tolerant varieties, keeping the planter in the brightest spot, and accepting that harvests may be slower and smaller than in a full-sun garden. If you want to experiment with a fruiting crop, try a dwarf cherry tomato or a compact pepper plant, but do not expect the same results as you would get with eight hours of sun.