How can I specify port for my dokku droplet?

September 14, 2014 3.4k views

Good day everyone! I have dokku in my droplet. After every deployment, port of my node.js-application changed to something like "45967" and other. Can I specify static port, which will not be changed after deployment? How I can do it?

1 Answer

You can not specify a port for Dokku to run on. The port is not persistent and can change on each deploy. In order to access a app running on Dokku at a stable URL, you'll need to use a subdomain. Check the box labeled "Use virtualhost naming for apps" when you first browse to the IP address:

To convert an existing Dokku installation to use the subdomain naming scheme, edit the file /home/dokku/VHOST on your droplet to contain "" Now you app will become available at:

by Jeff Lindsay
We’re going to show you how simple it is to get started with step-by-step instructions. By the end, you’ll have a Heroku-style application running on a DigitalOcean Droplet, deployed via Git, and a Dokku instance ready for more.
Have another answer? Share your knowledge.