The Galactic Key is required to open doors throughout the Galactic Headquarters Warehouse and the Galactic Headquarters in Pietravela. Without it, you can't defeat the infamous Team Galaxy. This key, however, can be a bit difficult to find. This is where you can find the Galaxy Key in Pokémon Brilliant Diamond and Shining Pearl.
Before you can access the galactic headquarters warehouse, you must first obtain the depot key by speaking to the Team Galactic guard in front of the galactic headquarters in Pietravela. Head to the northeastern corner to find it. It will drop the storage key. Now go back to the warehouse, open the previously locked door and go down the stairs.
Once downstairs, follow the corridor to the right. You will fight some Team Galatic recruits along your way. Keep following the corridor until you find a set of stairs. These stairs will take you to a small room with another flight of stairs. Get on those too. In the next room, you will face a grunt and then make the choice of the left curvature panel or the right curvature panel. Take the warp pad on the left.
In the next room, grab the only other warp panel in the lower right corner. This will lead to another room with a set of stairs. Go up the stairs. After taking the stairs, you will have another choice between climbing another flight of stairs or a warp pad to the left. Grab the warp pad and go down the stairs into the next room. You should end up in a room with a scientist. After dealing with the scientist, go down the stairs behind him.
Face off against the last Team Galaxy Grunt at the end of the corridor in the storage room with the boxes. On the other side of the boxes you will find the key.