# Compiling Elixir to a single file

**URL:** <https://forum.elixirforum.com/t/compiling-elixir-to-a-single-file/7427>\
**Category:** Discussions\
**Tags:** compiling, deployment\
**Created:** [August 1, 2017, 8:15pm UTC](https://forum.elixirforum.com/t/compiling-elixir-to-a-single-file/7427 "2017-08-01T20:15:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samdvr](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/samdvr/32/5910_2.png) [@samdvr](https://forum.elixirforum.com/u/samdvr)\
**Post date:** [August 1, 2017, 8:15pm UTC](https://forum.elixirforum.com/t/compiling-elixir-to-a-single-file/7427/1 "2017-08-01T20:15:32Z")

</div>

Is it possible to compile elixir applications such as a Phoenix application to a single file?

---

<div class="post-metadata">

**Author:** ![cpgo](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cpgo/32/25792_2.png) [@cpgo](https://forum.elixirforum.com/u/cpgo)\
**Post date:** [August 1, 2017, 8:23pm UTC](https://forum.elixirforum.com/t/compiling-elixir-to-a-single-file/7427/2 "2017-08-01T20:23:22Z")

</div>

Yes, you can use [distillery](https://github.com/bitwalker/distillery).

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [August 1, 2017, 8:32pm UTC](https://forum.elixirforum.com/t/compiling-elixir-to-a-single-file/7427/3 "2017-08-01T20:32:44Z")

</div>

Since your question is very vague, perhaps you might want to build an [escript](https://hexdocs.pm/mix/Mix.Tasks.Escript.Build.html#content) instead of using distillery…

If you want to build some kind of command line tool, which you start with arguments and wait for its output or do some user interaction, use an escript. If you want to have something that is running as a demon/service in the background and managed by your init-system (or windows services) then use distillery and OTP releases.

---

<div class="post-metadata">

**Author:** ![samdvr](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/samdvr/32/5910_2.png) [@samdvr](https://forum.elixirforum.com/u/samdvr)\
**Post date:** [August 1, 2017, 8:55pm UTC](https://forum.elixirforum.com/t/compiling-elixir-to-a-single-file/7427/4 "2017-08-01T20:55:25Z")

</div>

To give more context it is possible to create a single binary that encapsulates all the dependecies and the application logic in Java they are called (UberJars) this is also possible in Go.  
@cassiogodinho Thanks Ill look into distillery
