As Rhys Steele mentions, this is not true unless you assume $X$ to be second countable (or, equivalently for metric spaces, separable). Rhys gives a counterexample showing the theorem can fail without this assumption, but more is true: it always fails without this assumption.
Proposition. Let $X$ be a locally compact Hausdorff space. If $C_0(X)$ is separable then $X$ is second countable.
Proof. Let $\{f_n\}$ be a countable dense subset of $C_0(X)$, and for each $n$ let $U_n = \{x \in X: f_n(x) > 1/2\}$, which is an open subset of $X$. I claim that $\{U_n\}$ is a countable base for the topology of $X$. For let $x \in X$ and let $V$ be an open neighborhood of $x$. Then by Urysohn's lemma for locally compact Hausdorff spaces, there exists a function $f$ compactly supported inside $V$ with $f(x) = 1$. In particular $f \in C_c(X) \subset C_0(X)$, so by density, we can find some $f_n$ with $\|f-f_n\|_\infty < 1/2$. Then we have $f_n(x) > 1/2$ so $x \in U_n$. Moreover, if $y \in U_n$ then $f_n(y) > 1/2$ and so $f(y) > 0$, which implies $y \in V$. Therefore $U_n \subset V$. This proves that $\{U_n\}$ is a base.
Now, supposing that $X$ is second countable, you can proceed in a similar way to the compact case, applying the locally compact version of Stone-Weierstrass. Using the second countability and local compactness, you should be able to construct a countable family $f_n$ of compactly supported functions which separates points and vanishes nowhere. Then consider the algebra $\mathcal{A}_0$ generated over $\mathbb{Q}$ by the $f_n$; i.e. all functions consisting of finite rational linear combinations of finite products of the $f_n$. Show that $\mathcal{A}_0$ is countable, and that the closure of $\mathcal{A}_0$ is a closed algebra over $\mathbb{R}$. Stone-Weierstrass then implies that the closure of $\mathcal{A}_0$ equals $C_0(X)$, so $C_0(X)$ is separable.
;^)– Matthew Leingang Sep 06 '19 at 14:52