Skip to main content
  1. Building Your Own Server/

Home Assistant - Self-Hosted Home Automation

·1011 words·5 mins

Home Assistant is a powerful, self-hosted home automation platform that gives you complete control over your smart home devices. This is an open source replacement for ecosystems like Google, Alexa, Ring, and Nest. These commercial services take data from inside your home and use it in there databases. If you want a smart home, you NEED to be in control of your home.

Inviting corporations into your home and allowing them to extract data on your private details, habits, and activities is a complete violation of the sanctuary of our homes. I know that it’s a very common thing to do. As the old saying goes:

If all your friends were to jump off a cliff invite corporate spyware into their home, would you jump too?

Why Home Assistant:

  • Your Home, Your Control: Your devices, your rules. No corporation controls your home automation.
  • Privacy First: Your smart home data stays on your own server, and not in a database. No one else can access your smart home data or build profiles about your habits.
  • Local Processing: Automation rules run locally, no cloud dependency. Your automation continues working even without internet access and it can’t be turned off remotely by corporate interests. '
  • Open Source: Transparent, community-driven, and free to use

Resources
#

Installation Prep
#

Before installing Home Assistant, ensure you have the following ready:

  • Operating System: Linux Mint
  • Container Runtime: Docker & Docker Compose
  • Hardware: Minimum 2GB RAM, 10GB Disk Space (more for camera feeds)
  • Network: Accessible from your local network (for device discovery)
  • Smart Devices: Zigbee, Z-Wave, or Wi-Fi devices (optional)

Alternatively, you can buy a reconfigured mini-server that’s plug and play ready to go. This is a great option for beginners and advanced users to get something that “just works”

Time to Complete
#

  • Total Time: ~30 minutes
    • 10 min: File system prep
    • 10 min: Docker setup
    • 5 min: Download Home Assistant image
    • 5 min: Initial setup and configuration

If you buy the pre-configured hardware, you are pretty much ready to go out of the box.

Installation
#

Step 1: File System Prep
#

We need to create the directories to keep the docker-compose file and Home Assistant configuration.

Create the Home Assistant directory

mkdir -p ~/docker/homeassistant/

Create the folders where your data will live:

mkdir -p ~/docker/homeassistant/config

This creates the following structure:

/home/USER/docker/homeassistant/config/    # Home Assistant configuration

Step 2: Docker Setup
#

Make sure you are in your Home Assistant directory:

cd ~/docker/homeassistant

To double check you are in the right place, type pwd to see your current directory.

Create the docker-compose.yaml file:

sudo touch docker-compose.yaml

Use the nano program to edit the file:

sudo nano docker-compose.yaml

Step 3: docker-compose file
#

Copy the following text into the docker-compose file:

version: "3.8"

services:
  homeassistant:
    container_name: homeassistant
    image: ghcr.io/home-assistant/home-assistant:stable
    volumes:
      - ./config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    network_mode: host
    environment:
      - TZ=America/Edmonton
    privileged: true

Important: Replace America/Edmonton with your timezone.

Save and exit the file by pressing Ctrl+X and saying Y to save.

Step 4: Start Home Assistant
#

Now you can download and start Home Assistant:

sudo docker-compose pull
sudo docker-compose up -d

Once the pull is complete, verify the containers are running:

docker ps

You should see homeassistant running.

Initial Setup and Configuration
#

Step 1: Access Home Assistant
#

Open your browser and navigate to the IP of your server. I’m using 192.168.99.1 in this example. This is the IP address of your custom server or the standalone server where Home Assistant is installed.

http://192.168.99.1:8123

Step 2: Create Your Account
#

  1. Create Account

    • Enter a username for your account
    • Enter a strong password
    • Click Create Account
  2. Login

    • Use your credentials to log in

Step 3: Set Up Your Home
#

  1. Name Your Home

    • Enter your home name (e.g., “Castle Awesome”)
    • Click Next
  2. Set Up Your Location

    • Enter your city or coordinates
    • Click Next
  3. Configure Units

    • Choose your preferred units (metric obviously)
    • Click Finish

Step 4: Add Devices
#

Home Assistant automatically discovers many devices on your network:

  1. Go to Settings > Devices & Services
  2. Click the + Add Integration button
  3. Search for your device type (e.g., “Philips Hue”, “Nest”, “Sonos”)
  4. Follow the prompts to add your device

Step 5: Create Automations (Optional)
#

  1. Go to Settings > Automations & Scenes
  2. Click the + Create Automation button
  3. Configure your automation:
    • Trigger: When a device state changes
    • Condition: If certain conditions are met
    • Action: What to do

Usage
#

Web Interface
#

The Home Assistant web interface (http://192.168.99.1:8123) provides:

  • Dashboard: Overview of your devices and automation
  • Devices: Manage all your connected devices
  • Automations: Create and manage automation rules
  • Scenes: Create device states for quick access
  • Logs: View system events and errors

Common Tasks
#

View Device Status:

  1. Check your dashboard for real-time device status
  2. Click on a device to see detailed information

Control a Device:

  1. Click on a device in the dashboard
  2. Use the controls to turn on/off, adjust settings

Create an Automation:

  1. Go to Automations & Scenes
  2. Click Create Automation
  3. Define trigger, condition, and action
  4. Click Save

View Logs:

  1. Go to Settings > System
  2. Click Logs
  3. View recent system events

Mobile App
#

Home Assistant has official apps for iOS and Android. This requires exposing your home automation server to the internet, and I would only do this if you know what you are doing.

Maintenance
#

Updates
#

Update Home Assistant and Docker images:

cd ~/docker/homeassistant
sudo docker-compose pull
sudo docker-compose up -d

Backups
#

Home Assistant stores its configuration in the config directory. To backup:

tar -czf homeassistant-backup.tar.gz ~/docker/homeassistant/config/

Store the backup in a safe location (external drive, your NAS).

View Logs
#

View Home Assistant logs:

sudo docker logs homeassistant

Reset to Factory Defaults
#

  1. Stop Home Assistant:
sudo docker-compose down
  1. Remove the config directory:
rm -rf ~/docker/homeassistant/config
  1. Start Home Assistant:
sudo docker-compose up -d

Regular Security Scans
#

Home Assistant includes a security scan:

  1. Go to Settings > System
  2. Click Health
  3. Review any warnings