Video coming soon…

🏠 Setup Home Assistant — Self-Hosted Home Automation

Deploy Home Assistant on Ubuntu with Docker — the world's leading open-source home automation platform connecting 3000+ smart devices with powerful automations, beautiful dashboards, and full local control.

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install script — Home Assistant running on your server in one command.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/iot/homeassistant/homeassistant-ubuntu.sh
chmod +x homeassistant-ubuntu.sh
sudo bash homeassistant-ubuntu.sh

Tutorial Steps

1 Download & Run the Script

The script installs Docker and starts Home Assistant Container. The web UI will be available on port 8123. First startup takes 2-3 minutes as Home Assistant downloads integrations and initializes its database.

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/iot/homeassistant/homeassistant-ubuntu.sh
chmod +x homeassistant-ubuntu.sh
sudo bash homeassistant-ubuntu.sh

2 Access the UI & Complete Onboarding

Open your browser and navigate to Home Assistant. The onboarding wizard guides you through creating your admin account, setting your home location (for sun-based automations), and selecting your time zone:

http://<your-server-ip>:8123

3 Add Integrations & Discover Devices

Go to Settings → Devices & Services → Add Integration. Home Assistant auto-discovers many devices on your local network (Philips Hue bridges, Chromecast, Sonos, etc.). For MQTT-based devices, add the MQTT integration and configure your broker. For Zigbee devices, add the ZHA integration and plug in your Zigbee USB coordinator:

# Expose USB Zigbee coordinator to the container (add to docker run or compose)
--device=/dev/ttyUSB0:/dev/ttyUSB0

4 Create Automations & Build Dashboards

Go to Settings → Automations to create your first automation using the visual editor. Define a trigger (motion sensor activated), add conditions (time between 8pm and 6am), and set actions (turn on lights at 50% brightness). Then go to Dashboards → Edit Dashboard to drag and drop widgets for lights, temperatures, cameras, and device states into a custom view.

Ports Used

PortPurpose
8123Home Assistant Web UI
1883MQTT broker (if using Mosquitto)
8883MQTT over TLS (optional)

Overview

Home Assistant is the world's most popular open-source home automation platform, powering smart homes for over 500,000 active users. It integrates with 3000+ devices and services — from smart lights and thermostats to security cameras and solar inverters — providing a single, unified interface for your entire home. Home Assistant runs locally on your own hardware: a Raspberry Pi, a mini PC, or any server running Docker. Unlike Amazon Alexa or Google Home, your automation data never leaves your home network. Automations trigger instantly, even without internet, because everything is local.

Why Use It

Home Assistant solves the fragmentation problem in smart home — you likely have devices from different manufacturers (Philips Hue lights, Xiaomi sensors, Nest thermostat, Ring doorbell) that each require their own app. Home Assistant connects all of them in one place, lets you build cross-brand automations (when the Aqara sensor detects motion, turn on the Hue lights and send a notification via Telegram), and eliminates cloud dependency for local devices. It also provides detailed historical graphs of every sensor value.

When You Need It

    Who Should Use It

      Real Use Cases

        Main Features

          How to Use After Installation

            Security Best Practices

              Ports and Firewall Notes

              Port 8123 (TCP) is the Home Assistant web UI — keep it internal (not exposed to internet). For remote access, use Nabu Casa, WireGuard, or Tailscale VPN rather than forwarding port 8123. If you deploy a Mosquitto MQTT broker alongside HA, port 1883 (MQTT) and 8883 (MQTT over TLS) should be internal only.

              Backup and Maintenance

                Common Mistakes

                  Troubleshooting

                    Alternatives

                    openHAB is an older, Java-based home automation platform with strong enterprise support. Domoticz is lightweight and runs on very low-power hardware. Apple HomeKit (via Home app) is excellent for Apple ecosystems but limited in cross-brand support. Amazon Alexa and Google Home are cloud-based with no self-hosting option. Home Assistant is the most actively developed, with the broadest integration ecosystem in the open-source space.

                    When Not to Use It

                    Avoid Home Assistant if you only have 1-2 smart home devices from a single brand — the manufacturer's app is simpler. Don't use it if you're not comfortable with occasional YAML editing or troubleshooting — HA has a learning curve, especially for advanced automations. For pure voice assistant use (just asking Alexa/Google to turn lights on), a commercial hub is simpler. Home Assistant shines for multi-brand, automation-heavy smart homes.

                    PrismaTechWork Professional Help

                    PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.

                      Contact Us

                      Frequently Asked Questions

                      What is Home Assistant and what can it control?

                      Home Assistant is a free, open-source home automation platform that runs locally on your own hardware. It integrates with 3000+ smart home brands and protocols including Philips Hue, IKEA Tradfri, Google Nest, Amazon Alexa, Apple HomeKit, Zigbee, Z-Wave, MQTT, and many more. You can control lights, thermostats, sensors, cameras, locks, switches, media players, and vacuum robots — all from one unified dashboard without cloud dependencies.

                      What is the difference between Home Assistant OS, Container, and Supervised?

                      Home Assistant OS (HAOS) is the recommended installation — a dedicated Linux OS optimized for Home Assistant with full add-on support and automatic backups. Home Assistant Container is a bare Docker container that runs the core only — no add-on store, but works on any Docker host (like your existing Ubuntu server). Home Assistant Supervised runs the full stack on a generic Debian system. The Docker (Container) install in this tutorial is the simplest for users already running Docker.

                      Can Home Assistant work without internet access?

                      Yes — local control is one of Home Assistant's biggest advantages. Unlike smart home hubs that require cloud connectivity, Home Assistant runs fully offline. Zigbee, Z-Wave, and local Wi-Fi devices work without internet. Cloud integrations (like weather forecasts or Google Assistant) still need internet, but your automations and local devices work regardless.

                      What is Zigbee2MQTT and do I need it?

                      Zigbee2MQTT is an open-source bridge that lets you connect Zigbee devices (like Philips Hue, IKEA Tradfri, and Aqara sensors) to Home Assistant without using the manufacturer's cloud hub. You need a Zigbee USB coordinator plugged into your server. Zigbee2MQTT passes device data via MQTT to Home Assistant. This is the recommended approach for full local control of Zigbee devices.

                      How does Home Assistant handle automations?

                      Home Assistant automations are triggered by events (a sensor detecting motion, the sun setting, a device changing state), run condition checks (it's after 8pm, no one is home), and execute actions (turn on lights, send a notification, run a script). You can create automations using the visual editor in the UI without coding, or write them in YAML for advanced control.

                      Can I access Home Assistant remotely outside my home network?

                      Yes. The easiest method is Home Assistant Cloud (Nabu Casa) — a paid subscription that handles secure remote access without port forwarding. For free self-hosted remote access: use a VPN like WireGuard or Tailscale to connect to your home network, then access Home Assistant on the local IP. Alternatively, put Home Assistant behind a reverse proxy (Caddy/Nginx) with HTTPS and expose it via a domain name.

                      What protocols does Home Assistant support for local smart home control?

                      Home Assistant supports Zigbee (via ZHA or Zigbee2MQTT), Z-Wave (via Z-Wave JS), Bluetooth (BLE sensors), MQTT (for ESP-based DIY sensors and many commercial devices), Wi-Fi (mDNS/Tuya/WLED), Matter/Thread (the new universal smart home standard), and many local LAN protocols. For USB-based protocols, pass the USB device into the Docker container with --device=/dev/ttyUSB0.

                      How do I back up Home Assistant?

                      In the Home Assistant Container install, the configuration lives in a mounted volume (e.g., /opt/homeassistant/config). Back it up by copying this directory regularly: tar -czf ha-backup-$(date +%Y%m%d).tar.gz /opt/homeassistant/config. For HAOS installs, the built-in backup tool creates .tar files that include all integrations, automations, and add-on configs.