Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Docker

How to Run Home Assistant in Docker on a VPS (Complete Container Guide)

By Freedom251 Team · · 12 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run Home Assistant on a VPS, use Home Assistant Container with Docker Engine 23.0.0 or later, a persistent /config mount, and Docker Compose. Start it on port 8123, finish onboarding in a browser, and put remote access behind Home Assistant Cloud, a VPN, or a correctly secured reverse proxy rather than casually forwarding the port.

This approach is portable and gives you control of the Linux and Docker stack, but you—not Home Assistant—must maintain the operating system, Docker, firewall, backups, upgrades, and recovery. Home Assistant OS remains the recommended installation type for most users because it is more integrated and provides apps that Container does not.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you are deploying

Home Assistant Container is the Docker installation of Home Assistant Core and its supporting services. The container image is replaceable; your installation survives because its configuration and database live in a directory on the VPS that is mounted at /config.

Home Assistant’s installation guidance recommends Home Assistant OS for most users. OS includes the managed host environment and access to Home Assistant apps. Container is the better fit when you already administer Linux and Docker, or when you specifically need a conventional VPS deployment that you can move between hosts. It does not provide the Home Assistant OS app system.

#1 Best Overall
Home Assistant | Smart Home hub with Advanced Automation | Official HomeAssistant ((4G+64G)+Hub)
  • Home Assistant provides a professional and reliable platform for home automation, designed to run continuously 24/7.
  • Powered by a 64-bit Quad-Core Cortex-A53 processor, delivering smooth and efficient performance for smart home automations.
  • Includes 4GB SDRAM for reliable multitasking and 64GB eMMC
  • Features a Mali-450 MP2 GPU for responsive visual interfaces, housed in a compact 85 × 85 × 15mm (3.35" × 3.35" × 0.59") design that fits easily in any space.
  • Typical power consumption is under 10W, with fanless operation for quiet performance suitable for any room in your home.

On a VPS, that choice transfers several responsibilities to you:

  • Operating-system updates, SSH hardening, users, and firewall rules.
  • Docker Engine and Compose updates.
  • Persistent storage, database growth, and disk monitoring.
  • Encrypted backups stored away from the VPS.
  • Recovery after a failed update, disk loss, provider outage, or account problem.
  • Any reverse proxy, VPN, DNS, TLS, or other remote-access layer.

No universal CPU, memory, disk, or provider minimum is published for this deployment. Size the VPS for the integrations you will run, recorder retention, database growth, and any services you host beside Home Assistant. Treat the provider, region, storage type, and capacity as operational decisions rather than official Home Assistant requirements.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prerequisites and a safe starting design

Requirement What to use Why it matters
Operating system A supported Linux VPS The documented procedure is for a Linux host, not Docker Desktop.
Container runtime Docker Engine 23.0.0 or later This is the version threshold in Home Assistant’s current Linux installation documentation.
Orchestration Docker Compose (the docker compose command) A Compose file is easier to review, update, and reproduce than a long one-line command.
Persistent storage A dedicated VPS path mounted to /config Configuration, the database, and other state must not remain in the disposable container layer.
Initial network path TCP port 8123 on the VPS, restricted to your setup source where possible Home Assistant listens there in the basic deployment; you can add a safer remote-access layer afterward.
Time zone A real tz database value, such as Europe/Amsterdam Correct timestamps are important for automations, logs, and recorder data.

Before installing, create a non-root administrative account, use SSH keys, apply available Linux security updates, and enable a host firewall. Allow SSH only as required and avoid opening 8123 to the entire internet while you are still configuring the service.

Install Docker Engine and Compose on the VPS

Use your Linux distribution’s supported Docker Engine installation method and verify the result before touching Home Assistant. Docker Desktop is not the runtime covered by the official Linux guide.

  1. Connect to the VPS over SSH with your administrative account.
  2. Install Docker Engine and the Compose plugin using the distribution-appropriate instructions.
  3. Confirm the engine version is at least 23.0.0 with docker version.
  4. Confirm Compose is available with docker compose version.
  5. Run a harmless test such as docker run --rm hello-world, then remove any test artifacts if your distribution leaves them behind.

Whether you allow your user to run Docker without sudo is a security decision. Membership in the Docker group effectively grants root-equivalent control of the host, so limit that membership to trusted administrators and protect their accounts.

Rank #2
Wall Mount Compatible with Home Assistant Green Smart Home Hub Holder (White)
  • Custom fit design provides a snug and secure hold for your compatible with Home Assistant Green, ensuring stability and easy access at eye level.
  • Space-saving wall installation helps declutter surfaces by moving your smart home hub off counters and onto the wall for a cleaner setup.
  • Durable construction crafted for reliable long-term use with quick and straightforward mounting on various wall surfaces.
  • Sleek minimalist style complements modern home aesthetics while keeping ports and displays accessible.
  • This product is a third-party accessory designed to be compatible with Home Assistant. Our products are not affiliated with, authorized, or endorsed by it and are mentioned for compatibility purposes only.

Create the persistent directory

Choose a path on durable VPS storage. For example, you might use /srv/homeassistant; the exact location is up to you. Keep it on storage that is included in your backup plan and monitor free space, because the recorder database and media can grow over time.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Create the directory: sudo mkdir -p /srv/homeassistant.
  2. Change into it: cd /srv/homeassistant.
  3. Decide how you will copy backups off the VPS before you begin relying on the instance.

Do not delete this directory when replacing the container. Recreating a container is normal; deleting the mounted directory is what destroys the state.

Write the Docker Compose file

Create /srv/homeassistant/compose.yaml with this baseline configuration. Replace /PATH_TO_YOUR_CONFIG with the absolute path you selected and set TZ to your actual tz database name.

services:
  homeassistant:
    container_name: homeassistant
    image: ghcr.io/home-assistant/home-assistant:stable
    volumes:
      - /PATH_TO_YOUR_CONFIG:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    stop_grace_period: 60s
    privileged: true
    network_mode: host
    environment:
      TZ: Europe/Amsterdam

What each setting does

  • Image: The stable tag follows the stable Home Assistant Container release when you pull it.
  • /config volume: Keeps YAML files, the database, integrations, logs, and other state outside the replaceable container layer.
  • /etc/localtime: Shares the host’s time-zone data read-only.
  • /run/dbus: Provides the D-Bus path used by integrations such as Bluetooth. It does not create Bluetooth hardware on a VPS that has none.
  • restart: unless-stopped: Restarts the service after a crash or host reboot, unless you deliberately stopped it.
  • stop_grace_period: 60s: Gives Home Assistant time to close files and shut down cleanly.
  • privileged: true: Grants broad device capabilities used by the documented Container example. Because this increases the container’s access to the host, keep the VPS hardened and do not add unrelated containers casually.
  • network_mode: host: Places Home Assistant on the host network. The basic setup therefore does not need a separate ports mapping and is reachable at port 8123.

Host networking and privileged mode are convenient for integrations, but they reduce isolation compared with a tightly restricted container. If you later redesign the deployment, test discovery and device integrations rather than removing these options blindly.

Start Home Assistant and complete onboarding

  1. From the directory containing compose.yaml, run docker compose up -d.
  2. Check that the container is running with docker compose ps.
  3. Open http://<host>:8123 from a browser that can reach the VPS.
  4. Create the first user, set the home location and time zone, and complete the onboarding screens.
  5. Review discovered integrations and remove or disable anything you do not intend to use.

The first start can take longer than later restarts while files and the database are created. If the page does not load, inspect docker compose logs --tail=200 homeassistant, verify that the process is listening on 8123, and check the VPS firewall and any provider-level network firewall.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Aqara Smart Hub M200, Matter Controller, Featuring Aqara Zigbee, Wi-Fi, IR
  • [Multi-Protocol Hub with Matter Bridge] The Aqara Hub M200 is a versatile smart hub that supports multiple advanced features, acting as a Matter Controller, Thread Border Router, and Matter Bridge. It integrates third-party devices into the Aqara Home app. With advanced Matter bridging functionality, it syncs Aqara-exclusive features with ecosystems like Home Assistant, Apple HomeKit, Alexa, and Google Home for seamless integration. Supports up to 40 Aqara Zigbee devices and 40 Thread devices.
  • [Smart IR Blaster with Feedback and Learning] The 360°IR blaster not only sends commands but also provides accurate status updates by detecting traditional remote use. It connects IR air conditioning units to Matter, functioning as an AC thermostat when paired with an Aqara Temperature and Humidity Sensor. (Note: Only one AC device can be exposed to Matter. Functionality may vary based on the Matter integration app. For Apple Home exposure, use Matter integration instead of HomeKit.)
  • [Wired & Wireless Connectivity with PoE Support] Enjoy flexible setup with dual-band Wi-Fi (2.4/5 GHz) using advanced WPA3 security, and Power over Ethernet (PoE), making the M200 a versatile PoE Ethernet Smart Home Hub. The USB-C port supports mini-UPS or power bank connections for uninterrupted operation, ensuring your energy-saving and security automations stay online. (*2A USB power adapter is not included. )
  • [Home Automation and Alarm System] Works with all Aqara devices to create a comprehensive, smart home automation system. The Aqara Hub M200 is equipped with a built-in speaker that can be used in a variety of ways: security alerts, doorbell, alarm clock, and custom audio messages. (** 𝐍𝐨𝐭 𝐭𝐡𝐢𝐫𝐝-𝐩𝐚𝐫𝐭𝐲 𝐙𝐢𝐠𝐛𝐞𝐞 𝐝𝐞𝐯𝐢𝐜𝐞𝐬)
  • [Local Automation for Reliable Performance] Supports local execution of automations for Zigbee and Matter devices, ensuring smooth operation even without Wi-Fi or cloud access. Enjoy millisecond response times for a more stable and reliable smart home experience. (Some automation, such as cloud push notifications, will still require the cloud connection to be executed.)

Design remote access before opening the service

Port 8123 is the default Home Assistant endpoint, not a complete internet-facing security solution. Home Assistant’s security guidance calls for a strong, unique password for every account, multi-factor authentication, restricted administrator access, careful secrets handling, and regular updates. A secrets.yaml file separates values from configuration, but it does not encrypt those values.

Access method How it works Main consideration
Home Assistant Cloud Provides a managed remote connection without opening router ports. The easiest path for many users, but it is a separate service and account.
VPN Creates a private network path to the VPS; examples include Tailscale or ZeroTier One. Every client that needs access must join and be secured on the VPN.
Reverse proxy Terminates TLS and forwards an authenticated hostname to Home Assistant. The proxy must have valid TLS, authentication, firewall rules, and correct trusted-proxy settings.
Direct port forwarding Publishes 8123 directly to the internet. It exposes the default port and leaves all hardening, monitoring, and abuse resistance to you; avoid it unless you understand the consequences.

If you use a reverse proxy

Configure the HTTP integration’s trusted proxies with the actual proxy address or network, not an unrestricted wildcard. Home Assistant must be able to distinguish headers supplied by your trusted proxy from headers that an internet client can forge. The public endpoint should require TLS, authentication, and a firewall policy; a proxy that is reachable without those controls is not a finished security design.

First-login security checklist

  • Use a long password that is not reused elsewhere.
  • Enable multi-factor authentication for every account that supports it.
  • Keep administrator accounts limited to people who need them.
  • Do not paste long-lived tokens or passwords into public configuration or support posts.
  • Review login notifications and remove old users and tokens.
  • Expose only the access layer you have deliberately configured.

Use Zigbee, Bluetooth, and other hardware from a VPS

A container does not automatically inherit hardware from the computer running Docker. This is the biggest practical difference between a local Home Assistant server and a cloud VPS.

USB serial radios

The documented Container pattern maps a serial device such as /dev/ttyUSB0 into the container and requires the container process to have permission to open it. An optional Compose fragment is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0

On a VPS with a physical USB port, identify the stable device path, map the correct device, and verify host permissions. Do not assume every reboot will preserve a changing device name; stable-by-path identifiers are preferable when your Linux host exposes them.

Rank #4
Home Assistant Green | Smart Home hub with Advanced Automation | Official Home Assistant Hardware
  • 💡 EASIEST WAY TO GET STARTED WITH HOME ASSISTANT - With Home Assistant already installed, it only requires plugging the included power supply and Ethernet cable to get started.
  • ✅ OFFICIAL - This official Home Assistant hardware is built and supported by Nabu Casa, the team driving the development of Home Assistant.
  • 🏡 DESIGNED FOR THE HOME - The small, fanless, and silent design packs a quad-core processor, 32GB of storage, and 4GB of RAM.
  • 📱 ONE HUB TO CONTROL THE WHOLE HOME - Cut down hub and app clutter and control your whole home from Home Assistant Green.
  • 🤖 AUTOMATE EVERYTHING - Make all the devices in your home work in harmony - have your lights dim when you start watching a movie, or turn off your heat when you’re away from home.

Why cloud VPS hardware often fails

Many cloud VPS products expose no physical USB controller at all. In that case, there is nothing for Docker to map, so buying a USB Zigbee stick does not solve the problem. Use a network-connected coordinator or a supported USB-over-IP design instead, and verify protocol support, network latency, failure behavior, and compatibility before committing to hardware. A coordinator that depends on a continuously reachable network path can affect automations when the VPS or the local network is unavailable.

Bluetooth

The base example maps /run/dbus read-only for D-Bus-based integrations. That mapping is useful only when the host actually provides a Bluetooth adapter and its service. A typical cloud VPS does not, so plan for a network-based alternative or keep Bluetooth-dependent devices on a local system.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Update Home Assistant Container safely

Treat an update as a change to a production service, not just an image download. Back up first, read the release notes between the version you run and the version you intend to install, and check for backward-incompatible changes.

  1. Create a Home Assistant backup and verify that it completed.
  2. Copy the encrypted backup off the VPS or confirm that your automated off-site process has a recent copy.
  3. Review every intervening release note, including configuration changes that affect your integrations and automations.
  4. From the Compose directory, pull the new stable image: docker compose pull homeassistant.
  5. Recreate the service: docker compose up -d.
  6. Watch startup output with docker compose logs -f homeassistant.
  7. In the Home Assistant interface, check Settings and repair issues, then test critical automations, dashboards, and remote access.

Beta and development image tags are documented for testing, but they are a poor default for a production VPS because instability or data corruption can make recovery harder. Keep the stable tag unless you have a specific test plan and a restore path.

If an update does not come back cleanly

  • Check the container status and the last 200 log lines.
  • Confirm the mounted configuration path is the same one used before the update.
  • Check disk space and inode availability on the VPS.
  • Look for a breaking configuration change in the release notes.
  • Stop further changes, preserve the current backup, and restore the previous known-good backup if the service or data is at risk.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Back up the instance and test recovery

Home Assistant backups are encrypted, compressed .tar archives. They are stored locally in /backup by default. A full backup includes config, share, addons, ssl, and media when those directories contain data.

Best Value
Besisglas Starter Kit for Home Assistant, Zigbee 3.0 Hub, 2 Zigbee Sensors
  • EASIEST WAY TO GET STARTED WITH HOME ASSISTANT: With Home Assistant already installed, it only requires plugging the included power supply and Ethernet cable to get started
  • DESIGNED FOR THE HOME: The small, fanless, and silent design packs a quad-core processor, 32GB of storage, and 4GB of RAM
  • ONE HUB TO CONTROL YOUR WHOLE HOME: Simplify your smart home with HA70. Built with official Home Assistant OS and a professional Zigbee coordinator, it brings local control, powerful automation, and seamless device management into one compact hub
  • AUTOMATE EVERYTHING: Make all the devices in your home work in harmony - have your lights dim when you start watching a movie, or turn off your heat when you're away from home
  • YOUR HOME, YOUR DATA: Your home's data will be kept in the home on your HomeAssistant. You can easily view, share, and export that data anywhere you want

A practical backup policy

  • Run a backup before every Home Assistant, Docker, operating-system, or database change.
  • Keep at least one encrypted copy outside the VPS. A provider outage, disk failure, deleted account, or billing problem can otherwise remove both the live service and its backup.
  • Protect the emergency kit or encryption key required to restore encrypted archives. An encrypted archive without its key is not a recovery plan.
  • Retain enough history to recover from a problem discovered days after an update, while monitoring storage usage.
  • Perform a restore drill on a separate test instance before treating the deployment as critical infrastructure.

What a restore drill should prove

  1. You can retrieve an off-site archive without logging into the original VPS.
  2. You can supply the required encryption material.
  3. The archive imports successfully into a clean Home Assistant instance.
  4. Your integrations, automations, dashboards, certificates, and media behave as expected after restoration.
  5. You know how to repoint DNS or your VPN to the recovered host.

Container on a VPS versus Home Assistant OS

The right choice depends less on raw performance than on who will maintain the host and which integrations you need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision axis Container on a VPS Home Assistant OS in a VM or on dedicated hardware
Maintenance You maintain Linux, Docker, firewalling, storage, and recovery. Home Assistant manages more of the appliance-style host experience.
Apps Home Assistant OS apps are not available to Container. Integrated app support is a major reason OS is recommended for most users.
Hardware Depends on VPS passthrough, network coordinators, or USB-over-IP. Direct USB and Bluetooth access is usually simpler on hardware you control.
Remote exposure You design the VPN, Cloud, reverse proxy, or forwarding layer. You still need a deliberate remote-access design, even on local hardware.
Backups Store Home Assistant archives off the VPS and protect the encryption key. Use the same off-site principle; local hardware is not a backup.
Recovery Provider replacement is quick if your Compose file and off-site backup are ready, but provider dependence remains. Recovery depends on the VM host or physical hardware and its replacement process.
Portability Compose plus a persistent directory can be moved to another Linux Docker host. More appliance-like, with migration depending on the VM or hardware platform.

Choose Container when you are comfortable operating Linux and Docker and your integrations can use hardware available to, or reachable from, the VPS. Choose Home Assistant OS when you want the integrated appliance experience, Home Assistant apps, and simpler local hardware support.

Troubleshooting common VPS problems

The browser cannot reach port 8123

  • Run docker compose ps and confirm the service is running.
  • Read docker compose logs --tail=200 homeassistant for startup errors.
  • Check the VPS firewall and the provider’s network firewall.
  • Confirm you are using the VPS address and port 8123, not a private address or an old DNS record.
  • If you placed a proxy or VPN in front, test that layer separately before changing Home Assistant.

The container starts with an empty installation

The usual cause is a wrong or relative host path in the volume mapping. Stop the service, verify the absolute path in compose.yaml, and confirm that it contains the expected configuration files. Do not initialize a second installation over the original directory.

Automations show the wrong time

Check the TZ value in Compose and the Home Assistant location setting. Use a tz database name, not an informal abbreviation that can mishandle daylight-saving changes.

A Zigbee stick or Bluetooth device is missing

Confirm that the VPS host can see the device first. Then verify the device mapping, permissions, and D-Bus availability inside the container. If the VPS has no physical device, switch to a network-connected coordinator or another supported architecture; Docker settings cannot create hardware that the provider does not expose.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The service fails after an update

Inspect logs, disk space, repair issues, and intervening release notes. If the cause is not quickly reversible, stop experimenting on the only copy, preserve your backup, and restore the last known-good archive on a clean or rolled-back host.

Operational checklist

  • Linux VPS with Docker Engine 23.0.0 or later and Compose installed.
  • Absolute, persistent /config path on monitored storage.
  • Stable Compose file kept with your infrastructure notes.
  • SSH keys, limited administrators, host firewall, and current Linux patches.
  • Strong unique account passwords and multi-factor authentication.
  • Remote access through Cloud, VPN, or a fully secured reverse proxy.
  • Hardware plan that accounts for the absence of USB and Bluetooth on many cloud VPS products.
  • Encrypted backups copied off the VPS, with the restore key protected separately.
  • Release-note review, backup, and post-update checks for every upgrade.
  • A tested restore procedure and a documented DNS or VPN cutover plan.

Bottom line

A Docker VPS is a sound Home Assistant deployment when you want portability and control and are prepared to operate the entire Linux-and-Docker stack. Mount /config persistently, use Compose with automatic restart, secure remote access deliberately, plan hardware integrations around what the provider actually exposes, and keep encrypted backups away from the VPS. If you want a more integrated appliance with Home Assistant apps and simpler local hardware access, Home Assistant OS is the better fit.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

DockerDocker ComposeHome AssistantLinuxself-hostingsmart homeVPS

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.