Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/lissy93/adguardian-term/llms.txt

Use this file to discover all available pages before exploring further.

AdGuardian accepts four command-line flags for passing AdGuard Home connection details at launch time. Flags are an alternative to environment variables — when both are provided for the same field, the CLI flag takes precedence because welcome.rs calls env::set_var with the flag’s value, overwriting whatever was previously in the environment.

Supported flags

--adguard-ip
string
The IP address or hostname of your AdGuard Home instance. Equivalent to the ADGUARD_IP environment variable.
--adguard-port
string
The port that AdGuard Home’s HTTP API is listening on. Equivalent to the ADGUARD_PORT environment variable. Must be parseable as a valid u16 port number.
--adguard-username
string
Your AdGuard Home username, used for HTTP Basic authentication. Equivalent to the ADGUARD_USERNAME environment variable.
--adguard-password
string
Your AdGuard Home password. Equivalent to the ADGUARD_PASSWORD environment variable.
These are the only four CLI flags AdGuardian supports. The optional settings — ADGUARD_PROTOCOL, ADGUARD_UPDATE_INTERVAL, ADGUARD_TIMEOUT, and ADGUARD_QUERYLOG_LIMIT — have no corresponding flags and can only be configured via environment variables.

Usage example

adguardian -- \
  --adguard-ip "192.168.180.1" \
  --adguard-port "3000" \
  --adguard-username "admin" \
  --adguard-password "bobs-your-uncle"
The -- separator in the example above is a shell convention that signals the end of options for the invoking process. It is necessary when running through a wrapper such as cargo run (e.g. cargo run -- --adguard-ip 192.168.180.1) so that Cargo does not consume the flags itself. When invoking the compiled binary directly, -- is not required — AdGuardian’s argument parser simply scans all arguments for recognized flag names.

Precedence over environment variables

Internally, flag parsing in welcome.rs iterates over std::env::args() and, for each recognized flag, immediately calls env::set_var with the corresponding variable name. This means a flag value overwrites any same-named environment variable that was already set in the process environment. The effective precedence is:
CLI flag  >  environment variable  >  interactive prompt default
For example, if ADGUARD_IP is already exported as 10.0.0.1 in your shell and you also pass --adguard-ip 192.168.180.1, AdGuardian will connect to 192.168.180.1.
Any missing required values not supplied by flags or environment variables are collected through an interactive prompt at startup. AdGuardian will never silently skip a required field.
Typing four flags on every invocation becomes tedious quickly. For a persistent setup — especially on a home server or in a cron-like context — consider exporting the variables in your shell profile or storing them in a .env file. When running in Docker, pass them with -e flags or an environment block in your Compose file. See the Environment Variables and Docker Config pages for details.

Build docs developers (and LLMs) love