Its possible, I have done it several times with DigitalOcean droplets and you will have your mini-Heroku at last. It's a kind of tricky to get it working but I will try to explain my steps to replicate it.
First of all you need to deploy your DO droplet with Dokku to get started. Remember to select the option "Use virtualhost naming for apps" during the installation!
In your DNS you will have to configure an A
record to access your server with a domain that will hold your different apps (subdomains).
Creating a "base" A
record for the Dokku instance can make it easier to access, but is not required (only affects instance, not app subdomains!).
# Enable app subdomain routing
A *.apps.example.com <public IP address>
# Optional subdomain for Dokku instance
A apps.example.com <public IP address>
Now you need to deploy your two apps on the server to get started with the configuration. Create the apps and deploy them (Use google if you need help to deploy it). Finally, you should see this in your server:
root@server-dokku-apps:~# dokku apps:list
=====> My Apps
acme-website
bubba-gump-website
Now you will need to configure the domain for each Dokku app.
root@server-dokku-apps:~# dokku domains:add acme-website www.acmewebsite.com
-----> Added www.acmewebsite.com to acme-website
-----> Configuring www.acmewebsite.com...(using built-in template)
-----> Configuring acme-website.apps.example.com...(using built-in template)
-----> Configuring www.acmewebsite.com...(using built-in template)
-----> Creating https nginx.conf
-----> Running nginx-pre-reload
Reloading nginx
root@server-dokku-apps:~# dokku domains:add bubba-gump-website www.bubbagump.com
-----> Added www.bubbagump.com to bubba-gump-website
-----> Configuring www.bubbagump.com...(using built-in template)
-----> Configuring bubba-gump-website.apps.example.com...(using built-in template)
-----> Configuring www.bubbagump.com...(using built-in template)
-----> Creating https nginx.conf
-----> Running nginx-pre-reload
Reloading nginx
Check that you can access the apps using the default Dokku domains (only http so far):
http://acme-website.apps.example.com
http://bubba-gump-website.apps.example.com
If everything is working as expected, configure each domain to point to the right app with some CNAME records.
# In your www.acmewebsite.com DNS records
CNAME www.acmewebsite.com www.acmewebsite.com.apps.example.com
# In your www.bubbagump.com DNS records
CNAME www.bubbagump.com www.bubbagump.com.apps.example.com
The final step is to configure letsencrypt
on each app. To let letssencrypt
provide a new certificate, your new domain (ex. www.acmewebsite.com) need to be accessible. This is why we first need to place the DNS CNAME
! Remember to install dokku-letsencrypt on your server.
# First for acme website
root@server-dokku-apps:~# dokku letsencrypt acme-website
# Finally for buba website
root@server-dokku-apps:~# dokku letsencrypt bubba-gump-website
After all this mess you should have two shiny apps running in their own domains with HTTPS enabled.
Hope this helps.