Is there a way to avoid using .env.local?

I am planning to deploy using Coolify, an application management service like Vercel.
So, since the value of env can be set in the UI, is there a way to use the env of the system if .env.local does not exist?

Uploading .env.local to the repository feels like it’s possible, but it poses a security risk.

1 Like

If you look in "./app/lib/.server/llm/api-key.ts", it handles this automatically for Cloudflare with environment variables. You’d want to do the same here. I think if you just for example use "ANTHROPIC_API_KEY" (disregard the Cloudflare.* designation) it should work. It’s worth noting in my experience that Bolt.New does not read them encrypted, so you can’t add “Secrets” the normal way (in Cloudflare for example).

So, to use Cloudflare Pages with both update on commit and to set the keys “correctly” (would be better encrypted but only I can see the keys anyways), I actually had to publish twice. Once on Cloudflare, and then with the wrangler.toml method. It was a bit to figure out, especially without documentation on my particular use case (no one else uses keys for deployment?)

Has anyone else figured this out for Coolify? I’d have to try it out myself in order to give specific instructions. PM me and we should be able to figure it out.

And no, don’t upload your .env or .env.local files! Lol