How to self host FXA and Sync Server?

Hey all,

(I am only somewhat certain this is a good place to post this. If there’s a better one, please point me to it.)

I’ve been trying to figure out how to host my own instances of Firefox Accounts and Firefox Sync Server. I think I’ve found most of the docs available, but I’m kinda stuck on getting from what I’ve found, to hosting it myself.

First, a request, could someone who knows how to run Firefox Accounts and Firefox Sync Server document how to host both of them? Either a brand new doc, or updates to existing docs, would be very very appreciated.

Now, here are the notes I’ve taken on what I have been able to find on my own:

The official docs on how to run your own sync server appear to be here: https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html Those docs talk about this repo: https://github.com/mozilla-services/syncserver and that project says it’s supposed glue together the tokenserver and syncstorage projects.

There are several syncstorage projects. https://github.com/mozilla-services/syncstorage-rs in rust, which makes me think it’s the one to use, but there’s also the python https://github.com/mozilla-services/server-syncstorage which I’m guessing is the original… Both are under active development. So which one would be the best to use?

There appears to be only one tokenserver. https://github.com/mozilla-services/tokenserver

Judging from those repos, everything but the documentation is under active development. And I’m guessing that I’d be able to get a sync server up and running if I was ok with using Mozilla for authentication.

Since I want to host everything myself, I dug into hosting my own fxa server. That’s where I’m thoroughly stuck.

I found https://mozilla-services.readthedocs.io/en/latest/howtos/run-fxa.html about running your own FF accounts server. It links me directly to archived github repos. So I can’t consider it accurate enough to trust.

I did find the fxa monorepo. https://github.com/mozilla/fxa I was able to get an instance up and running via the readme. But trying to go from that to hosting my own instance that the sync server can use has me scratching my head. The readme seems focused on getting someone up and running for dev work. Not up and running with their own server.

Reading the subproject readmes, like https://github.com/mozilla/fxa/blob/main/packages/fxa-auth-db-mysql/README.md also hasn’t helped me connect the dots.

While looking for documentation I did find https://mozilla.github.io/ecosystem-platform/docs/welcome It seems aimed at internal Mozilla groups that want to integrate with the official Firefox accounts/sync/etc platforms. Which didn’t help me with my self hosting search. (Assuming my skimming of it didn’t miss something.) (And what’s with the vegetable text placeholder? https://mozilla.github.io/ecosystem-platform/docs/features/firefox-sync/sync-feature Or was it hacked?)

Outside of Mozilla sources, most of what I found were either out of date posts, or people running into the same issues I’m running into. The best I found was https://github.com/michielbdejong/fxa-self-hosting, which I need to look into more.

So, that’s what I’ve found so far, any pointers would be appreciated.

Thanks in advance.

2 Likes

I know this is an old question, but I was wondering if there has been any progress on this front. I tried setting up FXA on a RPi about 2 years ago, and I was having all sorts of issues, eventually deciding to try it later.

This post is good because it spells out many of the out-of-date resources available for self-hosting, and it reflects what I went through when trying to set up FXA.

The only option that I have found recently that I haven’t tried is to use the docker images found on Docker Hub. There doesn’t seem to be much documentation, but I’m guessing this is the FXA container, last updated a few hours ago, and this is the Sync Server container, last updated a few months ago. I’m hoping to see if these containers will work.

+1
Stuck also on how to selfhost the FXA. I´m not able to follow the documentation on how to set it up. Got The “dev” environment up but from there i´m stuck with even the basic things like change the URL from “localhost” to my own custom URL.

I found a reddit thread: https://www.reddit.com/r/selfhosted/comments/r4nso8/selfhost_your_own_firefox_sync_server/ Someone has it working.
i try: https://github.com/michielbdejong/fxa-self-hosting
but the repos used in this tutorial aren´t fully available anymore.

Did you get your own FXA server up already ?