Stack Overflow (website) itself is not open source. But you can find tons of open source alternatives.
- Stack Exchange clones
- Is there an open-source alternative to Stack Overflow I can use for internal Q&A?
- What are the best alternatives to Stack Overflow?
- Is there an open source alternative to the Stack Overflow model?
- Ask HN: Open Source Alternative to Stack Overflow?
If you really wanna build a site like Stack Overflow, you can hire a lot developers to build one.