Question

Run second web service on different port on App Platform

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?


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 21, 2024

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

Sri Charan Madhavapeddi
DigitalOcean Employee
DigitalOcean Employee badge
October 22, 2024

Hello,

Refer to below link for more insights:

https://docs.digitalocean.com/products/app-platform/how-to/manage-internal-routing/

Cheers, Sri Charan

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.