Skip to content

Exposing Publicly

Dokku Pro provides an http server and therefore cannot listen directly for https requests. Users wishing to expose it behind https can utilize functionality in Dokku 0.25.0 to treat Dokku Pro as if it was a natively hosted Dokku app.

The following example exposes a dokku-pro server running on port 5000 as a Dokku app called admin.

# create the app
dokku apps:create admin

# set the builder to the null builder, which does nothing
dokku builder:set admin selected null

# set the scheduler to the null scheduler, which does nothing
dokku scheduler:set admin selected null

# set the static-web-listener network property to the ip:port combination for your app.
dokku network:set admin static-web-listener 127.0.0.1:5000

# set the port map as desired for the port specified in your static-web-listener
dokku ports:set admin http:80:5000

# set the domains desired
dokku domains:set admin admin.dokku.me

# build the site config
dokku proxy:build-config admin

Enabling SSL

Note

This requires the letsencrypt plugin.

To enable SSL for Dokku Pro, first expose it as a Dokku App, and then run the following command:

# enable letsencrypt (if installed)
dokku letsencrypt:enable admin

WebSocket support

Dokku Pro streams live logs - the application, nginx access, and nginx error logs on an app's Logs tab, plus running-job output on the Activity tab - over a WebSocket connection. The browser opens it by upgrading a normal HTTP request, so any CDN or reverse proxy in front of Dokku Pro must allow the WebSocket Upgrade.

If the proxy does not forward the Upgrade and Connection headers - for example Cloudflare with WebSocket support disabled - the log stream cannot connect, and the Logs tab shows a connection-error banner instead of output. To fix it, enable WebSocket support on the proxy, or reach the server through a proxy that allows WebSocket connections, and then use the banner's Retry button.