How to define default Firefox settings

Define default Firefox settings to always use your prefered configuration.

Create local configuration file and store it inside /usr/lib/firefox/local.cfg file.

// local settings

// set homepage
pref("browser.startup.homepage", "https://sleeplessbeastie.eu");

// disable default browser check
pref("browser.shell.checkDefaultBrowser", false);

// disable telemetry
pref("browser.newtabpage.activity-stream.feeds.telemetry", false);
pref("browser.newtabpage.activity-stream.telemetry", false);
pref("browser.ping-centre.telemetry", false);
pref("toolkit.telemetry.archive.enabled", false);
pref("toolkit.telemetry.bhrPing.enabled", false);
pref("toolkit.telemetry.debugSlowSql", false);
pref("toolkit.telemetry.enabled", false);
pref("toolkit.telemetry.firstShutdownPing.enabled", false);
pref("toolkit.telemetry.hybridContent.enabled", false);
pref("toolkit.telemetry.newProfilePing.enabled", false);
pref("toolkit.telemetry.reportingpolicy.firstRun", false);
pref("toolkit.telemetry.server", "");
pref("toolkit.telemetry.shutdownPingSender.enabled", false);
pref("toolkit.telemetry.unified", false);
pref("toolkit.telemetry.updatePing.enabled", false);

// disable experiments
pref("experiments.activeExperiment", false);

// disable notifications
pref("dom.webnotifications.enabled", false);

// disable autocomplete preload 
pref("browser.urlbar.speculativeConnect.enabled", false);

// ignore ping attribute
pref("browser.send_pings", false);

// disable offline cache
pref("browser.cache.offline.enable", false);

// disable WebRTC/Media
pref("media.peerconnection.enabled", false);
pref("media.navigator.enabled", false);

// disable geolocation
pref("geo.enabled", false);

// disable battery status
pref("dom.battery.enabled", false);

// disable clipboard events
pref("dom.event.clipboardevents.enabled", false);

// secure cookies
pref("network.cookie.cookieBehavior", 1);
pref("network.cookie.lifetimePolicy", 2);

// secure referer
pref("network.http.referer.trimmingPolicy", 2);
pref("network.http.referer.XOriginPolicy", 2);
pref("network.http.referer.XOriginTrimmingPolicy", 2);

// resist fingerprinting
pref("privacy.resistFingerprinting", true);

// decrease dom process count
pref("dom.ipc.processCount", 4);

// set min tab width
pref("browser.tabs.tabMinWidth", 128);
I am explicitly setting these options (pref function), but you can also provide default values (defaultPref function) or even lock preferences (lockPref function).

Create /usr/lib/firefox/defaults/pref/all-local.js configuration file to read these settings during application startup.

It is counter-intuitive, but Firefox reads these files in reverse order. You just need to be sure that it will be read last (e.g. all-local.js will be read after all-personal.js and so on).
// local settings
pref("general.config.obscure_value", 0);
pref("general.config.filename", "local.cfg");

Additional information

Using global configuration to specify default values will allow users to override these settings.

$ cat ~/.mozilla/firefox/rf9c7vzq.default/prefs.js 
[...]
user_pref("trailhead.firstrun.didSeeAboutWelcome", true);
[...]

References