Question

Missing a step in deploying different apps to different domains (using Dokku and domain plugin)?

Hi all. Lost newbie here. I’ve read quite a bit on Ports, Nginx, Dokku, and Docker and can’t quite seem to understand what I might be doing wrong.

I’m trying to deploy multiple apps to different domains on the same Digital Ocean VPS.
I truly believe I followed the dokku and dokku multiple domains-plugin instructions right.
I can get the apps to work fine if I go to myip:portnumber for each app. But when I try to get the domains linked to the app (using the multiple domains plugin), both domains point to the app that was deployed 2nd.

I think I’m just missing something on assigning to domains. Perhaps with a port or Nginx setting.

I deployed two sample Node apps and they seem to have launched fine.

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9947b492c768 dokku/noderest:latest /bin/bash -c '/start 4 seconds ago Up 4 seconds 0.0.0.0:49154->5000/tcp sharp_ptolemy
c466d368aa02 ac37d44feb0a /build/builder 30 seconds ago Exited (0) 6 seconds ago loving_mcclintock
eb0753770011 progrium/buildstep:latest /bin/bash -c 'mkdir 30 seconds ago Exited (0) 30 seconds ago silly_bohr
12e3d5ee5efc dokku/nodesamp:latest /bin/bash -c '/start 3 minutes ago Up 3 minutes 0.0.0.0:49153->5000/tcp jolly_torvalds

When I go to myip:49153 or myip:49154, the apps are working there fine.

So then I followed the instructions for doing the domains:

root@kyledokku:~# dokku domains:set nodesamp www.ahalearning.co
-----> Creating /home/dokku/nodesamp/DOMAINS
 * Reloading nginx configuration nginx                                                                                                                                                          [ OK ] 
root@kyledokku:~# ssh dokku@187.180.224.50 domains:set nodesamp www.ahalearning.co
 * Reloading nginx configuration nginx
   ...done.
root@kyledokku:~# dokku domains:set noderest www.kyleapennell.com
-----> Creating /home/dokku/noderest/DOMAINS
 * Reloading nginx configuration nginx                                                                                                                                                          [ OK ] 
root@kyledokku:~# ssh dokku@187.180.224.50 domains:set noderest www.kyleapennell.com
 * Reloading nginx configuration nginx
   ...done.

And both those seemed to work fine.

So when I go docker ps -a , here’s what I see:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9947b492c768 dokku/noderest:latest /bin/bash -c '/start 9 minutes ago Up 9 minutes 0.0.0.0:49154->5000/tcp sharp_ptolemy
c466d368aa02 ac37d44feb0a /build/builder 10 minutes ago Exited (0) 10 minutes ago loving_mcclintock
eb0753770011 progrium/buildstep:latest /bin/bash -c 'mkdir 10 minutes ago Exited (0) 10 minutes ago silly_bohr
12e3d5ee5efc dokku/nodesamp:latest /bin/bash -c '/start 13 minutes ago Up 13 minutes 0.0.0.0:49153->5000/tcp jolly_torvalds

When I go to either of those domains, they both go to the app that was deployed second. I’m seeing that >5000…does that mean they are both going to port 5000? Is that where I’m going wrong?

Any other ideas on where to look or what to try? Is there something more to configure?


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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

We’re getting the same issue, did you find a solution?

I used this dokku domains plugin: https://github.com/wmluke/dokku-domains-plugin/