---
title: Where Should I Store API Keys Securely?
url: https://docs.vultr.com/support/platform/api/where-should-i-store-api-keys-securely
description: "Keep Vultr API keys out of source code: use environment variables, HashiCorp Vault, and per-environment keys."
publish_date: 2025-09-14T04:00:33.894869Z
last_updated: 2026-10-26T23:34:41.448916Z
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt


Hard-coding API keys directly into your source code can lead to accidental exposure through version control, logs, or shared development environments. To reduce the risk of unauthorized access and maintain best practices, store API keys securely using the following methods:

* Use environment variables to inject API keys at runtime without exposing them in source code.
* Store keys in encrypted configuration files or manage them using a dedicated secrets management tool like HashiCorp Vault.
* Generate separate API keys for each environment or integration to simplify access control and rotation.
* Regularly audit API key usage and rotate keys as part of your routine security practices.
* Restrict access using the [Access Control List](https://docs.vultr.com/platform/other/api/manage-api-access-control) to limit usage by trusted IP addresses.

These practices help protect your Vultr infrastructure from unauthorized access and reduce the risk of key compromise.