There are dozens and hundreds of SEO factors, and one of those factors is hosting. So to answer the question posed in the title (does hosting affect SEO), YES hosting and SEO are linked. Let's take a look at how hosting affects SEO.
When you break ti down, there are two major ways in which hosting effects SEO; So I will cover each one individually now.
First, if, for example, your website is on the same IP address as a site which is spamming the high heaven out of the internet, meaning that they're creating lots of low quality links to their sites from all over or maybe this site Is even a link farm which is a low quality site which exists solely for the purpose of generating links, then search engines can target that IP address and punishment anyone else who exists on it. That may sound very unfair but it happens just because it's easier for the search engine and there have been a few documented cases of that exactly happening.
Secondly (the second way in which hosting and SEO are linked), another major way in which your hosting can hurt your ranking is if you're having problems with your hosting in terms of keeping your website online and accessible. Having a website which experiences a lot of downtime can have two fallouts:
One – Webmasters who link to you begin to get notifications that your site is down and their links are pointing to an unreachable website, causing them to remove their links and consequently any boosts in the SERPs which now disappears along with Those links.
Two – Search engines themselves will notice that your site is unreachable and will penal you / lower your ranking because they do not want to be directing their customers to inaccessible websites, which does make sense for them.
Therefore it behooves you to go with a hosting company who you can trust. I've used GoDaddy hosting for 6 years and have never had any downtime issues once, but it's up to you to choose a good, well known, reliable hosting provider for your site. Unfortunately good hosting will not reward you or improve your rankings, but it's important to consider your hosting because as I have outlined and detailed in this article, hosting can still have a very negative affect on how you rank in the SERPs.