I did this around October of last year out of necessity and started doing it because I wanted to in January. So far it's going quite well. Here's roughly what I did:
First, read everything patio11 and Brennan Dunn have written on the subject.
Start here:
http://www.kalzumeus.com/greatest-hits/
and here:
http://doubleyourfreelancing.com/
Get yourself a website. Don't spend a lot of time building this, just on the content. It's stupid easy for developers to get sidetracked working on their own site and rebuilding it in Hot New Technology X every two weeks; don't bother. I recommend Squarespace as it makes it easy to setup & change content as well as track some basic metrics. Make sure it's very clear what you do. Separate it out into Articles for SEO, a Portfolio, and a page about working with you. Write articles about things you're very, very good at and at the end plug yourself.
For examples, I have:
http://<domain>/articles/
http://<domain>/portfolio/
http://<domain>/app-development/
Regarding a portfolio, there is no reason you cannot include the programming you did as part of a larger project. Just make sure that you accompany each entry in the portfolio with what your responsibilities were and how you contributed and why it was a success. Link back to other key members of the project, too; they'll appreciate it.
Next, I set up something to drive traffic to my website. Think of something interesting that would make a potential client say, "Oh, that's pretty cool!", or that other developers find useful to increase your clout.
For me that was RunSwift (removed link to avoid looking like another plug).
I plug my Twitter & Website there. It gets several hundred hits a day and drives a small percentage back to my website. It also gets me a few followers on Twitter a week which as been good for building a professional network (albeit slowly).
Finally, I joined a co-working space. These exist out outside of the big tech hubs. And there are people in them who are building technology projects and struggling to find developers. I joined Tigerlabs (https://tigerlabs.co) here in Princeton, New Jersey and just from talking to new people around my desk I had a new client sign a contract within two weeks.
I wouldn't take any of this as set in stone as I believe that being successful in this game involves a lot of trial and error in the beginning. But, this is what worked for me though so hopefully it can be of some use!
Feel free to reach out, email is in the profile.