How can an app in App Platform get it's own public URL

When I deploy an app on app platform it gets a public url like Is there a programmatic way for the app itself to get this url?

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.

Moises Eskinazi
DigitalOcean Employee
DigitalOcean Employee badge
January 18, 2023

Hi Jdoleary,

You can configure an environment variable of your choosing for the App and assign it to the bindable variable.

For example, if you set your environment variable URL to the value ${APP_URL} inside your app, the variable URL will have the value for the public URL. If you later assign one or more custom domains to the app, the variable will contain the domain marked as primary.

You can also get the domain only without http by using ${APP_DOMAIN} instead.

See this docs on how to configure environment variables and what other bindable variables are available.

Best, Moises

Try DigitalOcean for free

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

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

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

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
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 ->
DigitalOcean Cloud Control Panel