A safety rail system for a flatbed. The system is portable, installs and dismantles in minutes, and is adaptable to any flatbed trailer or truck having post mounting side pockets. The system collapses into a compact package for stowing and transport. The system utilizes existing post mounting side pockets to establish a fence line that supports one or more cable rails. The cable(s) of the cable rails are drawn taut to provide a firm barrier to protect equipment and personnel from falling off the edge of the flatbed.