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) orbuild.gradle(Gradle)
How the build works
Miget’s buildpacks auto-detect Java from yourpom.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.
Configure the port
Point Spring Boot at the injectedPORT so it binds to 5000 in production. Add this to src/main/resources/application.properties:
PORT (5000) when deployed and falls back to 8080 for local development.
Commit the change before deploying:
Deploy with git push
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.
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.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.
Add the remote and push
Add Miget as a git remote, then push: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 aDATABASE_URL environment variable in this form:
DATABASE_URL) and reference them in application.properties:
DATABASE_URL into a JDBC URL:
SPRING_DATASOURCE_URL→jdbc:postgresql://host:port/dbnameSPRING_DATASOURCE_USERNAME→ theuserfromDATABASE_URLSPRING_DATASOURCE_PASSWORD→ thepasswordfromDATABASE_URL
jdbc:postgresql:// scheme with the host, port, and database name - it drops the credentials, which travel in the username/password properties.
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.

