Where Does sing-box Store Its Config?
sing-box reads a JSON config you point it at, defaulting to /etc/sing-box/config.json on Linux installs.
Last updated
sing-box has no fixed home for its config. You hand it a file with -c or a directory with -C, and it runs with that. Package installs on Linux default to /etc/sing-box/config.json, which is the closest thing to a standard location.
Validate before reloading. sing-box check tests the file without starting anything, and sing-box format rewrites it cleanly. A typo in a routing rule fails silently at runtime far more often than it errors at startup, so the check step earns its keep.
Where sing-box stores this, by platform
/etc/sing-box/config.json
Default for package and service installs. Edit with sudo, then run sing-box check -c /etc/sing-box/config.json before restarting the service. OpenWrt wrappers generate this file from UCI instead.
<your folder>\config.json (passed with -c)
No default location. Keep the exe, config.json, and cache.db together and launch with sing-box run -c config.json. Scoop persists config.json, config.d, and cache.db across upgrades.
<your folder>/config.json (passed with -c)
Same explicit path approach as Windows. GUI frontends like NekoRay manage their own copies, so edit inside the frontend rather than hunting for a file it generated.
Frequently asked questions
How do I test a sing-box config without breaking my connection?
Run sing-box check -c config.json. It parses and reports errors without touching the running instance. Only restart the service after check passes. Keep the last working file as config.json.bak for fast rollback.
Can I split my sing-box config into multiple files?
Yes. Put fragments in a directory and launch with -C config.d, or merge them with sing-box merge. Fragments combine in filename order, which makes per-device overrides manageable.
Notice an outdated path? Let us know.