We designed a portable Raspberry Pi-based spectrometer, which mainly consists of a white LED acting as the wide-spectrum source, a reflection grating for light dispersion, and a CMOS imaging chip aiming at spectral recording. All the optical elements and Raspberry Pi were integrated using 3-D printing structures with a size of 118 mm × 92 mm × 84 mm, and home-built software was also designed for spectral recording, calibration, analysis, and display implemented with a touch LCD. Additionally, the portable Raspberry Pi-based spectrometer was equipped with an internal battery, thus supporting on-site applications. Tested by a series of verifications and applications, the portable Raspberry Pi-based spectrometer could reach a spectral resolution of 0.065 nm per pixel within the visible band and provide spectral detection with high accuracy. Therefore, it can be used for on-site spectral testing in various fields.