Self-hosted home automation backend, under the LGPLv3. MQTT device control, solar and heat-pump monitoring, floor-plan dashboards, scenario automation, an LLM voice assistant and tokenised guest links โ running on your own hardware, with no vendor cloud in the control path.
One JVM process, one PostgreSQL database, one MQTT broker. That is the whole system.
๐ myhab.orgโ ยท ๐ Documentationโ ยท ๐ป Sourceโ ยท ๐ Live demoโ
A complete, fully interactive installation runs at demo.myhab.orgโ with simulated devices answering on a real MQTT broker.
| Account | Credentials |
|---|---|
| User | demo / demo |
| Admin | demo-admin / demo-admin |
Data is shared between visitors and resets when idle.
| Tag | What it is |
|---|---|
latest | The most recent successful CI build. Convenient, but it can come from a pre-release branch โ pin a version for anything you care about. |
2.8.12, 2.8.11, โฆ | Release builds from master. Use these in production. |
2.8.12-a1b2c3 | Version plus short commit SHA โ pre-release builds from other branches. |
Platform: linux/amd64 only. There is no arm64 image, so a Raspberry Pi or an Apple
Silicon host needs to build its own (./gradlew buildImage on the target, or docker buildx build --platform linux/arm64).
| Base | eclipse-temurin:17-jre |
| Port | 8181 (HTTP โ put a TLS-terminating reverse proxy in front of it) |
| Volume | /app/config โ an external application.yml here is layered over the built-in defaults |
| Workdir | /app |
| Entrypoint | /app/app-entrypoint.sh โ java -jar /app/myhab.jar |
| Timezone | The JVM is pinned to UTC; set TZ for the container's local time |
| Health | GET /actuator/healthcheck |
The web client (Vue 3 + Quasar PWA) is bundled in the same jar and served from the same port โ there is no separate frontend container.
myHAB needs three things: a PostgreSQL database, an MQTT broker, and a git repository holding its runtime configuration.
Configuration lives in git rather than in the image, so you can change broker
credentials, feature flags and dashboard bindings without rebuilding or restarting
anything โ and you get a history of every change. Create a private repository (it holds
credentials) with one branch per environment; production reads prod by default.
mkdir myhab-config && cd myhab-config
git init -b prod
cat > config.yaml <<'YAML'
mqtt:
hostname: mosquitto
port: 1883
username: myhab
password: change-me
topics: myhab/#
cors:
allowedOrigin:
- https://home.example.com
ui:
meteo:
locationName: My Town
YAML
git add . && git commit -m "Initial myHAB configuration"
git push origin prod
services:
postgres:
image: postgres:16
environment:
POSTGRES_DB: myhab
POSTGRES_USER: myhab
POSTGRES_PASSWORD: change-me
volumes:
- pgdata:/var/lib/postgresql/data
restart: unless-stopped
mosquitto:
image: eclipse-mosquitto:2
volumes:
- ./mosquitto:/mosquitto/config
ports:
- "1883:1883"
restart: unless-stopped
myhab:
image: kirpi4ik/myhab:2.8.12 # pin a version; the badge above shows the newest
depends_on: [postgres, mosquitto]
ports:
- "8181:8181"
environment:
GRAILS_ENV: production
TZ: Europe/Bucharest
DB_URL: jdbc:postgresql://postgres:5432/myhab
DB_USERNAME: myhab
DB_PASSWORD: change-me
JWT_SECRET: <a long random string>
CFG_REPO_URI: https://github.com/you/myhab-config.git
CFG_USERNAME: <git user>
CFG_PASSWORD: <git token>
volumes:
- ./config:/app/config
restart: unless-stopped
volumes:
pgdata:
docker compose up -d
The schema is created on first start by Hibernate (dbCreate = update): it adds tables
and columns as the model grows, and never drops anything. Give it a minute, then check
http://localhost:8181/actuator/healthcheck.
There is no default admin user โ nothing is seeded, so nobody can log in until you insert an account. Generate a BCrypt hash:
htpasswd -bnBC 10 "" 'your-password' | tr -d ':\n'
Then, against the myhab database:
INSERT INTO sec_roles (id, version, authority) VALUES
(1, 0, 'ROLE_USER'),
(2, 0, 'ROLE_ADMIN')
ON CONFLICT DO NOTHING;
-- note: `users` has no version column
INSERT INTO users (id, username, password, first_name, last_name, email,
enabled, account_locked, account_expired, password_expired,
ts_created, ts_updated, en_type, language, timezone)
VALUES (1, 'admin', '<bcrypt hash>', 'Site', 'Admin', '[email protected]',
true, false, false, false, now(), now(), 'USER', 'en', 'UTC');
INSERT INTO sec_user_roles (user_id, role_id) VALUES (1, 1), (1, 2);
The join table is sec_user_roles, not users_sec_roles. Log in at
http://localhost:8181/ and create the rest of your users in the UI.
| Variable | Required | Purpose |
|---|---|---|
DB_URL | โ | JDBC URL, e.g. jdbc:postgresql://postgres:5432/myhab. ?TimeZone=UTC is appended if absent. |
DB_USERNAME | โ | Database user. |
DB_PASSWORD | โ | Database password. |
JWT_SECRET | โ | HS256 signing secret for API tokens. Long and random; changing it invalidates every session. |
CFG_REPO_URI | โ | Configuration git repository (https://โฆ or file:///โฆ). |
CFG_USERNAME | Git user for the configuration repository. | |
CFG_PASSWORD | Git token/password for the configuration repository. | |
GRAILS_ENV | production (the image default). | |
TZ | Container local time. Timestamps are stored in UTC regardless. |
Anything else โ job intervals, trusted proxies, vendor integrations โ goes either in the
configuration repository or in an application.yml inside the /app/config volume,
which Spring Boot layers over the image's defaults.
Terminate TLS at nginx/Caddy/Traefik and proxy to 8181. Tell myHAB which proxy it can
believe, or every audited action will be attributed to the proxy's own address โ in
/app/config/application.yml:
myhab:
security:
trustedProxies:
- 172.18.0.1
WebSocket upgrades must be passed through: real-time port state, dashboards and the voice assistant all use STOMP over WebSocket.
docker compose pull && docker compose up -d
Schema changes are applied at startup and are not reversible โ back up the database first. Read the release notes for the versions you are skipping: github.com/kirpi4ik/myhab/releasesโ .
kirpi4ik/myhab-demo carries the assets for the public demo sandbox built from the same
commit: the MQTT device simulator, the seed dataset and the configuration seed. It is
only useful if you are running a demo installation of your own โ a normal deployment
does not need it.
myHAB is developed under the GNU Lesser General Public License v3 (LGPLv3) โ gnu.org/licenses/lgpl-3.0.htmlโ .
Run it, modify it and deploy it freely, commercially included. Distributing a modified myHAB means releasing those modifications under the LGPLv3 as well; software that merely links against it keeps its own licence.
| Installation & configuration | myhab.org/docs/install.htmlโ |
| Every configuration key | myhab.org/docs/configuration.htmlโ |
| Supported devices & integrations | myhab.org/docs/integrations.htmlโ |
| Architecture | myhab.org/docs/architecture.htmlโ |
| FAQ | myhab.org/docs/faq.htmlโ |
Issues and pull requests: github.com/kirpi4ik/myhabโ .
Content type
Image
Digest
sha256:215b5c329โฆ
Size
248.6 MB
Last updated
5 days ago
docker pull kirpi4ik/myhab