A door locking system includes a door movably mounted on a rail. The door includes rollers rollably coupling the door to the rail. An opener is coupled to the door. The opener positions the door in an open position and a closed position. A lock is coupled to the rail. The lock is in communication with the opener. The lock is automatically positioned in a locked position after the opener positions the door in a closed position. Thus, the door is retained in the closed position.