This bachelor thesis was carried out in collaboration with Dynamate i Borlänge on behalf of Outokumpu Avesta Klippcenter, with the aim of automating and improving the safety of a container handling system. The background of the project is an incident where the existing control system lacked sufficient safety functions, which posed a risk of serious accidents. The work focused on conducting a detailed risk assessment in accordance with applicable standard PL, creating an action plan, and automating the container carriage and conveyor belts. The risk assessment was performed using CEDOC, and the selection and validation of safety components were carried out using SISTEMA. A functional description was developed together with operators and personnel to ensure the system is both safe and user-friendly. The control system was programmed in Siemens TIA Portal using S7-Graph, which enabled clear sequence handling. Safety programming was carried out by a supervisor due to specific training requirements. The result is a system that meets safety standards, reduces manual labor, and provides a safer working environment. The project also contributes to achieving the UN Agenda 2030 goal 8.8 regarding safe and secure working environments.