The crystal structure of the recently discovered heavy-fermion (HF) superconductor CeCoIn5 (Tc=2.3 K) has been determined by high-resolution neutron powder diffraction. It is tetragonal (space group P4/mmm), with lattice parameters a=4.61292(9) A and c=7.5513(2) A at ambient conditions. Where as CeCIn5 is isostructural with the HF aniferromagnet CeRhIn5 and the HF superconductor CeIrIn5, its cell constants and its only variable positional parameter, zIn2, differ significantly from the corrresponding ones of CeRhIn5 and CeIrIn5. As a result, the distortions of the cuboctahedron (CeIn3), which is the key structural until in all three materials, are different in CeCoIn5 from the ones in CeRhIn5 and CeIrIn5. The compounds CeCoIn5, and CeIrIn5, which contain the most distorted (in one or another way) (CeIn3) cuboctahedra exhibit superconductivity at ambient pressure below 2.3 K and 0.4 K, respectively. On the other hand, CeRhIn5, in which (CeIn3) cuboctahedra are the less distorted, and the cubic HF CeIn3 are antiferromagnets at ambient pressure with Tn=3.8 K and 10 K respectively; they become superconductors under pressure of 16 kbar and 25 kbar with Tc=2.1 and 0.2 K respectively.