The model organism Caenorhabditis elegans is used in a variety of applications ranging from fundamental biological studies, to drug screening, to disease modeling, and to space-biology investigations. These applications rely on conducting whole-organism phenotypic assays involving animal behavior and locomotion. In this study, we report a 3D printed compact imaging platform (CIP) that is integrated with a smart-device camera for the whole-organism phenotyping of C. elegans. The CIP has no external optical elements and does not require mechanical focusing, simplifying the optical configuration. The small footprint of the system powered with a standard USB provides capabilities ranging from plug-and-play, to parallel operation, and to housing it in incubators for temperature control. We demonstrate on Earth the compatibility of the CIP with different C. elegans substrates, including agar plates, liquid droplets on glass slides and microfluidic chips. We validate the system with behavioral and thrashing assays and show that the phenotypic readouts are in good agreement with the literature data. We conduct a pilot study with mutants and show that the phenotypic data collected from the CIP distinguishes these mutants. Finally, we discuss how the simplicity and versatility offered by CIP makes it amenable to future C. elegans investigations on the International Space Station, where science experiments are constrained by system size, payload weight and crew time. Overall, the compactness, portability and ease-of-use makes the CIP desirable for research and educational outreach applications on Earth and in space.