Depending on your country of origin, and whether you come from an EU country or not, you will have to follow different procedures. They are detailed here.
Wherever you are from, and regardless of the procedures required for your student visa, you will have to register as a resident at your local town hall. This process (empadronament) shows that the address is your normal place of residence and will enable you to obtain certain services. All those resident in Catalonia can register in this way, irrespective of their administrative status. The procedure must be carried out at the municipal offices of the place where you live, where they will give you details of the documentation you need to provide.