Hosting Websites and Applications on Your Network with Nginx Proxy Manager in Home Assistant

Introduction

If you’re running Home Assistant, chances are you want full control over your smart home and network. But what if you also want to host your own websites or applications? Whether itโ€™s a personal blog, a self-hosted dashboard, or a private web app, the Nginx Proxy Manager (NPM) can help you securely expose services on your network.

In this guide, weโ€™ll walk through setting up Nginx Proxy Manager in Home Assistant to host and manage websites or applications on your home network with ease.

What is Nginx Proxy Manager?

Nginx Proxy Manager is a simple web-based tool that allows you to configure reverse proxies, manage SSL certificates, and control access to web applications. It acts as a gateway between your home network and the internet, ensuring security and ease of access.

Why Use Nginx Proxy Manager?

  • Host multiple websites on a single home network
  • Secure your sites with free SSL certificates via Letโ€™s Encrypt
  • Easily manage domains and subdomains
  • Control access with authentication options
  • Enable remote access for applications without exposing ports directly

Prerequisites

Before we begin, ensure you have the following:

  • Home Assistant running (Supervised, OS, or Docker installation)
  • A domain name (e.g., yourdomain.com)
  • A static IP or a dynamic DNS (DDNS) setup
  • A router with port forwarding capabilities

Step 1: Install Nginx Proxy Manager on Home Assistant

Method 1: Install via Home Assistant Add-ons (For Home Assistant OS/Supervised)

  1. Open Home Assistant and go to Settings > Add-ons > Add-on Store.
  2. Search for Nginx Proxy Manager and install it.
  3. Start the add-on and enable Start on boot.
  4. Open the Web UI to access the Nginx Proxy Manager dashboard.

Method 2: Install via Docker (For Home Assistant Container)

If you’re running Home Assistant in Docker, you can install NPM using the following command:

docker run -d \
  --name=nginx-proxy-manager \
  -p 80:80 \
  -p 81:81 \
  -p 443:443 \
  -v /path/to/data:/data \
  -v /path/to/letsencrypt:/etc/letsencrypt \
  jc21/nginx-proxy-manager

Replace /path/to/data with the directory where you want to store the NPM configuration.

Step 2: Configure Domain and Port Forwarding

  1. Set up your domain:
    • If you have a domain, create an A record pointing to your home IP.
    • If using DDNS (Dynamic DNS), configure it to update your dynamic IP automatically.
  2. Configure Port Forwarding:
    • In your router settings, forward ports 80 and 443 to the internal IP of the Nginx Proxy Manager.

Step 3: Add a Proxy Host

  1. Open Nginx Proxy Managerโ€™s Web UI (default is http://your-home-assistant-ip:81).
  2. Go to Hosts > Proxy Hosts and click Add Proxy Host.
  3. Enter your domain/subdomain (e.g., app.yourdomain.com).
  4. Set the Forward Hostname/IP as the local IP of the service you want to expose (e.g., 192.168.1.100).
  5. Set the Forward Port to the port of the web service (e.g., 8123 for Home Assistant).
  6. Enable Block Common Exploits and Websockets Support if needed.
  7. Under the SSL tab:
    • Select Request a new SSL Certificate (Letโ€™s Encrypt).
    • Enable Force SSL and HTTP/2.
  8. Click Save and wait for the certificate to be issued.

Step 4: Access Your Hosted Application

Now you can access your application securely using your domain name (e.g., https://app.yourdomain.com).

Optional: Secure Your Home Assistant with Nginx Proxy Manager

You can also use NPM to securely expose your Home Assistant dashboard without opening ports directly.

  1. Add a new Proxy Host with:
    • Domain Name: home.yourdomain.com
    • Forward Hostname/IP: 192.168.1.x (your HA IP)
    • Forward Port: 8123
    • Enable Websockets Support
  2. Enable SSL using Letโ€™s Encrypt.
  3. Access Home Assistant securely via https://home.yourdomain.com.

Conclusion

With Nginx Proxy Manager, you can easily manage and secure web services on your home network. Whether itโ€™s Home Assistant, a personal website, or a private application, NPM provides a user-friendly way to configure reverse proxies and SSL certificates.

If you found this guide helpful, feel free to share it! Happy home automation! ๐Ÿš€

Leave a Reply

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