Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon 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 Now×
Skip to content
VGSources
Blog

How to Run Home Assistant in Docker on a VPS

A complete, security-first guide to running Home Assistant Container on a Linux VPS, including Compose deployment, remote access, hardware limits, upgrades, and recovery.
WorldDocker on a VPS Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run Home Assistant Container on a Linux VPS with Docker Engine 23.0.0 or newer, Docker Compose, and a persistent /config bind mount. Start with host networking and port 8123, secure remote access through Home Assistant Cloud, a VPN, or a correctly configured reverse proxy, and keep encrypted backups somewhere other than the VPS.

This deployment gives you control of the Linux and Docker stack, but you—not a Home Assistant appliance—must maintain the operating system, firewall, Docker updates, backups, recovery process, and any hardware connectivity.

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.

Choose the right Home Assistant installation type

Home Assistant offers several installation methods. Home Assistant OS is the recommended installation type for most users because it integrates the operating system, supervisor functions, and app ecosystem into one managed appliance. Home Assistant Container is different: it is a Docker image that you operate yourself and it does not provide access to Home Assistant apps.

A VPS is a natural fit for the Container method because the VPS already supplies a Linux host and virtualized hardware on which you can install Docker. The trade-off is administrative responsibility. You must patch Linux, update Docker, enforce firewall rules, monitor storage, protect credentials, create backups, and recover the service when something fails. If you want the integrated appliance experience, run Home Assistant OS on a supported physical machine or inside a virtual machine instead.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

What Container includes—and what it does not

  • The Home Assistant application and its configuration are delivered in a Docker image.
  • Your configuration and database live in a host directory that you mount at /config.
  • Home Assistant OS apps are not available in a Container installation.
  • USB radios and other host hardware are not automatically visible inside the container.
  • Linux, Docker, networking, backups, and hardening remain your responsibility.

VPS prerequisites and sizing

Required software

Use a Linux VPS with Docker Engine 23.0.0 or later. Install Docker Compose as well; the Compose plugin lets you keep the deployment definition in a readable, repeatable file instead of relying on a long one-line docker run command. The official Linux procedure does not use Docker Desktop, so Docker Desktop is not the runtime covered by these instructions.

CPU, memory, disk, and region

Home Assistant’s installation guide does not publish one universal CPU, RAM, disk, or VPS-provider minimum for Container. Size the machine around the work you actually plan to run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Integrations and polling frequency determine CPU and memory demand.
  • Recorder retention, camera events, statistics, and the database determine disk growth.
  • Longer retention and media-heavy automations need more storage than a small sensor-only installation.
  • Choose a region and provider with a network path that gives you acceptable latency to your users and any cloud services you integrate.

Treat those choices as an operations decision rather than an official Home Assistant minimum. Leave headroom for the operating system, Docker image downloads, temporary files, and backup archives.

Initial host preparation

Create a non-root administrative account, apply the Linux distribution’s security updates, configure a host firewall, and enable only the ports you intentionally need. Keep SSH restricted to your administration method, use key-based authentication where possible, and do not expose Docker’s management socket to the internet. Make sure the VPS clock is synchronized; accurate time matters for authentication, logs, certificates, and automations.

Deploy Home Assistant with Docker Compose

1. Create a persistent configuration directory

Choose a path on the VPS that is backed by durable storage. The directory must survive container replacement and image updates. For example:

sudo mkdir -p /srv/homeassistant/config
sudo chown -R "$USER":"$USER" /srv/homeassistant

Use a location appropriate to your distribution and storage layout. Do not put important data only in the container’s writable layer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

2. Write compose.yaml

In the deployment directory, create compose.yaml with this service definition. Replace /PATH_TO_YOUR_CONFIG with the absolute path you selected and set TZ to a real tz database identifier for the location whose local time your automations should use.

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

Keep the file readable only by administrators if it later contains sensitive environment values or additional credentials. The example uses the stable image tag; do not substitute a beta or development tag on a production VPS unless you explicitly accept instability and possible data corruption.

3. Start the container

From the directory containing compose.yaml, run:

docker compose up -d

Docker downloads the image, creates the container, and starts it in the background. With host networking, Home Assistant listens directly on the VPS network stack. Open http://<host>:8123 in a browser, replacing <host> with the VPS address, and complete onboarding.

Why these Compose settings matter

Setting Purpose
/PATH_TO_YOUR_CONFIG:/config Keeps configuration, integrations, and the recorder database outside the disposable container layer.
/etc/localtime:/etc/localtime:ro Shares the host’s time-zone data read-only.
/run/dbus:/run/dbus:ro Provides the D-Bus path used by integrations such as Bluetooth when the host supports them.
restart: unless-stopped Restarts the service after a crash or host reboot until you deliberately stop it.
stop_grace_period: 60s Allows Home Assistant up to 60 seconds to shut down cleanly.
privileged: true Matches the official basic Container example but grants broad container privileges; review whether your security policy permits it.
network_mode: host Avoids a separate port-publishing rule in the basic setup and lets Home Assistant use the host network directly.
TZ Sets the container’s time-zone environment for logs and time-based behavior.

Host networking and privileged mode make the basic example convenient, but they also reduce isolation compared with a tightly restricted container. If you change them, test discovery, Bluetooth, webhooks, and every integration you rely on before considering the deployment complete.

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

Make remote access a deliberate design

Port 8123 is suitable for initial setup on a trusted path; it is not a security strategy by itself. Decide how users will reach Home Assistant before opening anything to the public internet.

Approach How it works Main trade-off
Home Assistant Cloud Provides a managed remote connection without requiring you to open router ports. Convenient and managed, but dependent on an external service and subscription terms.
VPN A private tunnel, such as one built with Tailscale or ZeroTier One, lets authorized devices reach the private Home Assistant address. Reduces public exposure, but every client needs VPN enrollment and the VPN must be maintained.
Reverse proxy Terminates HTTPS at a proxy and forwards requests to Home Assistant. Flexible for custom domains, but certificates, authentication, firewalling, and proxy trust must all be correct.
Direct port forwarding Publishes Home Assistant’s port 8123 directly to the internet. Simple to understand but exposes the default service port and leaves you responsible for comprehensive hardening.

For most people, Home Assistant’s documentation describes its Cloud option as the easiest and safest choice. A VPN is a strong alternative when you control all client devices. A reverse proxy can be appropriate for a carefully managed domain, while direct forwarding should be reserved for operators who understand the exposure and can enforce a rigorous security policy.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Reverse-proxy requirements

When a proxy sits in front of Home Assistant, configure the HTTP integration’s trusted proxies with the proxy’s actual source addresses. An incorrectly configured trust list can break client-IP handling or create an opportunity for forged forwarded headers. A proxy reachable from the public internet without TLS, authentication, and a firewall policy is incomplete. Verify certificate renewal, restrict administrative routes, and test that an untrusted network cannot bypass the proxy controls by reaching port 8123 directly.

Harden accounts, secrets, and the VPS

Use a strong, unique password for every Home Assistant account and enable multi-factor authentication. Restrict administrator privileges to the people who need them; create ordinary user accounts for routine access. Apply updates to Home Assistant, Docker, and the Linux host on a planned schedule, and monitor logs for repeated authentication failures.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Do not reuse your Home Assistant password on the VPS, email, or other services.
  • Store tokens and passwords outside public configuration files where practical, and limit file permissions.
  • Remember that secrets.yaml keeps values out of the main configuration but does not encrypt them.
  • Use firewall rules that allow only required inbound traffic, such as SSH from an administration source and HTTPS through your chosen access layer.
  • Keep Docker’s socket and administrative APIs off the public internet.
  • Review accounts and long-lived access tokens when staff, family members, or devices change.

Connect Zigbee, Bluetooth, and other hardware from a VPS

A container does not automatically gain access to the physical devices attached to your computer. This matters on a VPS because many cloud products provide no physical USB port to the guest at all.

Zigbee and serial radios

The official Container example maps a serial device such as /dev/ttyUSB0 into the container and requires the container process to have permission to access it. A typical Compose addition looks like this:

    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0

The exact device path can differ after a reboot or hardware change, so prefer a stable device identifier where your Linux distribution provides one and confirm permissions before pairing devices. If your VPS has no USB passthrough, attach the coordinator to a reachable network-connected host or use a supported USB-over-IP design. Check latency, disconnect behavior, encryption, and compatibility before purchasing hardware; a radio link that works on a local machine can be unreliable across a WAN.

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

Bluetooth

Bluetooth integrations depend on the host’s Bluetooth adapter and D-Bus access. The Compose example’s read-only /run/dbus mapping is part of that design, but it cannot create Bluetooth hardware that the VPS provider does not expose. Confirm that the provider supports the required device passthrough, or place Bluetooth hardware on another network host and use an integration designed for that topology.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Update Home Assistant Container safely

1. Back up first

Create a Home Assistant backup and store a copy away from the VPS before changing the image. Do not rely on a backup that remains on the same virtual disk as the live service.

2. Read the release path

Review every release note between your installed version and the target version, not only the newest note. Look for backward-incompatible configuration changes, database migrations, integration removals, and required manual actions.

3. Pull and recreate the stable container

docker compose pull homeassistant
docker compose up -d

Because /config is persistent, recreating the container does not discard your configuration or recorder database. Watch the startup output and allow migrations to finish.

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

4. Verify after the update

  • Open Home Assistant and check the Repairs section for actionable issues.
  • Inspect the container log with docker logs homeassistant for startup errors, failed migrations, or missing devices.
  • Test authentication, dashboards, automations, notifications, webhooks, and critical integrations.
  • Confirm that your remote-access layer still reaches the service and that certificates remain valid.

Beta and development image tags are intended for operators who accept instability and possible corruption. They are poor defaults for a production VPS that controls locks, alarms, heating, or other safety-critical equipment.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Backups, off-site copies, and 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 where those directories exist in the installation.

Use the VPS only as one backup location

A provider outage, disk failure, deleted account, or billing problem can remove both your running instance and any backup stored beside it. Copy backups to storage in a different failure domain, protect that destination with access controls, and encrypt data in transit and at rest. Keep the emergency kit or encryption key required to restore encrypted archives; an encrypted backup without its recovery material is not a usable backup.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Practice restoration

Perform a restore drill before you depend on the system. Use a separate test instance or a maintenance window, restore an archive, verify that integrations and automations load, and record the exact steps. A backup is evidence of recoverability only after you have successfully restored one.

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

Troubleshoot common VPS deployment failures

The browser cannot open port 8123

  1. Check that the container is running with docker compose ps.
  2. Read startup errors with docker logs homeassistant.
  3. Confirm the VPS firewall allows the path you are using and that the provider’s network firewall does too.
  4. Verify that Home Assistant is listening on the expected address and that you are using the VPS’s current IP or hostname.
  5. If a reverse proxy or VPN is involved, test direct access from the private path before debugging the proxy.

Configuration disappears after recreation

Inspect the bind mount in compose.yaml. It must point to the persistent host directory and use an absolute path. A typo can cause Docker to create a new empty directory, making the replacement container appear to have lost data.

Devices are missing

Confirm that the host can see the hardware, that the device mapping matches the current path, and that the container user has permission. On a cloud VPS with no USB passthrough, changing Compose syntax cannot solve the absence of physical hardware; move the coordinator to a network-connected host or choose a platform that supports the required device.

The container will not stop cleanly

Check logs for a blocked integration or database operation. The 60-second stop grace period gives Home Assistant time to close files and connections; repeatedly killing the container risks corruption. Resolve the integration problem before the next upgrade and verify the backup taken before the change.

Container on a VPS compared with Home Assistant OS

Decision factor Container on a VPS Home Assistant OS on a VM or dedicated hardware
Maintenance You maintain Linux, Docker, firewalling, storage, and recovery. More of the operating system and Home Assistant platform are integrated and managed together.
Apps Home Assistant OS apps are not available. Includes the integrated app ecosystem.
Portability Compose and a persistent configuration directory make migration between Linux hosts straightforward. Migration depends on the VM or appliance platform and its storage image.
Hardware access Requires explicit device mapping and provider support; cloud VPS USB access is often unavailable. Direct hardware or VM passthrough is usually easier to arrange.
Remote exposure Usually involves a public VPS address, VPN, Cloud, or reverse proxy; firewall design is yours. Still requires secure remote access, but the host topology may be simpler on a private network.
Backup location Local archives reside on the VPS unless you export them. Backups depend on the appliance or VM storage plan and still need an off-site copy.
Provider dependence Outage, account loss, or network policy can interrupt the service and hardware access. Physical ownership can reduce provider dependence but shifts hardware maintenance to you.

Operational checklist

  • Linux VPS with Docker Engine 23.0.0 or later and Docker Compose installed.
  • Persistent, writable host directory mounted at /config.
  • Correct tz database value in TZ.
  • restart: unless-stopped and a deliberate shutdown grace period.
  • Firewall rules that expose only the access path you selected.
  • Strong unique passwords, multi-factor authentication, restricted administrators, and protected secrets.
  • Remote access through Cloud, VPN, or a fully hardened reverse proxy rather than casual port exposure.
  • Explicit device mappings and permissions for any serial or Bluetooth hardware.
  • Backups created before upgrades, copied off the VPS, and restorable with the required encryption material.
  • Release notes reviewed and post-update Repairs, logs, automations, and integrations tested.

For a Linux administrator who values control and portability, Home Assistant Container on a VPS is a practical deployment. It is not a managed Home Assistant appliance: its reliability depends on disciplined host maintenance, secure remote access, explicit hardware planning, and a recovery process that has been tested before an outage.

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.

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.

Leave a Reply

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

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.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

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.