TutorialsAugust 4, 20264 min read

How to Self-Host Home Assistant on a VPS

Home Assistant on a VPS gives you a cloud dashboard and secure remote access to your smart home. Here's how to install it with Docker — and what it can't do.

NBy Nxeon

Home Assistant is the leading open-source smart-home platform. Most people run it at home on a Raspberry Pi, but a VPS gives you a reliable cloud dashboard, off-site history and secure remote access. This guide installs the container version with Docker. First, an honest limitation you must understand.

The one big caveat: local radios

Home Assistant talks to many devices over local protocols — Zigbee, Z-Wave, Bluetooth and local-network discovery. A VPS is nowhere near your physical devices, so it can't drive those radios directly. A VPS install works brilliantly for:

  • Cloud-connected devices and integrations (anything with an API).
  • A remote dashboard and automations for cloud services.
  • A backup/aggregation instance alongside a home hub.

If you need local Zigbee/Z-Wave control, keep a hub at home and use this VPS instance for remote access or as a secondary. With that clear, let's install.

Prerequisites

  • A VPS with Docker installed — run Docker on a VPS.
  • A domain with an A record, e.g. home.example.com.

Deploy Home Assistant Container

mkdir -p ~/homeassistant && cd ~/homeassistant
services:
  homeassistant:
    image: ghcr.io/home-assistant/home-assistant:stable
    container_name: homeassistant
    restart: unless-stopped
    volumes:
      - ./config:/config
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "8123:8123"
docker compose up -d

Browse to http://your-server-ip:8123 and complete the onboarding wizard to create your account.

The Nxeon game-server control panel — live console, player slots, and TPS
The Nxeon game-server control panel — live console, player slots, and TPS

Secure remote access

A smart-home dashboard is exactly what you don't want exposed insecurely. Front it with Caddy for HTTPS:

home.example.com {
    reverse_proxy 127.0.0.1:8123
}

You'll also need to tell Home Assistant it's behind a proxy. Add this to config/configuration.yaml:

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.16.0.0/12
    - 127.0.0.1

Restart the container, then lock the firewall:

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable

For extra safety, consider reaching it only over a VPN — set up WireGuard on a VPS and keep port 8123 off the public internet entirely.

Add integrations and automations

Under Settings → Devices & Services, add integrations for your cloud services and APIs. Then build automations in the visual editor — "if the sun sets, turn on the porch light", "notify me if a sensor reports offline". Enable two-factor authentication on your account while you're in settings.

What works brilliantly on a cloud VPS

Even without local radios, a VPS Home Assistant is powerful when you lean into cloud and network integrations:

  • Anything with an API or webhook: weather, energy tariffs, calendars, delivery tracking, RSS and hundreds of cloud device integrations.
  • Presence and notifications: trigger automations from phone location and push rich notifications to the companion app.
  • Dashboards: build a beautiful Lovelace dashboard you can reach securely from anywhere — a real advantage over a Pi tucked behind your home router.
  • A remote frontend for a home hub: run local devices on a Pi at home and use this VPS instance purely for reliable remote access.

Backups and add-ons

Back up the config directory regularly — it holds every automation, dashboard and integration setting:

tar czf ha-backup-$(date +%F).tar.gz ~/homeassistant/config

Note that the Container install used here doesn't include the Supervisor add-on store. To run extra services (a database, Node-RED, an MQTT broker), you add them as their own Docker containers alongside Home Assistant and connect them over the Docker network — exactly the pattern the rest of this stack already uses.

A secure remote-access pattern that works

The cleanest architecture for a cloud Home Assistant treats remote access as the headline feature. Put the whole thing behind your reverse proxy for HTTPS, require strong login with two-factor, and for maximum safety reach it only over a VPN so the dashboard is never directly exposed:

  1. Stand up WireGuard on the same VPS and add your phone and laptop as clients.
  2. Bind Home Assistant to the internal network and keep port 8123 off the public firewall entirely.
  3. Connect the VPN when you want to check in — your dashboard, cameras and automations are all reachable, privately.

This gives you the convenience of cloud access with none of the exposure of an open dashboard. If you'd rather not run a VPN, the HTTPS-plus-2FA setup earlier is the minimum bar — never put Home Assistant on the internet without both.

FAQ

Can Home Assistant run on a VPS?

Yes, the container version runs anywhere Docker does. The limitation is local radios (Zigbee/Z-Wave/Bluetooth) — those need hardware near your devices, so cloud integrations are the VPS sweet spot.

Is it safe to expose Home Assistant to the internet?

Only behind HTTPS with strong auth and two-factor enabled — or, safer still, behind a VPN. Never expose port 8123 directly without TLS.

VPS or Raspberry Pi for Home Assistant?

A Pi at home is best for local device control; a VPS is best for remote access, reliability and cloud integrations. Many people run both.

Which install type is this?

This is Home Assistant Container. It doesn't include the add-on store (that's Home Assistant OS/Supervised), but it's the clean, portable choice for a VPS.

Run your smart-home brain on a reliable NVMe VPS with full root access, and secure it with your own VPN server.

#home-assistant#smart-home#docker#self-hosting#automation#seobatch

Deploy your first server in under a minute

Creating an account is free and takes no card details. You pay when you deploy — choose a billing term and pay from your wallet or by card at checkout.