How do I disable web_server?

This is my config:

esphome:
  name: chicken-coop
  friendly_name: Chicken Coop

esp32:
  board: esp32dev
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:
  - platform: esphome
    password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Chicken-Coop Fallback Hotspot"
    password: !secret fallback_password

captive_portal:
    
output:
  - platform: gpio
    pin: GPIO23
    id: led
  - platform: gpio
    pin: GPIO32
    id: relay_pin_1
  - platform: gpio
    pin: GPIO33
    id: relay_pin_2
  - platform: gpio
    pin: GPIO25
    id: relay_pin_3
  - platform: gpio
    pin: GPIO26
    id: relay_pin_4

# # Define the switches based on the relay pins
switch:
#   - platform: output
#     id: relay_1
#     name: "Relay 1"
#     output: relay_pin_1
#   - platform: output
#     id: relay_2
#     name: "Relay 2"
#     output: relay_pin_2
  - platform: output
    id: relay_3
    name: "Relay 3"
    output: relay_pin_3
  - platform: output
    id: relay_4
    name: "Relay 4"
    output: relay_pin_4

button:
  - platform: output
    name: "Open Coop Door"
    id: button_1
    icon: "mdi:door-open"
    output: relay_pin_1
    duration: 500ms
  - platform: output
    name: "Close Coop Door"
    id: button_2
    icon: "mdi:door-closed"
    output: relay_pin_2
    duration: 500ms

binary_sensor:
  - platform: gpio
    name: "Coop Door"
    device_class: door
    pin:
      number: GPIO4
      inverted: true
      mode: INPUT_PULLUP
  - platform: gpio
    name: "Coop Alarm Buzzer Output"
    pin:
      number: GPIO13
      mode: INPUT_PULLUP
  - platform: gpio
    name: "Coop Alarm LED Output"
    pin:
      number: GPIO14
      mode: INPUT_PULLUP
sensor:
  - platform: adc
    name: "Coop Photocell"
    pin: 34


## The following makes the right LED `D14` blink every .5 seconds
# interval:
#   - interval: 1000ms
#     then:
#       - output.turn_on: led
#       - delay: 500ms
#       - output.turn_off: led

By my understanding the webserver at chicken-coop.local should not be enabled since I didn’t explicitly enable it, however it is enabled. How do I disable it?

I think maybe it’s related to the esp-idf framework as my config is similar to other projects I have that don’t show the webserver. I think if I turn off captive_portal it will shut it down, but I’d like that fallback available.

I suppose I could just add auth to the webserver, but I’m also just interested to know why its running. Is it just an undocumented quirk (intentional or not?) with esp-idf?

It’s probably captive_portal because it uses a webpage to configure wifi.

What’s got me confused is that captive portal is enabled on my other devices, but no web server on those. They don’t have framework defined.

I noticed the webserver coming up on a BLE proxy I set up recently and disabling captive portal did disable it.

I guess I can work around this via auth, or disabling captive_portal, but I’d like to put a mention in the docs if it’s a thing. Seems like it might be a thing, just undocumented as far as I could find.

Are you aware of a way to disable web_server while retaining captive_portal?

Delete OTA

Have you tried using a clean build files?

I gave clean build files a try, no dice. Webserver still comes up.

Would I still be able to do OTA update via the ESPHome dashboard?

Did you go from arduino to esp-idf by OTA rather than USB? Perphaps a manual/USB reflash might work.

Nope. I started this one on esp-idf.

@Karosm some of the comments in your link describe what I’m experiencing.

I deleted my post when I noticed this topic was yours about the same subject.
Good luck.

Don’t advise people to do that unless you know they don’t need ota.

Anyway, how about a log file of the device starting up.

Here you go.

Log
======================== [SUCCESS] Took 227.20 seconds ========================
INFO Successfully compiled program.
INFO Connecting to 192.168.107.204 port 3232...
INFO Connected to 192.168.107.204
INFO Uploading /data/build/chicken-coop/.pioenvs/chicken-coop/firmware.bin (992608 bytes)
Uploading: [============================================================] 100% Done...

INFO Upload took 4.57 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.107.204 using esphome API
INFO Successfully connected to chicken-coop @ 192.168.107.204 in 7.243s
INFO Successful handshake with chicken-coop @ 192.168.107.204 in 0.078s
[14:16:15][I][app:100]: ESPHome version 2025.4.1 compiled on May 10 2025, 14:15:33
[14:16:15][C][wifi:600]: WiFi:
[14:16:15][C][wifi:428]:   Local MAC: F0:24:F9:F5:24:08
[14:16:15][C][wifi:433]:   SSID: [redacted]
[14:16:15][C][wifi:436]:   IP Address: 192.168.107.204
[14:16:15][C][wifi:439]:   BSSID: [redacted]
[14:16:15][C][wifi:441]:   Hostname: 'chicken-coop'
[14:16:15][C][wifi:443]:   Signal strength: -50 dB ā–‚ā–„ā–†ā–ˆ
[14:16:15][C][wifi:447]:   Channel: 11
[14:16:15][C][wifi:448]:   Subnet: 255.255.255.0
[14:16:15][C][wifi:449]:   Gateway: 192.168.107.1
[14:16:15][C][wifi:450]:   DNS1: 192.168.28.15
[14:16:15][C][wifi:451]:   DNS2: 0.0.0.0
[14:16:15][C][logger:177]: Logger:
[14:16:15][C][logger:178]:   Max Level: DEBUG
[14:16:15][C][logger:179]:   Initial Level: DEBUG
[14:16:15][C][logger:181]:   Log Baud Rate: 115200
[14:16:15][C][logger:182]:   Hardware UART: UART0
[14:16:15][C][gpio.output:010]: GPIO Binary Output:
[14:16:15][C][gpio.output:011]:   Pin: GPIO23
[14:16:15][C][gpio.output:010]: GPIO Binary Output:
[14:16:15][C][gpio.output:011]:   Pin: GPIO32
[14:16:15][C][gpio.output:010]: GPIO Binary Output:
[14:16:15][C][gpio.output:011]:   Pin: GPIO33
[14:16:15][C][gpio.output:010]: GPIO Binary Output:
[14:16:15][C][gpio.output:011]:   Pin: GPIO25
[14:16:15][C][gpio.output:010]: GPIO Binary Output:
[14:16:15][C][gpio.output:011]:   Pin: GPIO26
[14:16:15][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Coop Door'
[14:16:15][C][gpio.binary_sensor:015]:   Device Class: 'door'
[14:16:15][C][gpio.binary_sensor:016]:   Pin: GPIO4
[14:16:15][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Coop Alarm Buzzer Output'
[14:16:15][C][gpio.binary_sensor:016]:   Pin: GPIO13
[14:16:15][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Coop Alarm LED Output'
[14:16:15][C][gpio.binary_sensor:016]:   Pin: GPIO14
[14:16:15][C][output.switch:068]: Output Switch 'Relay 3'
[14:16:15][C][output.switch:090]:   Restore Mode: always OFF
[14:16:15][C][output.switch:068]: Output Switch 'Relay 4'
[14:16:15][C][output.switch:090]:   Restore Mode: always OFF
[14:16:15][C][output.button:010]: Output Button 'Open Coop Door'
[14:16:15][C][output.button:010]:   Icon: 'mdi:door-open'
[14:16:15][C][output.button:011]:   Duration: 0.5s
[14:16:15][C][output.button:010]: Output Button 'Close Coop Door'
[14:16:15][C][output.button:010]:   Icon: 'mdi:door-closed'
[14:16:15][C][output.button:011]:   Duration: 0.5s
[14:16:15][C][adc.esp32:058]: ADC Sensor 'Coop Photocell 34'
[14:16:15][C][adc.esp32:058]:   Device Class: 'voltage'
[14:16:15][C][adc.esp32:058]:   State Class: 'measurement'
[14:16:15][C][adc.esp32:058]:   Unit of Measurement: 'V'
[14:16:15][C][adc.esp32:058]:   Accuracy Decimals: 2
[14:16:15][C][adc.esp32:059]:   Pin: GPIO34
[14:16:15][C][adc.esp32:061]:   Attenuation: auto
[14:16:15][C][adc.esp32:080]:   Samples: 1
[14:16:15][C][adc.esp32:081]:   Sampling mode: average
[14:16:15][C][adc.esp32:082]:   Update Interval: 60.0s
[14:16:15][C][adc.esp32:058]: ADC Sensor 'Coop Photocell 35'
[14:16:15][C][adc.esp32:058]:   Device Class: 'voltage'
[14:16:15][C][adc.esp32:058]:   State Class: 'measurement'
[14:16:15][C][adc.esp32:058]:   Unit of Measurement: 'V'
[14:16:15][C][adc.esp32:058]:   Accuracy Decimals: 2
[14:16:15][C][adc.esp32:059]:   Pin: GPIO35
[14:16:15][C][adc.esp32:061]:   Attenuation: auto
[14:16:15][C][adc.esp32:080]:   Samples: 1
[14:16:15][C][adc.esp32:081]:   Sampling mode: average
[14:16:15][C][adc.esp32:082]:   Update Interval: 60.0s
[14:16:15][C][captive_portal:089]: Captive Portal:
[14:16:15][C][web_server:285]: Web Server:
[14:16:15][C][web_server:286]:   Address: chicken-coop.local:80
[14:16:15][C][mdns:116]: mDNS:
[14:16:15][C][mdns:117]:   Hostname: chicken-coop
[14:16:15][C][esphome.ota:073]: Over-The-Air updates:
[14:16:15][C][esphome.ota:074]:   Address: chicken-coop.local:3232
[14:16:15][C][esphome.ota:075]:   Version: 2
[14:16:15][C][esphome.ota:078]:   Password configured
[14:16:15][C][safe_mode:018]: Safe Mode:
[14:16:15][C][safe_mode:019]:   Boot considered successful after 60 seconds
[14:16:15][C][safe_mode:021]:   Invoke after 10 boot attempts
[14:16:15][C][safe_mode:022]:   Remain in safe mode for 300 seconds
[14:16:15][C][api:140]: API Server:
[14:16:15][C][api:141]:   Address: chicken-coop.local:6053
[14:16:15][C][api:143]:   Using noise encryption: YES
[14:16:16][D][sensor:093]: 'Coop Photocell 35': Sending state 0.13778 V with 2 decimals of accuracy
[14:16:32][D][esp-idf:000][wifi]: W (25665) wifi:
[14:16:32][D][esp-idf:000][wifi]: [ADDBA]rx delba, code:39, delete tid:0
[14:16:32][D][esp-idf:000][wifi]: 

[14:16:47][D][esp-idf:000][wifi]: W (40706) wifi:
[14:16:47][D][esp-idf:000][wifi]: [ADDBA]rx delba, code:39, delete tid:0
[14:16:47][D][esp-idf:000][wifi]: 

[14:17:02][D][esp-idf:000][wifi]: W (55748) wifi:
[14:17:02][D][esp-idf:000][wifi]: [ADDBA]rx delba, code:39, delete tid:0
[14:17:02][D][esp-idf:000][wifi]: 

[14:17:08][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[14:17:08][D][esp32.preferences:114]: Saving 1 preferences to flash...
[14:17:08][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[14:17:10][D][sensor:093]: 'Coop Photocell 34': Sending state 0.14544 V with 2 decimals of accuracy
[14:17:16][D][sensor:093]: 'Coop Photocell 35': Sending state 0.14159 V with 2 decimals of accuracy

Thanks! It’s a good lead still, even if just to indicate that there may be something different about how esp-idf handles the web_server when it isn’t explicitly configured.

Agreed, but it was supposed to be an experiment to see which component was adding the web_server.

How do you post a dropdown like that?

It’s in the gear cog menu of the text editor, ā€œhide detailsā€. It sure is nice to tuck away a big log or config.

It works on GitHub too, but over there you gotta add a line break before the code block line if you’re posting code or it breaks the code block for some reason.

[details="Summary"]
This text will be hidden
[/details]

I noticed it too. The Web server is activated on the ESP32 BLE Proxy if you add a captive_portal.
I performed an experiment like this: I created a BLE proxy using a ESPhome Ready-Made Projects. Then I got control over the device configuration and added only one line:

captive_portal:

And an active Web server appeared on the device.
Then I added this section:

esp32:
  board: esp32dev
  framework:
    type: arduino

And the Web server disappeared.
It seems to me that this is either a feature of the esp-idf framework or a bug.

It is not clear how to maintain the functionality of the captive_portal on a BLE proxy if it is recommended not to use a Web server for a BLE proxy device?

1 Like

Thanks for testing that out! Feature or bug, it doesn’t seem like it’s widely known.

Probably time to escalate it to GitHub.

Sounds like it. I’ll link it here when I get a chance, but any else feel free as well.

Also have this issue with ESP-IDF and Bluetooth proxy depite not having web server enabled.