Dokku Single App with Multiple Domains

Posted August 15, 2014 5.6k views

Am new to digital ocean but would like to know if i can

  1. Use Dokku to create a single Nodejs app with multiple processes (1:web 2: workers) 2. point multiple sub domains (sub.domain1.go, sub.domain2.go etc) to the same app.
  2. Can each of this different sub domain have their own ssl certificates installed in the droplet


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.

Submit an Answer
2 answers

If it’s all subdomains with the same root doamin, you can create a “wildcard” cert that covers any subdomain. Then in order to use SSL certs with Dokku, check out this from their docs:

To enable TLS across all apps, copy or symlink the .crt/.pem and .key files into the /home/dokku/tls folder (create this folder if it doesn’t exist) as server.crt and server.key respectively. Then, enable the certificates by editing /etc/nginx/conf.d/dokku.conf and uncommenting these two lines (remove the #)

Check out dokku-shoreman, it allows you to specify worker processes in your ProcFile, much like heroku does.


web: forever server.js
worker: workprocess1
worker: workerprocess2

In terms of several domains per app. I would recommend having one main domain (with a cert installed), and redirect the others to it (normally you can set this up in your dns control panel). That way you won’t be penalised by search engines for duplicate content, and it will likely lead to a less confusing experience for your users :).