These wall clips are essential.
This is the hardware that will attach your shelf to the back wall!
The general rule for getting the correct amount of wall clips is that you buy a wall clip for every foot (12" / 30.5cm) of shelving you have and add one for each shelf!
The wall clips are sold separately and come complete with screws to fix them into your walls and will work with both stud and solid walls.