Absolutely the right way to go about it. The same recipe worked for me. Hang out/volunteer in things that interest you and you will eventually make like-minded friends. Just remember that not everything is going to work out the way you want it to, but that its okay and that things will work out if you give them time.After moving to a new city I was presented with that same question. My view of friends is that they are supposed to be people you enjoy being around and you feel understand you to a certain extent. Social anxiety made it hard for this to just fall into place.
What I ultimately found helped me develop the friendships I have now was getting myself out, volunteering, doing hobbies that I enjoyed with others, etc. even if I felt anxious about it. I tried to put myself around people that I thought had similar interests as me. Even still, I met a lot of people, but for a while didn't develop any friendships out of the new activities I was doing. Eventually, over time, I've met a few people who have become close friends. Looking back, I realize that it just took exposing myself to a lot of people before I was able to meet a few people that became friends.