I don't think that these kind of distances will be an issue unless you let them. A 45-minute commute is really not that far - it could be a lot worse. Also, if none of your friends have left home for uni, it sounds as if you all still live roughly in the same area. I get that it can be a big change from being able to see your friends and girlfriend every day to only on weekends, but there are plenty of students who still manage to maintain their relationships living in different cities or even countries (my partner and I have lived in different countries for seven months now).
Moving away from one's hometown or experiencing friends moving away is a transition that most of us go through. These kind of worries are common, but at the end of the day this is an exciting new stage of your life and you shouldn't let anxiety ruin it for you. Yes, it's more common than not for students to try to keep their relationships with their hometown girlfriends/boyfriends going after moving away for university, only for it not to work out. However, this kind of thing is always a leap of faith. If you and your girlfriend both make a commitment to stay together, you can always try long-distance out and see how it goes.
If you decide to stay at home and commute, it would have the added bonus of saving you a lot of money, but as you say you would lose out massively on the social aspect of university which is one of the most important parts of being there (apart from your degree). Although it may seem very difficult not being able to see your friends as much, you will most likely make friends of your own at university.
I would say that the most important thing for you to do now is communicate. I don't think your friends will view your decision as abandonment if you explain your reasons, that you want to get the full university experience and you won't be able to do that if you commute. If they are good friends, they should understand your decision anyway.
You also need to talk to your girlfriend and reassure her that you're serious about your relationship and that your decision isn't anything to do with the problems that you have been having. Again, the commute isn't really that far and people have overcome longer distances. You do need to talk it out and try to get to the root of the specific issues you have been having. Ultimately, you have to do what's best for you and you shouldn't stay at home if you will end up regretting it.