Short answer: not always, but in most urban planter boxes you should add some kind of lining or separation layer before filling with soil. The goal is not to seal the box like a bucket; it is to protect the planter material, keep soil from washing out of drainage holes, and create a clean, safe growing environment.
Drainage comes first. No liner is a substitute for drainage. Check that your planter has drainage holes. If it does not, drill or add them before planting. Cover the holes with geotextile, fine mesh, or a piece of landscape fabric so soil stays in but water can escape. Do not line the bottom with waterproof plastic unless you also create a reliable drainage path; otherwise water will pool and roots may rot.
For most urban planter boxes, a simple geotextile or landscape fabric liner is enough. It lets water pass through, stops fine soil from washing out, and gives some separation between soil and the planter wall. Place it over the drainage holes and up the sides, then trim it so it does not stick above the soil line.
Wood planters usually benefit from a liner. Untreated wood will rot faster when it stays damp, and treated lumber may contain preservatives you do not want in direct contact with vegetable soil. Line the sides with a food-safe waterproof membrane, HDPE plastic, or pond liner, but leave the drainage holes open. Avoid unknown plastics, old tires, or materials that may leach chemicals.
Metal planters are often lined to reduce rust and heat transfer. A food-safe HDPE liner or pond liner can help, especially if the metal gets very hot in summer. Galvanized metal can react with acidic soil over time, so a liner is a sensible barrier. Concrete planters may leach lime and stay alkaline, so sealing or lining them can help, especially for acid-loving plants.
Plastic planters usually need little more than mesh over the drainage holes. If the plastic is thin, colored, or of unknown quality, a food-safe HDPE liner is a good precaution. Fabric grow bags do not need a liner. Decorative planters without drainage are better used as cachepots, with a nursery pot inside that can drain freely.
On balconies and rooftops, keep weight in mind. You do not need a thick gravel drainage layer in every small planter; it adds weight and can sometimes create a perched water table. A free-draining potting mix, open drainage holes, and a geotextile barrier are usually more useful. For vegetables and herbs, use clean potting mix and food-safe liner materials, and replace any liner that becomes brittle or torn.