[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live) [Help](/c/help/9) # Connecting to Vercel KV store from localhost 177 views · 0 likes · 4 posts Brandon Codeswitchco (@brandon-codeswitchco) · 2024-08-21 I am having issues connecting to a Vercel KV store I've recently setup. I have done the following steps... 1. Created a Vercel kv store via Vercel's dashboard 2. Connected the KV store to an existing project hosting on Vercel 3. Used the Vercel CLI to pull environment variables into an .env.development.local file. I also have the four main environment variables for KV in an .env and a .env.local file (all the same values) 4. In my code, I am using the Vercel SDK as follows...  Whenever I reach the kv.set call, I receive the following error: "UpstashError: DB connection refused, command was: [["set","9", "{... } ]]" I have also tried using the "kv" export from @vercel/kv with the same effect. Any help understanding why I am unable to connect would be appreciated! Thank you! Amy Egan (@amyegan) · 2024-08-21 Hi @brandon-codeswitchco! It looks like you've imported `kv` from `@vercel/kv` but also assigned a `const kv` with `createClient`. That might be causing a conflict. The [Vercel KV Quickstart](https://vercel.com/docs/storage/vercel-kv/quickstart#vercel-kv-quickstart) includes some examples to help you get it set up. I have a couple of other ideas to try if changing the `import` or `const` name didn't solve it. If you're not using `vercel dev` to run the project, give that a try. You can also try logging some of the variables from your `.env.*` files. Do they exist with the expected values? Brandon Codeswitchco (@brandon-codeswitchco) · 2024-08-21 Hey @amyegan, thanks for the feedback. Running vercel dev did the trick, but what's weird is that I just stopped the localhost server and ran yarn dev again, and now it's working there as well. Not sure what happened, but at least it's working. Do you know of any issues with intermittent KV access from other users by chance? Amy Egan (@amyegan) · 2024-08-21 I'm glad it's working for you! I have not seen any intermittent KV connection errors lately, but I'll watch for them to make sure there isn't a larger issue.