Run luxtronik2-modbus-proxy as a systemd service on Linux.
Use systemd if:
- You have a Linux server (Raspberry Pi, NAS, home server) that does not run Docker
- You prefer native service management with
systemctl - You want the proxy to start automatically at boot without a container runtime
Use Docker if:
- You already use Docker on your server
- You want container isolation and easy updates
- You prefer a single-file deployment with
docker compose
See the User Guide for the Docker installation path.
- A Linux system with systemd (most modern Linux distributions)
- Python 3.10 or newer
pipsudoaccess to install the service file
Install from PyPI:
pip install luxtronik2-modbus-proxyOr install directly from the GitHub repository:
pip install git+https://github.com/OWNER/PUBLIC-luxtronik2-modbus-proxy.gitAfter installation, verify the command is available:
luxtronik2-modbus-proxy --versionRun the proxy as a dedicated non-root system user for security:
sudo useradd -r -s /bin/false luxtronik-proxyThis creates a system account (-r) with no login shell (-s /bin/false). The proxy process will run as this user.
Create the configuration directory and copy the example file:
sudo mkdir -p /etc/luxtronik2-modbus-proxy
sudo cp config.example.yaml /etc/luxtronik2-modbus-proxy/config.yaml
sudo nano /etc/luxtronik2-modbus-proxy/config.yamlAt minimum, set luxtronik_host to your heat pump's IP address:
luxtronik_host: "192.168.x.x" # Replace with your heat pump IPSee the User Guide for a description of all configuration fields.
Give the service user read access to the config file:
sudo chown root:luxtronik-proxy /etc/luxtronik2-modbus-proxy/config.yaml
sudo chmod 640 /etc/luxtronik2-modbus-proxy/config.yamlCopy the provided service file template to the systemd directory:
sudo cp contrib/luxtronik2-modbus-proxy.service /etc/systemd/system/If you installed from PyPI without cloning the repository, download the service file directly:
sudo curl -o /etc/systemd/system/luxtronik2-modbus-proxy.service \
https://raw.githubusercontent.com/OWNER/PUBLIC-luxtronik2-modbus-proxy/main/contrib/luxtronik2-modbus-proxy.serviceReload systemd and enable the service to start at boot:
sudo systemctl daemon-reload
sudo systemctl enable --now luxtronik2-modbus-proxyThe --now flag starts the service immediately in addition to enabling it at boot.
sudo systemctl status luxtronik2-modbus-proxyA healthy service shows active (running). If it shows failed, check the logs (see below).
Follow live log output:
journalctl -u luxtronik2-modbus-proxy -fShow the last 50 log lines:
journalctl -u luxtronik2-modbus-proxy -n 50The proxy uses structlog with JSON output, which journald captures automatically. You should see proxy_starting, proxy_running, and recurring poll_cycle_complete events.
You can override any configuration value using environment variables, without editing config.yaml. This is useful when the same config file is shared across environments.
Create an environment file at /etc/luxtronik2-modbus-proxy/env:
sudo nano /etc/luxtronik2-modbus-proxy/envAdd KEY=VALUE pairs using the LUXTRONIK_ prefix. For example:
LUXTRONIK_HOST=192.168.x.x
LUXTRONIK_POLL_INTERVAL=60
LUXTRONIK_LOG_LEVEL=DEBUG
The service file already contains EnvironmentFile=-/etc/luxtronik2-modbus-proxy/env (the - prefix makes it optional — the service starts even if the file does not exist).
After editing the env file, restart the service:
sudo systemctl restart luxtronik2-modbus-proxyCheck the full log output immediately after the failure:
journalctl -u luxtronik2-modbus-proxy -n 100 --no-pagerLook for error or exception events. Common causes:
- Config file not found: verify
/etc/luxtronik2-modbus-proxy/config.yamlexists and is readable by theluxtronik-proxyuser - Invalid YAML: open the config file and check for indentation or syntax errors
- Python not found at the path in
ExecStart: runwhich luxtronik2-modbus-proxyas root to find the correct path, then update the service file
Port 502 is a privileged port (below 1024) that requires root or a capability grant. Options:
- Grant the capability to the Python binary (recommended):
sudo setcap 'cap_net_bind_service=+ep' $(which python3)
- Or change
modbus_portto a non-privileged port (e.g., 5020) inconfig.yamland update your evcc/HA config to use that port.
Verify the path in the service file matches where you placed config.yaml:
grep ExecStart /etc/systemd/system/luxtronik2-modbus-proxy.serviceIf the path differs, edit the service file and reload:
sudo systemctl daemon-reload
sudo systemctl restart luxtronik2-modbus-proxysystemd rate-limits services that restart repeatedly. The service file includes StartLimitIntervalSec=60 and StartLimitBurst=3 to prevent restart loops. If the proxy is failing on startup due to a config error, fix the error first before trying to restart:
journalctl -u luxtronik2-modbus-proxy -n 50
# Fix the config error, then:
sudo systemctl reset-failed luxtronik2-modbus-proxy
sudo systemctl start luxtronik2-modbus-proxy