Deploy jHipster Registry with Dokku

In this post, I’ll present to you, how to deploy JHipster Registry on Dokku. You can read more about installing Dokku on your system in my previous blog post.

If you are not familiar with JHipster I suggest, that you first check out the official JHipster web page.

So what is JHipster Registry? As is stated on the official web page, the JHipster Registry is a runtime application, provided by the JHipster team. It has three main purposes:

  • It is an Eureka Server, that serves as a discovery server for applications. This is how JHipster handles routing, load balancing and scalability for all applications.
  • It is Spring Cloud Config server, that provides runtime configuration to all applications.
  • It is an administration server, with dashboards to monitor and manage applications.

So JHipster Registry is needed when we want to use JHipster microservices and gateways.

The following is step by step tutorial on how to deploy JHipster Registry to Dokku.

First, we have to create a Dockerfile - very small and simple one. We just have to define the base image, set environment variable, expose port and we’re good to go.

Here is the sample Dockerfile:


FROM jhipster/jhipster-registry:v3.1.0
ENV SPRING_PROFILES_ACTIVE prod,native

EXPOSE 8761

Afterward, we have to create a new application on Dokku. Login to your Dokku instance and simply type following command: dokku apps:create jhipster-registry. When the process of creating a new application is finished we have to set two application environment variables.

With first one we set the desired admin password for JHipster Registry.

dokku config:set jhipster-registry SECURITY_USER_PASSWORD=<desired-password>

And with the second one, we define JWT secret variable.

dokku config:set jhipster-registry JHIPSTER_SECURITY_AUTHENTICATION_JWT_SECRET=<jwt-secret>

Lastly, all you have to do is to push Dockerfile to Dokku instance. When push is completed you should navigate to application URL on port 8761 and log in with username admin and password <desired-password>.

Optionally you can do port routing from 8671 to 8080 with the following command:

dokku proxy:ports-add jhipster-registry http:8080:8761

That’s it!

If you like this blog post or you having some trouble doing the same on your machine please comment down below. And of course feel free to share this post or follow me on Twitter.

Have a nice day!

Grega Vrbančič
Grega Vrbančič
Assistant Professor

Grega Vrbančič is an Assistant Professor at the University of Maribor, Faculty of Electrical Engineering and Computer Science.