Report this

What is the reason for this report?

Run second web service on different port on App Platform

Posted on October 21, 2024

I have a Django web application deployed successfully on App Platform. I want to set up a second web service component that serves a different application on a different port (5000). Is this possible within the same app in App Platform?



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!

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.

Hey Timmy! 👋

It’s currently not possible to expose multiple external ports on a single Web Service component on the App Platform. If it works with your setup you could run two separate Web Service Components on DigitalOcean App Platform.

So basically, instead of exposing different ports, you can take advantage of HTTP Request Routes to set up different route prefixes for each service. For example:

  • Your main app can be accessible at /
  • Your second app (e.g., an API) can be routed under /api

This allows you to manage multiple services within the same app without worrying about port numbers. You can set up these routes in your app’s configuration to ensure each service handles traffic based on its assigned path.

Alternatively, if you need to keep one of the services internal (i.e., not publicly accessible), you can use Internal Service Routing to manage traffic between services internally without exposing the port publicly. You can read more about it here: Manage Internal Routing.

Let me know if that helps, or if you’d like more specific instructions!

- Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.