Need help with leiningen?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

7.1K Stars 1.6K Forks Other 4.9K Commits 180 Opened issues


Automate Clojure projects without setting your hair on fire.

Services available


Need anything else?

Contributors list



Leiningen logo

"Leiningen!" he shouted. "You're insane! They're not creatures you can fight—they're an elemental—an 'act of God!' Ten miles long, two miles wide—ants, nothing but ants! And every single one of them a fiend from hell..." - from Leiningen Versus the Ants by Carl Stephenson

Leiningen is for automating Clojure projects without setting your hair on fire.


If your preferred package manager offers a recent version of Leiningen, try that first as long as it has version 2.x.

Leiningen installs itself on the first run of the

shell script; there is no separate install script. Follow these instructions to install Leiningen manually:
  1. Make sure you have Java installed; OpenJDK version 8 is recommended at this time.
  2. Download the
    script from the
    of this project.
  3. Place it on your
    . (
    is a good choice if it is on your path.)
  4. Set it to be executable. (
    chmod +x ~/bin/lein
  5. Run it.

Windows users can use the above script in the Linux subsystem or try the batch file or Powershell version instead.

Basic Usage

The tutorial has a detailed walk-through of the steps involved in creating a new project, but here are the commonly-used tasks:

$ lein new [TEMPLATE] NAME # generate a new project skeleton

$ lein test [TESTS] # run the tests in the TESTS namespaces, or all tests

$ lein repl # launch an interactive REPL session

$ lein run -m my.namespace # run the -main function of a namespace

$ lein uberjar # package the project and dependencies as standalone jar

$ lein deploy clojars # publish the project to Clojars as a library


lein help
to see a complete list.
lein help $TASK
shows the usage for a specific task.

You can also chain tasks together in a single command by using the

task with comma-separated tasks:
$ lein do clean, test foo.test-core, jar

Most tasks need to be run from somewhere inside a project directory to work, but some (

, and
) may run from anywhere.



file in the project root should look like this:
(defproject myproject "0.5.0-SNAPSHOT"
  :description "A project for doing things."
  :license "Eclipse Public License 1.0"
  :url ""
  :dependencies [[org.clojure/clojure "1.8.0"]]
  :plugins [[lein-tar "3.2.0"]])


lein new
task generates a project skeleton with an appropriate starting point from which you can work. See the sample.project.clj file (also available via
lein help sample
) for a detailed listing of configuration options.


file can be customized further with the use of profiles.


Leiningen documentation is organized as a number of guides:




Leiningen supports plugins which may introduce new tasks. See the plugins wiki page for a full list. If a plugin is needed for successful test or build runs, (such as

) then it should be added to
in project.clj, but if it's for your own convenience (such as
) then it should be added to the
list in the
profile in
. See the profiles guide for details on how to add to your
profile. The plugin guide explains how to write plugins.


Source Copyright © 2009-2021 Phil Hagelberg, Alex Osborne, Dan Larkin, and contributors. Distributed under the Eclipse Public License, the same as Clojure uses. See the file COPYING.

Thanks to Stuart Halloway for Lancet and Tim Dysinger for convincing me that good builds are important.

Images Copyright © 2010 Phil Hagelberg. Distributed under the Creative Commons Attribution + ShareAlike License 4.0. Full-size version available.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.