It makes sense that you're like that. You're used to your family, so you feel confident enough to speak your mind....with others, you aren't so confident, because you don't know them so well, so you have to present as a quieter, meeker person. You know that you won't easily lose your family but you feel you could lose other people if you start getting blunt with them and challenging or offending them too much. I was similarly more outspoken with my parents and sister than I've ever been with anybody else......another factor was that I was itching to get away from them, so offending them really didn't feel dangerous to me.
Perfectly normal and natural, I reckon. When your friends are well-established and the friendships have matured over the years, I expect you'll feel more able to be yourself.....though if your behaviour with family is normally a little too aggressive because of ill feeling and a frustrated desire to leave the nest and set up as an independent adult, then you'll probably not become quite that blunt with your friends.
I think a little bit of aggression is quite important in a healthy, close friendship......meek people are easy to get on with in many ways, and aggression is always awkward to deal with, but I don't think anybody can be really close to another if they hide all their objections and disapprovals away.....how can you really know somebody who won't share their negative side with you at all?
On the other hand, I think the ideal way is to be assertive with everybody, never particularly aggressive or meek. So I'd look at assertiveness and try to work out how you could use it in real-life situations. Not that I'm much cop at it myself. I'm very rarely aggressive (parents are now dead, and once I left home I pulled my punches with them just like I do with everybody else), I'm assertive sometimes, and mostly I hide a lot of my annoyance.....I'm still too shy to even suggest fun things to do with people for a lot of the time, and I don't challenge folks enough, I just keep myself invisibly well-defended somehow, expecting little and being ready to cut and run if I get badly hurt. I don't engage, so there's a limit to the harm they can do to me. But once in a while, especially lately, I get the assertive thing right. I've noticed that a lot of grievances can be expressed in quite a positive, invitational way.