diff --git a/HISTORY.rst b/HISTORY.rst
index 759e36dc..6992470d 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -13,6 +13,7 @@ PlatformIO Core 5
- Improved support for private packages in `PlatformIO Registry `__
- Improved checking of available Internet connection for IPv6-only workstations (`pull #4151 `_)
+- Respect disabling debugging server from "platformio.ini" passing an empty value to the `debug_server `__ option
5.2.4 (2021-12-15)
~~~~~~~~~~~~~~~~~~
diff --git a/platformio/debug/config/base.py b/platformio/debug/config/base.py
index bcafa8fd..db7ddfba 100644
--- a/platformio/debug/config/base.py
+++ b/platformio/debug/config/base.py
@@ -153,7 +153,14 @@ class DebugConfigBase: # pylint: disable=too-many-instance-attributes
raise DebugInvalidOptionsError("Could not load a build configuration")
def _configure_server(self):
+ # user disabled server in platformio.ini
+ if "debug_server" in self.env_options and not self.env_options.get(
+ "debug_server"
+ ):
+ return None
+
result = None
+
# specific server per a system
if isinstance(self.tool_settings.get("server", {}), list):
for item in self.tool_settings["server"][:]: