Link Search Menu Expand Document

Deploying an App - How to deploy a Hello World Spring Boot app to Dokku

These instructions assume you have already followed the instructions on the Getting Started page, and have also:

Deploying an app (public repo)

Once you’ve set up any environment variables and/or databases that you need, here’s how you get your app deployed.

This requires only an ssh shell on the Dokku machine. You still need to login to csil, then dokku, but you do not have to do anything at the command line on csil.

  1. ssh then to your dokku machine (e.g. ssh substituting your dokku number in place of 01.

  2. To create your app, use the command:

    dokku apps:create jpa02-yourGithubId

    For example:

    dokku apps:create jpa02-cgaucho

    If your github id has uppercase letters or other symbols are are not legal in a dokku app name, just modify it slightly so that it conforms to the rules.

  3. To set the git branch that your dokku app will deploy on its next build, do this, using the https link for your repo. (Note that this only works for public repos; for private repos, there is a slightly different procedure documented below.)

    dokku git:sync your-app-name branch-to-deploy

    For example:

    dokku git:sync jpa02-cgaucho main


    dokku git:sync team03-qa KT-add-hotels

    This doesn’t deploy the app, but it does set things up so that the command below will deploy from the specified repo and this branch.

  4. Then, to deploy, use dokku ps:rebuild app-name

    For example:

    dokku ps:rebuild jpa02-cgaucho

    You should see then see the output from the deployment of the branch that looks something like this:

     Enumerating objects: 1578, done.
     Counting objects: 100% (1578/1578), done.
     Delta compression using up to 8 threads
     Compressing objects: 100% (465/465), done.
     Writing objects: 100% (1578/1578), 699.17 KiB | 139.83 MiB/s, done.
     Total 1578 (delta 995), reused 1578 (delta 995), pack-reused 0
     remote: Resolving deltas: 100% (995/995), done.
     -----> Set main to DOKKU_DEPLOY_BRANCH.
     -----> Cleaning up...
     -----> Building jpa02-cgaucho from Dockerfile
     remote: build context to Docker daemon  39.42kB
     Step 1/26 : FROM bellsoft/liberica-openjdk-alpine:17.0.2
     =====> Application deployed:
      * [new branch]      main -> main
     [pconrad@csilvm-07 jpa02-pconrad]$ 
  5. Now you should be able to open the app on the URL shown, e.g.