Managing secrets in Coolify for your production website involves securely storing sensitive information, such as API keys, tokens, and environment variables, in a way that your application can access them during deployment or runtime. Here's a step-by-step guide to manage secrets in Coolify:
- Go to the Coolify dashboard.
- Navigate to the "Projects" tab.
- Select your production website project (in your case,
exosystems_nuxt
).
- Inside your project settings, click on the "Environment Variables" section from the left sidebar.
- This section allows you to add, update, and remove environment variables (including secrets) for your project.
- Click the "+" or "Add Variable" button to create a new environment variable.
- In the "Name" field, input the key name (e.g.,
API_KEY
,DATABASE_URL
). - In the "Value" field, input the actual secret value.
- Make sure to select the "Secret" option if you want Coolify to mask the value so it doesn't show up in logs or the UI.
- If your project has different environments (e.g., production, staging), ensure you're adding secrets to the correct environment.
- You can create environment-specific secrets, which allows you to have different configurations (like
API_KEY
for production andAPI_KEY
for development).
- After adding or modifying secrets, save the changes.
- You can then Redeploy your project to apply the new environment variables to the running application.
- After deploying, check your Logs to ensure that the application is picking up the correct environment variables.
- The logs will mask sensitive data but should still show if the environment variable is correctly configured.
-
If you're using secrets for your
Nuxt3
project, make sure that thenuxt.config.ts
is configured to use environment variables properly. For example:export default defineNuxtConfig({ runtimeConfig: { public: { apiKey: process.env.API_KEY, // Accessible to client-side }, privateApiSecret: process.env.PRIVATE_API_SECRET, // Accessible only on server-side } })
- If you need to update or remove a secret:
- Simply go back to the Environment Variables section and either edit or delete the variable.
- If the secret is tied to a repository or webhook, ensure you remove it from the Source or Webhooks section.
- In cases where you’re trying to manage GitHub or other integrations, secrets may also be stored or linked under Keys & Tokens or Source sections. Review those to see if your GitHub app or any SSH keys are linked to the production site.
By following this process, you can ensure that all sensitive data is securely managed within Coolify, reducing the risk of exposure in your production website setup.