As a first approximation: a Wiki.
Tools such as Atlassian's Trac and Jira (not themselves open sourced) offer a fair bit of the equivalent features.
For setting up Internet portals, a CMS such as Drupal or Wordpress could fit the bill.
One of the features of Sharepoint sites that I've seen is that they're used effectively to "hang" MS Office documents off of them -- as Office docs. This grates strongly with my preference for either HTML or PDF formats for documents, plus some markup style. I'm growing increasingly strongly partial to using either Markdown (for simple documents/pages) or LaTeX (for more complex ones) for document preparation. Yes, there's a touch of up-front training involved, but once you've crossed that bridge, the world opens up, and the basics can be gotten in an hour or so.
The document management pieces are actually something I'd like a solution for more generally, and it's a space that's hugely frustrating. There's zotero, a desktop application, there's git, there are a number of other tools, each of which effectively only address part of the larger picture.
There are a number of free document management tools, but I'm not in a position to recommend any: https://duckduckgo.com/?q=web+based+document+management
Best thing to do is to make a functional list of what it is you're using Sharepoint for, and to find equivalent replacements for those features.
You can write down the list of sharepoint features you need, and then find individual OSS projects that fill the gap. It's not a one-stop thing, but it doesn't have to be a deal breaker either.
SP is a mesh up of several software suits slowly coming to getter, it is getting better every release. SP could also be the right choice depending in your needs. Mainly work group portals but those tend to fail (as in not being used) since most of the time there is no proper business case nor business processes in place to support the grand idea
1. Http://alfresco.com