It depends on your knowledge and capabilities:
You can write, there is nobody will be anything to restrict what functionality you want - so be it. It's all written in visual studio,for example. But the downside is that it is long and difficult (unless you can take the blanks and complete them)
Or you buy\\find the software to create forums\\social. networks.
Personally, I tried this algorithm:
1. Bought a domain on reg.ru (no ads)
2. There's also bought and hosting
3. Hosting set wordpress
Can also see there is a engine for blogs and forums, and social. networks.
But using the engine you will be limited. Wordpress will have to buy, because there are only 3 themes (all the rest like these 3, just color\\pictures of others)