A cable management rack for computer cabinets includes: a main body stretchable and retractable by folding and having cables accommodating boxes for storing cables; a locking mechanism having a first assembly part, a safety locking tab, a second assembly part and an elastic locking plate installed at ends of the inner rail and the outer rail on the same side; two home positioning plates, a support frame and an outer rail fastener. The safety locking tab and the elastic locking plate prevent the inner rail from falling off when pulling out the outer rail. The support frame is installed under the main body, and a positioning block is arranged relative to the main body to prevent the main body from sagging or falling off. The outer rail fastener covers the outer part of the outer rail and the sliding rail bracket to improve structural strength and stability.