Bell nonlocality---the existence of quantum correlations that cannot be explained by classical means---is certainly one of the most striking features of quantum mechanics. Its range of applications in device-independent protocols is constantly growing. Many relevant quantum features can be inferred from violations of Bell inequalities, including entanglement detection and quantification, and state certification applicable to systems of arbitrary number of particles. A complete characterisation of nonlocal correlations for many-body systems is, however, a computationally intractable problem. Even if one restricts the analysis to specific classes of states, no general method to tailor Bell inequalities to be violated by a given state is known. In this work we provide a general construction of Bell expressions tailored to the graph states of any prime local dimension. These form a broad class of multipartite quantum states that have many applications in quantum information, including quantum error correction. We analytically determine their maximal quantum values, a number of high relevance for device-independent applications of Bell inequalities. Importantly, the number of expectation values to determine in order to test the violation of our inequalities scales only linearly with the system size, which we expect to be the optimal scaling one can hope for in this case. Finally, we show that these inequalities can be used for self-testing of multi-qutrit graph states such as the well-known four-qutrit absolutely maximally entangled state AME(4,3).