Miget builds your Spring Boot app straight from source and runs the resulting JAR - no Dockerfile or CLI required. This guide walks you from a fresh app to a live deployment, then connects a PostgreSQL database.

Prerequisites

Before you start, make sure you have:
  • A Miget account
  • Git installed and your project under version control
  • A Spring Boot app with a pom.xml (Maven) or build.gradle (Gradle)

How the build works

Miget’s buildpacks auto-detect Java from your pom.xml or build.gradle, build your project, and run the produced JAR using the Main-Class declared in its manifest. You do not need to write a build script or container image.
Every app on Miget must listen on 0.0.0.0:5000. Miget sets an immutable PORT=5000, and public ingress only reaches port 5000. Spring Boot defaults to port 8080 and does not read PORT on its own, so you must configure it - see the port step below. See Ports for details.

Configure the port

Point Spring Boot at the injected PORT so it binds to 5000 in production. Add this to src/main/resources/application.properties:
server.port=${PORT:8080}
This reads Miget’s PORT (5000) when deployed and falls back to 8080 for local development.
Prefer environment variables? Set SERVER_PORT=5000 on the app instead - Spring Boot maps it to server.port automatically. Either approach works; pick one.
Commit the change before deploying:
git add src/main/resources/application.properties
git commit -m "Bind to Miget PORT"

Deploy with git push

1

Create the application

Go to app.miget.com, click New → Application, give it a name, pick the resource it should run in, then click Next.
2

Choose the buildpack

Select Auto detection (Miget Buildpacks), choose an instance size, then click Next. Miget will detect Java from your pom.xml or build.gradle.
3

Pick git push as the deploy method

Choose git push, click Create, and copy the deploy token shown. You’ll need it to authenticate the push.
4

Add the remote and push

Add Miget as a git remote, then push:
git remote add miget https://git.<region>.miget.io/<your-miget-name>/<app-name>
git push miget
Replace <region>, <your-miget-name>, and <app-name> with the values from the create screen. Miget builds your app and deploys the JAR. See Git push to builder for the full flow.
This guide uses git push, but it’s one of several ways to deploy. You can also connect a GitHub repository for auto-deploys and pull request previews, deploy from a public Git repository, or push a prebuilt container image. See all deployment methods.

Connect a database

Add a PostgreSQL addon to your app from the dashboard. Miget provisions it and auto-injects a DATABASE_URL environment variable in this form:
postgres://user:password@host:port/dbname
Spring Boot and the JDBC driver do not parse the postgres:// scheme directly. You must give Spring a proper JDBC URL plus separate credentials - do not point spring.datasource.url at the raw DATABASE_URL.
The cleanest approach is to set three environment variables on your app (from the values inside DATABASE_URL) and reference them in application.properties:
spring.datasource.url=${SPRING_DATASOURCE_URL}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD}
Then set these on the app, converting the injected DATABASE_URL into a JDBC URL:
  • SPRING_DATASOURCE_URLjdbc:postgresql://host:port/dbname
  • SPRING_DATASOURCE_USERNAME → the user from DATABASE_URL
  • SPRING_DATASOURCE_PASSWORD → the password from DATABASE_URL
Note the JDBC URL uses the jdbc:postgresql:// scheme with the host, port, and database name - it drops the credentials, which travel in the username/password properties.
Manage credentials as secrets so they’re never committed to your repo. See PostgreSQL for connection details and addon management.

Next steps

PostgreSQL databases

Provision, connect, and manage Postgres addons.

Custom domains

Point your own domain at your Spring Boot app.

Manage secrets

Inject credentials and config without committing them.

Fair Scheduler

Understand how Miget shares CPU across your apps.