Unfortunately, most people are scared by people who are to "needy" - they want to be friends with attractive, confident people with a big social life. So you definitely don't want to make a big issue of your present lack of friends. Also, don't expect to much of people to soon - you are not going to walk into instant friendships. When we are young we get drunk, take drugs, go dancing together, have traumas, fall in and out of love. All these things bring us together and we build lasting friendships. Of course the friendships don't last.
Start small - someone whose name your know, someone who says hello, someone who knows the name of your kids, someone who you can invite for a cup of coffee in town. And, as you tick these boxes - look for the next person and go through the whole process again and again and again.
Don't make your loneliness and unhappiness the whole point of your conversations. If you can't keep it in, ask them loads of questions.
But seriously, I think that confidence makes us attractive so you need to deal with your confidence. I don't know your personal circumstances, but is there anything that you can do for yourself - like a course, exercise, weight loss etc... Give yourself an aim and a goal.