Getting started by installing in AWS

HI Guys,

Absolutely an amateur and have been looking into getting setup with HOME assistant for our new house. Have looked around to see if I could find help in installing HOME ASSISTANT in AWS.

Could someone point me in the right direction as i want to install home assistant in the cloud. also would love to see what should i look out for and where should i start from.

1 Like

Hi @nareshserai I’m happy to help you with this. May I first ask you why do you consider deploying Home Assistant on AWS? Why do you consider it to be a good idea?

Remember that cloud providers have a cost and the price for a solution like this will run between $50~$70 USD per month, depending on the services used. About $40 for a 24/7 VPN connection and $10 for a small sized server. You can add a separated instance for your database and that will cost an additional $20. I created a calculation so you can see the breakdown in details. You can reduce the cost by paying everything upfront or going with smaller instances. You can also reduce the cost by disabling the VPN when you are sleeping, but this would kill automations and data collection.

So my point is: if paying the price of a good sized NUC every year to have your HA on AWS is not a problem for you, I highly encouraged you doing it so as it gives you resources that you simply can’t (or will struggle to) have on a standard deployment. E.g: SMS notifications, (proper) database backups, high availability…

I intend to run it on AWS EC2 instance on a free tier. I have Ubuntu 20.0.4 server installed.

Yes, you can get a t3.micro for free (limited to 12 months) on the free tier, but there’s something you should keep in mind: not all services are available on the free tier, and there’s a crucial service that is required (not 100% required, but highly recommended) and it’s not part of the free tier.

The problem with having HA on an EC2 instance is that you need to have it connect to you home network so it’s able to connect to whatever you have locally, like hubs and IP devices, and scan it for discovery services. And how you allow an external resource to be connected to your network? A VPN.

Sure you can install OpenVPN on the t3.micro instance, but now you have a small instance running a database engine, HA, OpenVPN, and all other add-ons you might consider in the future. The t3.micro might not be a good candidate for all of this. And what’s even worse: the instance has to be exposed to the internet so you can open your VPN tunnel to your home network.

Now, if you use AWS VPC to segment your network, you can have the VPC’s VPN connecting to your home network and your EC2 instance deployed on a private subnet. The VPC’s VPN is not part of the free tier and it will set you back around $40/month.

And just to be clear about something: I’m discouraging you from using AWS. I just want you to be aware of all the costs involved.

And you didn’t give me the “why”. Why do you consider important to have HA on AWS?

1 Like

Dont really have a solid reason, was trying not to have another piece of hardware installed in the house if i could get away with a free tier setup. More so was trying to get my hands dirty with home assistant and AWS at the same time.

If you suggest not to go AWS route I do have a few spare i5 based PCs sitting around or a raspberry pi3 sitting around as well. Happy to use them as an alternate method. Sorry its my first time. Trying to do this so dont know what I dont know. I really appreciate your help.

I would definitely recommend a local setup using one of your i5 PCs.

1 Like

Thank you @tom_l

I agree with @tom_l: the i5 will give you more flexibility and you won’t depend on a 24/7 VPN connection to flip a light switch. But when your HA installation grows, you should consider AWS for other things. Here’s a couple of examples of how you can integrate AWS with your HA instance:

  1. Backup everything on an Amazon S3 bucket. Because S3 is very cheap and you pay for what you use, it’s a cost-effective backup solution for HA.
  2. Using Node-RED I stream some of the data to AWS IoT Core to leverage some of its real-time analytics capabilities.
  3. Data coming from [2] is used to train a couple of ML models that I’ve built with Amazon SageMaker. The inference model is then pushed to AWS IoT Greengrass and I can run them locally, completely independent from the cloud.
  4. I also AWS IoT Greengrass to run a couple of AWS Lambda functions locally, so instead of heaving containers for small things, I have them running as a Lambda function.

also as i m new ti this whole thing could you point me in the right direction in terms of downlight choices and what else i need to get started with my automations. I’ll start by spinning up my i5 for running the HA instance.

Thanks heaps in advance

Hi Rafa, I would like to ask you your opinion regarding the following scenario: For a HA with no need of a VPN - just used with addons such as Ewelink How to Add Your SONOFF Devices On Home Assistant - SONOFF Official would a EC2 deployment make sense? I won’t see any other significant costs involved from other AWS services

Thank you

Is it possible to run HA on AWS now? I finally managed to fire up an EC2 instance (Debian 12, downgraded AppArmor to v2.13.x), but it is Unsupported and Unhealthy: network_manager and privileged issues.

I’m quite beginner in Linux, is it possible at all to make it Supported and Healthy on AWS?

Eg. network_manager is installed, but there are no physical interfaces.

I really appreciate your insight on cost, however, there has been a case where while I was away the local hardware gone down completely. Power outage, networking issues, etc. What about as a backup install. So you run the AWS EC2 as need?

I’m not aware of any HA (High Availability) solution for Home Assistant. I don’t even know if Home Assistant supports it. But I think it’s a moot point: if your network stack is offline, how will your home automation work? Home Assistant on EC2 won’t help you here.

Thanks for the response. For some reason my HP pc that runs Home assistant OS loses connection to network. The rest of the network infreastructure works fine.

I appreciate I am somewhat late to this discussion, however, as a Certified AWS DevOps Professional and general AWS proponent, I thought I might offer my perspective.

Do not use AWS for Home Assistant.

While much of the modern world functions perfectly well in “the cloud,” there remains a compelling case for running certain systems “on-premises” or “in-house.” For domestic purposes, this translates literally to “in-house.” I strongly believe that Home Assistant is one such system that justifies an on-premises setup.

Consider a scenario where you want to turn on a light. Can you guarantee that your internet connection, AWS services, and your EC2 instance within AWS are all operational? The answer is no. You simply want the light to work without delays or dependencies.

On a related note, I have personal experience with this issue. I used to use Tuya lights but switched to Shelly after Tuya blocked my Home Assistant access due to a lapse in renewing my developer API key. My spouse was not pleased when all the lights stopped working.

The only way to ensure reliability is by minimising these potential points of failure. This can be achieved by using locally accessible hardware that operates independently of an internet connection.

I understand there are concerns about availability, but these risks can be effectively mitigated:

Power Outages:

  • Use an Uninterruptible Power Supply (UPS)
  • Consider a house battery
  • Install solar panels

Random Loss of Network Connection:

  • Invest in a reliable server to run Home Assistant

Server Failure:

  • Utilise the backup integration to generate daily backups and store them on a separate device, such as a NAS
  • It is feasible to automatically build a new instance on a standby server if the primary server fails. This would require running a local proxy, DNS, and other necessary infrastructure
  • Prevent failures by using a robust server for Home Assistant. I acquired mine for ÂŁ80 on eBay. It is a 1U server, but it performs the task effectively.

Additional Benefits of Hosting Home Assistant Locally:

Privacy and Security:

  • Local hosting ensures that your data remains within your control and is not transmitted over the internet, reducing the risk of data breaches and unauthorised access.
  • Sensitive information, such as your home automation routines and personal preferences, stays private.

Latency and Performance:

  • Local hosting eliminates the latency associated with cloud services, resulting in faster response times for your home automation commands.
  • Performance is generally more consistent and reliable as it is not dependent on the internet connection or remote servers.

Cost Efficiency:

  • Over time, local hosting can be more cost-effective than paying for cloud services, especially if you have a stable and capable local server.
  • There are no recurring fees for cloud services or bandwidth usage.

Customization and Flexibility:

  • You have full control over the hardware and software environment, allowing for greater customisation and flexibility.
  • You can run additional services and integrations that might not be supported or allowed on cloud platforms.

Offline Functionality:

  • Home Assistant continues to function during internet outages, ensuring that your home automation system remains operational at all times.

Learning and Experimentation:

  • Hosting Home Assistant locally can be a valuable learning experience, offering hands-on knowledge about networking, server maintenance, and home automation technologies.
  • It provides an excellent platform for experimentation and trying out new integrations and customisations without restrictions.

Independence from Cloud Service Providers:

  • You are not reliant on the uptime and policies of cloud service providers, avoiding issues such as service changes, downtimes, or unexpected deprecations.
  • There is no risk of losing access to services or data if a provider goes out of business or changes their terms of service.

Integration with Other Local Services:

  • Home Assistant can integrate more seamlessly with other local services and devices, such as local storage, media servers, and IoT devices that operate on the local network.
  • Local integrations can offer more robust and reliable performance compared to cloud-based counterparts.

In conclusion, while cloud solutions have their place, Home Assistant benefits greatly from a local setup due to the need for reliability, control, and enhanced functionality. By addressing power, network, and hardware contingencies, and considering the additional benefits of privacy, performance, cost efficiency, customisation, offline functionality, learning opportunities, independence, and better local integration, you can maintain a robust and resilient home automation system tailored to your needs and preferences.

4 Likes