diff --git a/docs/configuration.rst b/docs/configuration.rst
index a876e34a..a7f95a6c 100644
--- a/docs/configuration.rst
+++ b/docs/configuration.rst
@@ -27,3 +27,33 @@ Most of the configuration that can be set through command line arguments can als
 environment variables. Here's a table of all the available environment variables:
 
 .. include:: env-options.rst
+
+
+
+.. _configuration-files:
+
+Configuration files
+-------------------
+
+Any of the configuration that can be set through command line arguments can also be set by a
+configuration file in the `config file <https://github.com/bw2/ConfigArgParse#config-file-syntax>`_
+format.
+Locust will look for ``locust.conf`` or ``~/.locust.conf`` by default, or a file may be specified
+with the ``--config`` flag. Parameters passed as command line arguments will override the settings
+from the config file.
+
+
+.. code-block::
+
+    # step_mode.conf in current directory
+    locustfile locust_files/my_locust_file.py
+    host localhost
+    users 100
+    hatch-rate 10
+    step-load
+    step-users 20
+    step-time 60
+
+.. code-block:: console
+
+    $ locust --config=step_mode.conf
diff --git a/docs/quickstart.rst b/docs/quickstart.rst
index d79f2677..2da12ff1 100644
--- a/docs/quickstart.rst
+++ b/docs/quickstart.rst
@@ -144,8 +144,10 @@ host defaults to 127.0.0.1):
     $ locust -f locust_files/my_locust_file.py --worker --master-host=192.168.0.100
 
 
-Parameters can also be set as :ref:`environment variables <environment-variables>`, or in a 
-`config file <https://github.com/bw2/ConfigArgParse#config-file-syntax>`_ (``locust.conf`` or ``~/.locust.conf``).
+Parameters can also be set as :ref:`environment variables <environment-variables>`, or in a
+`config file <https://github.com/bw2/ConfigArgParse#config-file-syntax>`_.
+Locust will look for ``locust.conf`` or ``~/.locust.conf`` by default, or a file may be specified
+with the ``--config`` flag.
 
 For example: (this will do the same thing as the previous command)
 
diff --git a/locust/argument_parser.py b/locust/argument_parser.py
index 3d0bf758..36ddd843 100644
--- a/locust/argument_parser.py
+++ b/locust/argument_parser.py
@@ -76,6 +76,8 @@ def get_empty_argument_parser(add_help=True, default_config_files=DEFAULT_CONFIG
         help="Python module file to import, e.g. '../other.py'. Default: locustfile",
         env_var="LOCUST_LOCUSTFILE",
     )
+    parser.add_argument('--config', is_config_file_arg=True, help='Config file path')
+
     return parser
 
 

Add --config parameter
<!-- 
If you have a general question about how to use Locust, please check Stack Overflow first https://stackoverflow.com/questions/tagged/locust

You can also ask new questions on SO, https://stackoverflow.com/questions/ask just remember to tag your question with "locust".
-->

### Is your feature request related to a problem? Please describe.
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
I would like to be able to have multiple config files stored in version control for different purposes (eg one that uses step-mode and one that doesn't).

### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen -->
`ConfigArgParse` makes it easy to add this capability. I think it could be done with a single line in `parse_options`:
`parser.add_argument('--config', is_config_file_arg=True, help='config file path')`

### Describe alternatives you've considered
<!-- A clear and concise description of any alternative solutions or features you've considered -->
Current workaround is to keep multiple sets of configurations in `locust.conf`, with the active one uncommented.

diff --git a/locust/test/test_main.py b/locust/test/test_main.py
index 34ef2bbe..c0065686 100644
--- a/locust/test/test_main.py
+++ b/locust/test/test_main.py
@@ -77,6 +77,40 @@ class TestLoadLocustfile(LocustTestCase):
         self.assertEqual(None, env.host)
         self.assertFalse(env.reset_stats)
 
+    def test_specify_config_file(self):
+        with temporary_file(textwrap.dedent("""
+            host = localhost  # With "="
+            u 100             # Short form
+            hatch-rate 5      # long form
+            headless          # boolean
+        """), suffix=".conf") as conf_file_path:
+            options = parse_options(args=[
+                "--config", conf_file_path,
+            ])
+            self.assertEqual(conf_file_path, options.config)
+            self.assertEqual("localhost", options.host)
+            self.assertEqual(100, options.num_users)
+            self.assertEqual(5, options.hatch_rate)
+            self.assertTrue(options.headless)
+
+    def test_command_line_arguments_override_config_file(self):
+        with temporary_file("host=from_file", suffix=".conf") as conf_file_path:
+            options = parse_options(args=[
+                "--config", conf_file_path,
+                "--host", "from_args",
+            ])
+            self.assertEqual("from_args", options.host)
+
+    def test_locustfile_can_be_set_in_config_file(self):
+        with temporary_file(
+            "locustfile my_locust_file.py",
+            suffix=".conf",
+        ) as conf_file_path:
+            options = parse_options(args=[
+                "--config", conf_file_path,
+            ])
+            self.assertEqual("my_locust_file.py", options.locustfile)
+
 
 class LocustProcessIntegrationTest(TestCase):
     def setUp(self):

pip install -e .
parse_log_pytest
pytest
codecov flake8 mock pyquery cryptography pytest
apt-get update apt-get install -y gcc
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///croot/attrs_1668696182826/work
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
charset-normalizer==3.4.1
click==8.1.8
codecov==2.1.13
ConfigArgParse==1.7
coverage==7.2.7
cryptography==44.0.2
cssselect==1.2.0
flake8==5.0.4
Flask==2.2.5
Flask-BasicAuth==0.2.0
flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core
gevent==22.10.2
geventhttpclient-wheels==1.3.1.dev3
greenlet==3.1.1
idna==3.10
importlib-metadata==4.2.0
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
itsdangerous==2.1.2
Jinja2==3.1.6
-e git+https://github.com/locustio/locust.git@5cad1cb5921ff84298d357e0a5ba42bdc0390acc#egg=locustio
lxml==5.3.1
MarkupSafe==2.1.5
mccabe==0.7.0
mock==5.2.0
msgpack==1.0.5
packaging @ file:///croot/packaging_1671697413597/work
pluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work
psutil==7.0.0
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pycodestyle==2.9.1
pycparser==2.21
pyflakes==2.5.0
pyquery==2.0.1
pytest==7.1.2
pyzmq==26.2.1
requests==2.31.0
six==1.17.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
typing_extensions @ file:///croot/typing_extensions_1669924550328/work
urllib3==2.0.7
Werkzeug==2.2.3
zipp @ file:///croot/zipp_1672387121353/work
zope.event==5.0
zope.interface==6.4.post2

name: locust
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=22.1.0=py37h06a4308_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - flit-core=3.6.0=pyhd3eb1b0_0
  - importlib_metadata=4.11.3=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=22.0=py37h06a4308_0
  - pip=22.3.1=py37h06a4308_0
  - pluggy=1.0.0=py37h06a4308_1
  - py=1.11.0=pyhd3eb1b0_0
  - pytest=7.1.2=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py37h06a4308_0
  - typing_extensions=4.4.0=py37h06a4308_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.11.0=py37h06a4308_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cffi==1.15.1
      - charset-normalizer==3.4.1
      - click==8.1.8
      - codecov==2.1.13
      - configargparse==1.7
      - coverage==7.2.7
      - cryptography==44.0.2
      - cssselect==1.2.0
      - flake8==5.0.4
      - flask==2.2.5
      - flask-basicauth==0.2.0
      - gevent==22.10.2
      - geventhttpclient-wheels==1.3.1.dev3
      - greenlet==3.1.1
      - idna==3.10
      - importlib-metadata==4.2.0
      - itsdangerous==2.1.2
      - jinja2==3.1.6
      - lxml==5.3.1
      - markupsafe==2.1.5
      - mccabe==0.7.0
      - mock==5.2.0
      - msgpack==1.0.5
      - psutil==7.0.0
      - pycodestyle==2.9.1
      - pycparser==2.21
      - pyflakes==2.5.0
      - pyquery==2.0.1
      - pyzmq==26.2.1
      - requests==2.31.0
      - six==1.17.0
      - urllib3==2.0.7
      - werkzeug==2.2.3
      - zope-event==5.0
      - zope-interface==6.4.post2
prefix: /opt/conda/envs/locust

locust/test/test_main.py::TestLoadLocustfile::test_command_line_arguments_override_config_file locust/test/test_main.py::TestLoadLocustfile::test_locustfile_can_be_set_in_config_file
locust/test/test_main.py::TestLoadLocustfile::test_specify_config_file
locust/test/test_main.py::TestLoadLocustfile::test_create_environment locust/test/test_main.py::TestLoadLocustfile::test_is_user_class locust/test/test_main.py::TestLoadLocustfile::test_load_locust_file_from_absolute_path locust/test/test_main.py::TestLoadLocustfile::test_load_locust_file_from_relative_path locust/test/test_main.py::TestLoadLocustfile::test_load_locust_file_with_a_dot_in_filename locust/test/test_main.py::TestLoadLocustfile::test_return_docstring_and_user_classes locust/test/test_main.py::LocustProcessIntegrationTest::test_default_headless_hatch_options locust/test/test_main.py::LocustProcessIntegrationTest::test_help_arg locust/test/test_main.py::LocustProcessIntegrationTest::test_web_options locust/test/test_main.py::LocustProcessIntegrationTest::test_webserver
docs/quickstart.rst locust/argument_parser.py docs/configuration.rst
docs/quickstart.rst locust/argument_parser.py docs/configuration.rst