How to use an Appium server config file

Long Appium server commands are easy to drift between local terminals, launch scripts, and CI jobs. A project config file keeps the server bind address, port, logging style, and startup-only options in one file before the server process starts.

Appium can read JSON, YAML, JavaScript, and CommonJS config files. The recommended auto-discovered filename is .appiumrc.json, and --config points Appium at an explicit file when the server is launched from another directory.

Server configuration belongs under the top-level server key, and option names use the same kebab-case spelling as the command line. Capabilities still belong in the client or Inspector session request, not in the server config file; command-line options override the same file values for one run.

Steps to use an Appium server config file:

  1. Open a terminal in the project root that should own the server settings.
  2. Create an Appium config file.
    $ vi .appiumrc.json
  3. Add the server settings under the server key.
    .appiumrc.json
    {
      "server": {
        "address": "127.0.0.1",
        "port": 4725,
        "log-level": "info",
        "log-no-colors": true
      }
    }

    The same option names work in YAML or JavaScript config files. JSON is a good project default because Appium searches for .appiumrc.json automatically.

  4. Validate the JSON before starting the server.
    $ python3 -m json.tool .appiumrc.json
    {
        "server": {
            "address": "127.0.0.1",
            "port": 4725,
            "log-level": "info",
            "log-no-colors": true
        }
    }
  5. Start Appium with the config file.
    $ appium --config .appiumrc.json
    [Appium] Welcome to Appium v3.5.0
    [Appium] Non-default server args:
    [Appium] { address: '127.0.0.1', loglevel: 'info', logNoColors: true, port: 4725 }
    [Appium] Appium REST http interface listener started on http://127.0.0.1:4725
    [Appium] No drivers have been installed in ~/.appium. Use the "appium driver" command to install the one(s) you want to use.
    [Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.

    The no-drivers and no-plugins lines are expected when this check uses a server-only Appium install. They do not prevent the server status endpoint from responding.

    A command-line option such as --port overrides the same key in the file for that one server run.

  6. Query the configured status endpoint from another terminal.
    $ curl --silent http://127.0.0.1:4725/status
    {"value":{"ready":true,"message":"The server is ready to accept new connections","build":{"version":"3.5.0"}}}
  7. Stop the verification server in the original terminal with Ctrl-C.
  8. Commit or document the config file with the project launch instructions.

    Do not store access tokens, signing credentials, or service-account secrets in the Appium server config file. Keep secrets in the CI secret store or a local environment file that is excluded from source control.