Remote-access Guide

home assistant remote access nginx

by Magnus Gutkowski Published 2 years ago Updated 1 year ago
image

access your Home Assistant remotely using DuckDNS, Letsencrypt and the nginx SSL proxy

  • open up ports for nginx in your router. Go to your home router admin page and find the port forwarding section. Forward...
  • edit your configuration.yaml to permit nginx. The Home Assistant docs suggest editing configuration.yaml as follows. The...

Install the Nginx Proxy add-on
  • Install the NGINX Home Assistant SSL proxy add-on from the Hass.io add-on store and configure it with your DuckDNS domain.
  • All other settings can remain default.
  • Start the add-on and wait until Nginx is running. You may need to refresh the logs a few times.
Sep 19, 2021

Full Answer

How to start, stop, or restart Nginx?

  • start: The Nginx service is started.
  • stop: This command terminates the Nginx service.
  • restart: The Nginx service is stopped and subsequently restarted.
  • reload: Restarts the Nginx service gracefully. ...
  • status: Displays the current state of the service.

How to secure home assistant?

  • Choose a new port for Home Assistant. ...
  • Setup a subdomain for your Home Assistant. ...
  • Setup an SSL Certificate. ...
  • Blocking Traffic Not Originating From Cloudflare. ...
  • Allow Proxy Requests to Home Assistant. ...
  • Using the Cloudflare Firewall. ...
  • Setup Two Factor Authentication. ...
  • Conclusion. ...

How to reload and restart Nginx?

  • start: Starts the Nginx service.
  • stop: Terminates the Nginx service.
  • restart: Stops and then starts the Nginx service.
  • reload: Gracefully restarts the Nginx service. On reload, the main Nginx process shuts down the child processes, loads the new configuration, and starts new child processes.
  • status: Shows the service status.

How to setup Nginx as a service?

To configure Nginx with AlwaysUp:

  • Download and install AlwaysUp, if necessary.
  • Download the Nginx zip file and extract it to a new directory, if necessary. ...
  • Start AlwaysUp.
  • Select Application > Add to open the Add Application window:
  • On the General tab: In the Application field, enter the full path to the Nginx executable. ...

More items...

image

What is the security advice for Home Assistant?

Security advise: be sure that Home Assistant users have a strong password set, this is very important (ie. long password using numbers, letters and punctuation marks).

Do you have shell access as root?

You have shell access as root or as a user with sudo privileges.

How to install Nginx Home Assistant?

Go to Home Assistant > Supervisor > Add-on Store > Install NGINX Home Assistant SSL proxy. (BTW you don’t need to install the Letsencrypt add-on). Type your DuckDNS subdomain for the domain entry. All else can be left as is. (Do not install the similar sounding nginx Proxy Manager for this). Start the nginx add-on. Wait some minutes after you start the add-on. Read the Log tab nearby and hope for only happy messages there.

How to simulate connecting to your home assistant remotely?

To simulate connecting to your Home Assistant remotely, disconnect your phone from your home wifi and use a browser to try out YOUR-SUBDOMAIN.duckdns .org in the browser. You don’t need to add the port number to the URL because nginx is doing that for you (indeed, it’s acting as a proxy). Here is what to do if it works first time, or if it doesn’t

What happens if DuckDNS fails?

If it fails, your certificate or broadband IP address will go out of date and nginx will fail too.

How to find your home network?

You can do that by firstly having an easy to remember network name (e.g myhome.duckdns.org). Create an account at duckdns.org, choose an easily remembered subdomain and get the token (or long password) from your DuckDNS page.

Is Home Assistant useful?

The Home Assistant home automation hub is more useful if you can access it remotely. There’s an excellent phone app to access Home Assistant in addition to anywhere access with a browser URL. A bit of nginx magic achieves this but the resulting benefits are not only great, the mobile app can access sensors (GPS; battery, status) in your phone for very useful information.

Can you use DuckDNS on your phone?

When the DuckDNS add-on is running, you’ll be able to use your phone to access your home network from anywhere. However, as well as port forwarding there’s still more to do if you want this to happen securely. If you also want to connect to other devices, in addition to Home Assistant, on your home network you’re on the wrong page see using nginx proxy manager with home assistant

image
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9