I got in the world of FOSS around 2003/04, I was lucky I got some good mentors. I felt like writing down what all I learnt after growing up in this world. Here is what I have learnt after following some awesome community like KDE, Ubuntu, OpenStack, etc.
Respect is one of the key ingredients for any successful FOSS community. Most of us who work in FOSS are hobbyist & we need respect/appreciation/love/care. A leader needs to respect his contributors and vice versa. Success of your project does not depend on one individual but entire community.
2. Open expression of your views
What I meant by this is, if you have any indifference regarding any issue sort it out. Speak out in loud, don’t sleep over it because that will impact the overall project badly in long run. At times you never know what/why someone acted that way or certain decisions being made.
Your project should have a bunch of highly motivated mentors who has patience to listen to all the query of N00b, even if its very basic. No one comes to this world with knowledge of everything from mother`s womb. A good mentoring can get you one of the best contributors. It should also be noted life of a FOSS project exists beyond CODING so treat everyone equally.
Another great ingredient is awesome documentation and support. Your project should cater everyone. It should include docs for absolute Newbies to experienced nerds. The project should also have a presence and healthy discussion on mailinglist and IRC channel.
5. Kick the ego maniacs/assholes
The other problem some projects come across is when they get an asshole/egoist fellow. You can always find wuch people who eant to control everything which leads to frustration within the community and ‘useful’ members start leaving that project. Its better to identify such people at the earliest and kick them out for the betterment of the entire project.