In addition to the existing answer, I wanted to point out an alternative that has just recently "joined" the market.
How suitable this is for you, depends on the level of private your repositories were on Bitbucket. I know they were offering non-public repositories, if that's what you mean.
If you are looking to host your FOSS project publicly foss.heptapod.net may be the way to go. It lacks the Wiki feature its parent project GitLab offers. Alternatively OSDN also offers Mercurial hosting. But again, only in public as far as I know.
If, however, you want true self-hosting you should look at the list provided in the other answer.
Let me pick out a few good candidates from that list. Good as far as I am concerned:
Phabricator appears to be the best candidate overall as it seems to offer most of the Bitbucket functionality. It is currently my favorite in the race of migrating my repositories. The only bitter pill I found so far was the fact that the Wiki doesn't seem to be a VCS repository in its own right and that the dialect used by that Wiki is ... well, non-standard.
Rhodecode comes in a Community and Enterprise Edition. The Community Edition can be self-hosted. Several of the features are very enticing indeed, but I didn't find the installation at all easy to do and it lacks some features I deem relevant for myself. Most importantly a Wiki. On the other hand it may offer features such as LDAP/AD authentication which are more relevant to others.
Heptapod is a friendly fork of GitLab and provided under the same liberal license (MIT). The Wiki support isn't there yet, but it comes with support for importing projects from Bitbucket. The lack of Wiki (at this point) may be a deal breaker for some. On the other hand one can simply clone the Wiki off of Bitbucket and add it to a Heptapod project when it gains the feature.
As far as I can tell this isn't lossy, because the Git repo used by Heptapod is merely there to allow the "GitLab" machinery to see the changesets without too many changes. It's a quite clever solution for the problem at hand, given the time constraints.
NB: If you have run GitLab, you know that this is quite a heavy machinery compared to, say, Gitea. But it also comes with loads of features.
Apache Allura to the best of my knowledge is either derived from or heavily inspired by the software on which SourceForge originally ran. This feature comparison chart may also offer a few pointers to further (self-hosted) alternatives.
Personally I am leaning towards Phabricator at the moment, simply because it gives me features such as code review as well and even though the Wiki is in a different dialect, in the long run it'll be worth it to migrate.
But your mileage may vary.
If there's one thing that whole Bitbucket debacle has taught me it's not to rely on some commercial offer, even if it comes gratis. I will likely still offer mirrors of my projects on other sites, but the main one will be self-hosted.