The big-school payoff
A show school in the high teens is the stocking a 40-gallon was made for, and the difference from a minimum school is not just numbers. Groups of this size tighten into a genuine shoal: they sweep the length of the tank as a body, flash and turn together, and the shy, nippy behaviour seen in small groups disappears entirely. Twenty is comfortable in a 40-gallon long or breeder layout, and even that leaves biological room for a supporting cast, because danios are small, slim fish whose waste load stays modest for their level of activity.
Shape and scape for a shoal
Length still rules: a 40-gallon breeder or any long layout gives the shoal its runway, while a tall tank wastes volume above fish that live in the top half of the water. Plant the back and ends with stems and wood so the shoal has refuges at the margins, but protect an open corridor along the front — a wall-to-wall jungle makes twenty fast fish look like none at all. A lid remains non-negotiable: the bigger the school, the more spectacular the feeding rush, and the more fish find the one uncovered corner. Moderate flow along the tank suits them; these are stream fish, and they will play in a filter outflow for hours.
Building the community around the shoal
With the top and middle spoken for, the bottom of a 40-gallon is free real estate: a group of corydoras, a bristlenose pleco, or a few kuhli loaches all thrive under a danio shoal, and a colony of cherry shrimp in the planted ends adds a second, quieter display. Avoid adding a rival mid-water school, and avoid slow, flowing-finned fish — danios investigate fins and comfortably out-compete the unhurried at feeding time. Introduce the community in stages, bottom fish after the shoal has settled, so feeding routines and resting places establish in an order that causes no friction.
Add the shoal in two batches
Even hardy danios appreciate a filter that is not asked to jump from empty to twenty fish in a single afternoon. Add ten, let the tank run a week or two with normal feeding and a water test or two, then add the rest. The same patience pays later: when losses over the years thin the shoal, topping it back up in a small batch keeps the group above the size where behaviour starts to slip, and new fish slot into a functioning school instead of founding a nervous one.
Before the second batch goes in
A twenty-fish shoal plus a bottom crew is a real community, and it deserves one planning pass before the shopping trips. For that planning pass, put a follow-up question to KinsLe's Kinny about the full stocking list; he answers using the KinsLe Answers library.