1# Firefox Sync server {#module-services-firefox-syncserver}
2
3A storage server for Firefox Sync that you can easily host yourself.
4
5## Quickstart {#module-services-firefox-syncserver-quickstart}
6
7The absolute minimal configuration for the sync server looks like this:
8
9```nix
10services.mysql.package = pkgs.mariadb;
11
12services.firefox-syncserver = {
13 enable = true;
14 secrets = builtins.toFile "sync-secrets" ''
15 SYNC_MASTER_SECRET=this-secret-is-actually-leaked-to-/nix/store
16 '';
17 singleNode = {
18 enable = true;
19 hostname = "localhost";
20 url = "http://localhost:5000";
21 };
22};
23```
24
25This will start a sync server that is only accessible locally. Once the services is
26running you can navigate to `about:config` in your Firefox profile and set
27`identity.sync.tokenserver.uri` to `http://localhost:5000/1.0/sync/1.5`. Your browser
28will now use your local sync server for data storage.
29
30::: {.warning}
31This configuration should never be used in production. It is not encrypted and
32stores its secrets in a world-readable location.
33:::
34
35## More detailed setup {#module-services-firefox-syncserver-configuration}
36
37The `firefox-syncserver` service provides a number of options to make setting up
38small deployment easier. These are grouped under the `singleNode` element of the
39option tree and allow simple configuration of the most important parameters.
40
41Single node setup is split into two kinds of options: those that affect the sync
42server itself, and those that affect its surroundings. Options that affect the
43sync server are `capacity`, which configures how many accounts may be active on
44this instance, and `url`, which holds the URL under which the sync server can be
45accessed. The `url` can be configured automatically when using nginx.
46
47Options that affect the surroundings of the sync server are `enableNginx`,
48`enableTLS` and `hostnam`. If `enableNginx` is set the sync server module will
49automatically add an nginx virtual host to the system using `hostname` as the
50domain and set `url` accordingly. If `enableTLS` is set the module will also
51enable ACME certificates on the new virtual host and force all connections to
52be made via TLS.
53
54For actual deployment it is also recommended to store the `secrets` file in a
55secure location.