---
title: "Clojure"
description: "Deploy Clojure applications on Miget using Leiningen."
---
Miget Buildpacks automatically detect and build your Clojure applications when you select **Auto detection (Miget Buildpacks)** as the build method. No configuration is required for most projects. For the full reference, visit the [migetpacks Clojure documentation](https://migetpacks.com/languages/clojure).
## Detection
Your application is detected as Clojure when one of these files is present in the root directory:
- `project.clj`
- `deps.edn`
## Version Detection
The Clojure version is determined from your build tool configuration:
- **Leiningen** - Version specified in `project.clj`
- **tools.deps** - Version specified in `deps.edn`
- **Java version** - `java.runtime.version` in a `system.properties` file at the root of your repository
```properties
java.runtime.version=21
```
## Build Process
During the build, the following steps are performed:
1. **Build environment** - The official Clojure build image is used for compilation.
2. **Build tool detection** - The build tool is auto-detected:
- `project.clj` → Leiningen
- `deps.edn` → tools.deps
3. **Uberjar creation** - Your application is compiled and packaged into an uberjar (a self-contained JAR with all dependencies included).
## Run Command
The application is started using `java -jar` with the generated uberjar.
You can override the run command by defining a `web` process in a `Procfile` at the root of your repository. You can also override the run command directly in the Miget dashboard when creating your app or changing the deployment source.
## Configuration
You can customize the build and runtime behavior through the Miget dashboard and repository configuration files:
- **Environment variables** - Set under **Settings -> Variables** in the Miget dashboard
- **JAVA_OPTS** - Pass JVM flags such as memory settings (e.g., `-Xmx512m`)
- **Procfile** - Define the start command at the root of your repository
- **Project Path** - For monorepo setups, specify the subdirectory containing your application code in the **Advanced** tab
- **Pre-Deploy Command** - Run a command before deployment (e.g., database migrations) in the **Advanced** tab
- **Post-Deploy Command** - Run a command after successful deployment (e.g., seeding data, cache warming) in the **Advanced** tab
## Docker Hardened Images
You can enable Docker Hardened Images (DHI) in the **Advanced** tab when creating your app or changing the deployment source. When enabled, your application is built using distroless runtime images with a minimal attack surface, no shell, and no package manager.
Clojure uses a hybrid approach: the official Clojure image is used for the build stage, and a DHI runtime image is used for the final container.
For the complete reference, see the [migetpacks Clojure documentation](https://migetpacks.com/languages/clojure).