Self-host Home Assistant

Open-source home automation software that you run on your own hardware, here installed with the Container method. Run your own Home Assistant on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

Updated November 23, 2026

Running your own Home Assistant usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Home Assistant behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

Just ask your agent

Open a Plus workspace (Home Assistant runs in Docker, which Plus and Pro include), tap Launch to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

Set up Home Assistant on this workspace and give me the link. Follow https://envhaven.com/self-host/home-assistant.md

Then open the link it sends and create your Home Assistant account straight away, before anyone else finds the address. That is the whole request: the address in it is this page’s Markdown copy, and the agent follows the instructions for it further down, with every setting Home Assistant’s docs require.

Or keep it private with Tailscale

The preview URL puts Home Assistant on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Home Assistant an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace’s Vars pane as TS_AUTHKEY, and ask the agent:

Set up Home Assistant on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/home-assistant.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
  • A Tailscale container runs beside Home Assistant, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
  • Anything other services have to reach, such as a webhook, still needs a public address. Keep self-hosted apps private with Tailscale covers both, and what Tailscale’s free plan includes.
At a glance
What it isHome, money and everyday life
LicenseApache-2.0
Runs asDocker (ghcr.io/home-assistant/home-assistant:stable)
MemoryNot documented
Plan that fitsPlus or larger
Web port8123
Documentationwww.home-assistant.io/installation/linux/

What your agent takes care of

  • Installing it. Home Assistant runs from the official image, ghcr.io/home-assistant/home-assistant:stable, with its data in folders under ~/apps/home-assistant.
  • Putting it on an HTTPS address. The workspace’s preview URL serves it, and your own domain can too.
  • Locking it down first. What Home Assistant’s docs say to set before it faces the internet, below.
  • Telling you what to back up: /config (the host folder mounted at /PATH_TO_YOUR_CONFIG) and /config/home-assistant_v2.db (default SQLite database) (docs).

The settings it needs behind a proxy

  • Trust X-Forwarded-For (Settings > System > Network > HTTP server): Makes Home Assistant read the client address from the X-Forwarded-For header; without it, requests that come through a reverse proxy are blocked. (docs)
  • Trusted proxies (Settings > System > Network > HTTP server): Lists the proxy IP addresses or CIDR networks allowed to set X-Forwarded-For. (docs)
  • http: use_x_forwarded_for and http: trusted_proxies in configuration.yaml (Home Assistant before 2026.8): The same two settings as YAML keys; since 2026.8 an existing http: block is imported into the UI settings above. (docs)
  • Home Assistant URL, Internet field (Settings > System > Network): Tells Home Assistant the external address it is reached at from outside the local network. (docs)
  • Server port (HTTP server) and the SETUP_PORT environment variable: The port the web interface listens on; SETUP_PORT overrides the default at startup. (docs)
  • CORS allowed origins (HTTP server): Origins allowed to make cross-origin requests; include the scheme. (docs)
  • Proxy and CDN caching rules (not a Home Assistant setting): A CDN such as Cloudflare in front must not cache the live API and login paths. (docs)

Before it faces the internet

  • The first run shows an onboarding screen that creates the owner account, which is an administrator; finish it yourself before the address is exposed. (docs)
  • Owner credentials cannot be recovered. (docs)
  • Use strong unique passwords and multi-factor authentication before remote access. (docs)
  • The docs advise against exposing it directly to the internet. (docs)
  • Optional automatic IP banning after repeated failed logins. (docs)

Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

  • “Import last year’s data from the CSV I dropped into the workspace.”
  • “Set up a second account for the household.”
  • “Move Home Assistant to app.example.com.” Add the domain on the dashboard’s Domains page with a CNAME to domains.envhaven.app, and the agent changes Home Assistant’s address settings to match.
  • “Update Home Assistant to the latest release.” It pulls the new image and recreates the container, data kept.

Instructions for the agent

The agent reads these from the page’s Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

Set up Home Assistant on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, ghcr.io/home-assistant/home-assistant:stable, starting from the docs' compose file: https://www.home-assistant.io/installation/linux/#docker-compose. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- Keep the compose file in ~/apps/home-assistant and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Home Assistant's port 8123.
- The preview URL terminates HTTPS in front of Home Assistant: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/home-assistant.md for the preview URL, as Home Assistant's docs describe for running behind a proxy; skip any that apply only when Home Assistant serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/home-assistant.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Home Assistant up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.

What to know

  • In Docker, Home Assistant’s containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
  • Zeroconf (mDNS) discovery scans the network the host is attached to; a remote server has no home network to scan. (docs)
  • DHCP discovery watches the local network for DHCP requests; a remote server is not on that network. (docs)
  • SSDP/UPnP discovery relies on broadcasts from devices on the local network. (docs)
  • Integrations that talk directly to a device (local polling or local push) need a network path to that device; a remote server has none unless you add a VPN. (docs)
  • Cloud polling and cloud push integrations only need an internet connection, so they work from a remote server. (docs)
  • USB radios such as Zigbee sticks must be plugged into the host and mapped into the container; a remote server has no such device. (docs)
  • Bluetooth needs a local adapter reachable through D-Bus, which a remote server does not have. (docs)
  • The Container installation has no apps (formerly add-ons). (docs)
  • The documented compose file runs Home Assistant privileged and on the host network, so the host must allow both. (docs)
  • Home Assistant Cloud is the documented way to get remote access without a reverse proxy; its requests do not pass through the proxy settings. (docs)
  • Cloudflare is named as a CDN that does not cache HTML by default. (docs)
  • A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

Without a workspace

The manual route, on a server you run:

  1. Rent a Linux VPS, secure SSH, and create a user for the app.
  2. Install Docker and write a compose file from the official image.
  3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
  4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
  5. Keep the firewall closed except for the proxy, and schedule backups and updates.

Home Assistant’s own documentation covers each step for its install methods.

Sources

Facts about Home Assistant come from its own documentation, checked on 2026-11-23: