Question

How to upload a secret credential file?

I created an App using the AppCreate. I want to know if there is a way to upload a secret credential file like on render. I have a secret firebase credential that I have not uploaded to Github, but is required to run the app. I want to know of possible solutions.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
October 23, 2023
Accepted Answer

Hey there,

What I’ve done in the past with similar use cases when using a self-managed Kubernetes cluster as well as the App Platform, was to convert my credentials file to a base64 string, and then set that string as an environment variable. When your app starts up, it would need to decode the base64 string and write it to a file, which you could then use as usual.

For example, to encode and decode using bash:

# To encode
base64 your_credential_file.json > encoded.txt

# To decode and write to a file in your app's startup script
echo $YOUR_ENV_VARIABLE | base64 -d > your_credential_file.json

The encoded content from encoded.txt can then be added as an environment variable through the DigitalOcean Control Panel. Make sure your application then decodes this at

If instead, you would like to see this as a feature in the App Platform. the best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.

https://ideas.digitalocean.com/

An alternative option would also be to instead of using a credentials file, you could extract the necessary credentials from the file and set them as environment variables in your App’s settings on the DigitalOcean App Platform. Then, in your application, you’d modify it to read these credentials from environment variables instead of a file.

https://docs.digitalocean.com/glossary/environment-variable/

Hope that helps!

- Bobby.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more