# Environment Variables (/docs/guides/environment-variables)



Environment variables let you pass configuration, secrets, and credentials to your running services.

## Manual Variables [#manual-variables]

Set your own key/value pairs - API keys, feature flags, configuration values.

1. Open your service page
2. Go to **Deployments** → **Env Vars**
3. Add key/value pairs
4. Click **Save**

Saving triggers an automatic redeployment with the new configuration. Edit values inline or delete pairs and save to remove them.

## Linked Variables [#linked-variables]

Link environment variables from other services in your project - databases, S3 storage, or other application services. Linked variables are resolved securely at deploy time.

1. In the environment variables section, select a **source service** from the dropdown
2. Choose which **variable** to link (e.g., `HOST`, `PASSWORD`, `URL`)
3. Rock8Cloud injects the value automatically when your service deploys

Credentials like database passwords and S3 secret keys are stored as secrets and never exposed as plain text - they're injected directly into your running container at deploy time.

When you link a variable that depends on other variables (e.g., `URL` depends on `HOST`, `PORT`, `USER`, `PASSWORD`, `NAME`), the dependencies are automatically included.

## Preview Environments [#preview-environments]

Preview deployments use the **same environment variables** as your stable deployment. If you need isolation, create a separate project with its own database and credentials.

## Troubleshooting [#troubleshooting]

| Problem                     | Solution                                                                         |
| --------------------------- | -------------------------------------------------------------------------------- |
| Variable seems missing      | Check the key spelling and confirm the latest deployment succeeded               |
| Unexpected runtime behavior | Check deployment logs - the service may have failed to start with the new config |
| Changes not taking effect   | Verify the deployment completed after saving                                     |

## Related [#related]

* [Service Configuration](/docs/guides/service-configuration)
* [Preview Deployments](/docs/guides/preview-deployments)
