Fixing Frigate ValueError not allowed to raise maximum limit in docker

If you see something like this when you start Frigate in docker:

frigate  | 2025-08-01 15:31:51.339115621  [2025-08-01 15:31:51] frigate.util.services          INFO    : Current file limits - Soft: 1073741816, Hard: 1073741816
frigate  | 2025-08-01 15:31:51.339723211  Traceback (most recent call last):
frigate  | 2025-08-01 15:31:51.339729801    File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
frigate  | 2025-08-01 15:31:51.339731301      return _run_code(code, main_globals, None,
frigate  | 2025-08-01 15:31:51.339737991    File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
frigate  | 2025-08-01 15:31:51.339740661      exec(code, run_globals)
frigate  | 2025-08-01 15:31:51.339742061    File "/opt/frigate/frigate/__main__.py", line 64, in <module>
frigate  | 2025-08-01 15:31:51.339759591      main()
frigate  | 2025-08-01 15:31:51.339760821    File "/opt/frigate/frigate/__main__.py", line 60, in main
frigate  | 2025-08-01 15:31:51.339762491      FrigateApp(config).start()
frigate  | 2025-08-01 15:31:51.339763622    File "/opt/frigate/frigate/app.py", line 592, in start
frigate  | 2025-08-01 15:31:51.339764662      set_file_limit()
frigate  | 2025-08-01 15:31:51.339765812    File "/opt/frigate/frigate/util/services.py", line 648, in set_file_limit
frigate  | 2025-08-01 15:31:51.339801612      resource.setrlimit(resource.RLIMIT_NOFILE, (new_soft, current_hard))
frigate  | 2025-08-01 15:31:51.339802812  ValueError: not allowed to raise maximum limit

Add the following to the bottom of the service definition:

services:
  frigate:
    container_name: frigate
    image: ghcr.io/blakeblackshear/frigate:stable
    # whatever config you have
    # add this below
    ulimits:
      nofile:
        soft: 65536
        hard: 65536

Last modified: Fri Aug 1 15:35:21 2025