{"__v":4,"_id":"56a75c2ffc62900d00024be0","category":{"__v":1,"_id":"56a75c2cfc62900d00024bc2","pages":["56a75c2ffc62900d00024bdf","56a75c2ffc62900d00024be0","56a75c2ffc62900d00024be1","56a75c2ffc62900d00024be2"],"project":"54348ec95b10711400c6c445","version":"56a75c2cfc62900d00024bc1","reference":false,"createdAt":"2014-10-08T01:09:29.386Z","from_sync":false,"order":0,"slug":"introduction","title":"Introduction"},"parentDoc":null,"project":"54348ec95b10711400c6c445","user":"5435b410495d5d0800f3a603","version":{"__v":1,"_id":"56a75c2cfc62900d00024bc1","project":"54348ec95b10711400c6c445","createdAt":"2016-01-26T11:44:44.064Z","releaseDate":"2016-01-26T11:44:44.064Z","categories":["56a75c2cfc62900d00024bc2","56a75c2cfc62900d00024bc3","56a75c2cfc62900d00024bc4","56a75c2cfc62900d00024bc5","56a75c2cfc62900d00024bc6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.1.4","version":"1.1.4"},"updates":["558fb91cf795be2d00c1168e","559268bacf9cdb2100b57013","55b0baeab3171b3700b153ad","560302937435de0d00fabe2f","56b48d347bccae0d00e9a0f8","56f6ef5a51881e0e005a8c25","56fdb05fe7f3080e008e3f13"],"createdAt":"2015-06-18T22:12:27.687Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"In the [Overview Guide](http://www.phoenixframework.org/docs/overview) we got a look at the Phoenix ecosystem and how the pieces interrelate. Now it's time to install any software we might need before we jump into the [Up and Running Guide](http://www.phoenixframework.org/docs/up-and-running).\n\nPlease take a look at this list and make sure to install anything necessary for your system. Having dependencies installed in advance can prevent frustrating problems later on.\n\n### Elixir\n\nPhoenix is written in Elixir, and our application code will also be written in Elixir. We won't get far in a Phoenix app without it! The Elixir site maintains a great [Installation Page](http://elixir-lang.org/install.html) to help.\n\nIf we have just installed Elixir for the first time, we will need to install the Hex package manager as well. Hex is necessary to get a Phoenix app running (by installing dependencies) and to install any extra dependencies we might need along the way.\n\nHere's the command to install Hex (If you have Hex already installed, it will upgrade Hex to the lastest version):\n\n```console\n$ mix local.hex\n```\n\n### Erlang\n\nElixir code compiles to Erlang byte code to run on the Erlang virtual machine. Without Erlang, Elixir code has no virtual machine to run on, so we need to install Erlang as well.\n\nWhen we install Elixir using instructions from the Elixir [Installation Page](http://elixir-lang.org/install.html),  we will usually get Erlang too. If Erlang was not installed along with Elixir, please see the [Erlang Instructions](http://elixir-lang.org/install.html#installing-erlang) section of the Elixir Installation Page for instructions.\n\nPeople using Debian-based systems may need to explicitly install Erlang to get all the needed packages.\n\n```console\n$ sudo apt-get install erlang\n```\n\n### Phoenix\n\nOnce we have Elixir and Erlang, we are ready to install the Phoenix Mix archive. A Mix archive is a Zip file which contains an application as well as its compiled BEAM files. It is tied to a specific version of the application. The archive is what we will use to generate a new, base Phoenix application which we can build from.\n\nHere's the command to install the Phoenix archive:\n\n```console\n$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez\n```\n> Note: if the Phoenix archive won't install properly with this command, we can download the file directly from our browser, save it to the filesystem, and then run: `mix archive.install /path/to/local/phoenix_new.ez`.\n\n### Plug, Cowboy, and Ecto\n\nThese are either Elixir or Erlang projects which are part of Phoenix applications by default. We won't need to do anything special to install them. If we let Mix install our dependencies as we create our new application, these will be taken care of for us. If we don't, Phoenix will tell us how to do so after the app creation is done.\n\n### node.js (>= 5.0.0)\n\nNode is an optional dependency. Phoenix will use [brunch.io](http://brunch.io/) to compile static assets (javascript, css, etc), by default. Brunch.io uses the node package manager (npm) to install its dependencies, and npm requires node.js.\n\nIf we don't have any static assets, or we want to use another build tool, we can pass the `--no-brunch` flag when creating a new application and node won't be required at all.\n\nWe can get node.js from the [download page](https://nodejs.org/en/download/). When selecting a package to download, it's important to note that Phoenix requires version 5.0.0 or greater.\n\nMac OS X users can also install node.js via [homebrew](http://brew.sh/).\n\nNote: io.js, which is an npm compatible platform originally based on Node.js, is not known to work with Phoenix.\n\nDebian/Ubuntu users might see an error that looks like this:\n```console\nsh: 1: node: not found\nnpm WARN This failure might be due to the use of legacy binary \"node\"\n```\nThis is due to Debian having conflicting binaries for node: [discussion on stackoverflow](http://stackoverflow.com/questions/21168141/can-not-install-packages-using-node-package-manager-in-ubuntu)\n\nThere are two options to fix this problem, either:\n- install nodejs-legacy:\n```console\n$ apt-get install nodejs-legacy\n```\nor\n- create a symlink\n```console\n$ ln -s /usr/bin/nodejs /usr/bin/node\n```\n\n### PostgreSQL\n\nPostgreSQL is a relational database server. Phoenix configures applications to use it by default, but we can switch to MySQL by passing the `--database mysql` flag when creating a new application.\n\nWhen we work with Ecto models in these guides, we will use PostgreSQL and the Postgrex adapter for it. In order to follow along with the examples, we should install PostgreSQL. The PostgreSQL wiki has [installation guides](https://wiki.postgresql.org/wiki/Detailed_installation_guides) for a number of different systems.\n\nPostgrex is a direct Phoenix dependency, and it will be automatically installed along with the rest of our dependencies as we start our app.\n\n### inotify-tools (for linux users)\n\nThis is a Linux-only filesystem watcher that Phoenix uses for live code reloading. (Mac OS X or Windows users can safely ignore it.)\n\nLinux users need to install this dependency. Please consult the [inotify-tools wiki](https://github.com/rvoicilas/inotify-tools/wiki) for distribution-specific installation instructions.\n\n### Skeleton Installation\n\nSometimes you want an installation without anything except the bare minimum phoenix setup. The follow command will give you that.\n\n`mix phoenix.new web --no-brunch --no-ecto`","excerpt":"","slug":"installation","type":"basic","title":"Installation"}
In the [Overview Guide](http://www.phoenixframework.org/docs/overview) we got a look at the Phoenix ecosystem and how the pieces interrelate. Now it's time to install any software we might need before we jump into the [Up and Running Guide](http://www.phoenixframework.org/docs/up-and-running). Please take a look at this list and make sure to install anything necessary for your system. Having dependencies installed in advance can prevent frustrating problems later on. ### Elixir Phoenix is written in Elixir, and our application code will also be written in Elixir. We won't get far in a Phoenix app without it! The Elixir site maintains a great [Installation Page](http://elixir-lang.org/install.html) to help. If we have just installed Elixir for the first time, we will need to install the Hex package manager as well. Hex is necessary to get a Phoenix app running (by installing dependencies) and to install any extra dependencies we might need along the way. Here's the command to install Hex (If you have Hex already installed, it will upgrade Hex to the lastest version): ```console $ mix local.hex ``` ### Erlang Elixir code compiles to Erlang byte code to run on the Erlang virtual machine. Without Erlang, Elixir code has no virtual machine to run on, so we need to install Erlang as well. When we install Elixir using instructions from the Elixir [Installation Page](http://elixir-lang.org/install.html), we will usually get Erlang too. If Erlang was not installed along with Elixir, please see the [Erlang Instructions](http://elixir-lang.org/install.html#installing-erlang) section of the Elixir Installation Page for instructions. People using Debian-based systems may need to explicitly install Erlang to get all the needed packages. ```console $ sudo apt-get install erlang ``` ### Phoenix Once we have Elixir and Erlang, we are ready to install the Phoenix Mix archive. A Mix archive is a Zip file which contains an application as well as its compiled BEAM files. It is tied to a specific version of the application. The archive is what we will use to generate a new, base Phoenix application which we can build from. Here's the command to install the Phoenix archive: ```console $ mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez ``` > Note: if the Phoenix archive won't install properly with this command, we can download the file directly from our browser, save it to the filesystem, and then run: `mix archive.install /path/to/local/phoenix_new.ez`. ### Plug, Cowboy, and Ecto These are either Elixir or Erlang projects which are part of Phoenix applications by default. We won't need to do anything special to install them. If we let Mix install our dependencies as we create our new application, these will be taken care of for us. If we don't, Phoenix will tell us how to do so after the app creation is done. ### node.js (>= 5.0.0) Node is an optional dependency. Phoenix will use [brunch.io](http://brunch.io/) to compile static assets (javascript, css, etc), by default. Brunch.io uses the node package manager (npm) to install its dependencies, and npm requires node.js. If we don't have any static assets, or we want to use another build tool, we can pass the `--no-brunch` flag when creating a new application and node won't be required at all. We can get node.js from the [download page](https://nodejs.org/en/download/). When selecting a package to download, it's important to note that Phoenix requires version 5.0.0 or greater. Mac OS X users can also install node.js via [homebrew](http://brew.sh/). Note: io.js, which is an npm compatible platform originally based on Node.js, is not known to work with Phoenix. Debian/Ubuntu users might see an error that looks like this: ```console sh: 1: node: not found npm WARN This failure might be due to the use of legacy binary "node" ``` This is due to Debian having conflicting binaries for node: [discussion on stackoverflow](http://stackoverflow.com/questions/21168141/can-not-install-packages-using-node-package-manager-in-ubuntu) There are two options to fix this problem, either: - install nodejs-legacy: ```console $ apt-get install nodejs-legacy ``` or - create a symlink ```console $ ln -s /usr/bin/nodejs /usr/bin/node ``` ### PostgreSQL PostgreSQL is a relational database server. Phoenix configures applications to use it by default, but we can switch to MySQL by passing the `--database mysql` flag when creating a new application. When we work with Ecto models in these guides, we will use PostgreSQL and the Postgrex adapter for it. In order to follow along with the examples, we should install PostgreSQL. The PostgreSQL wiki has [installation guides](https://wiki.postgresql.org/wiki/Detailed_installation_guides) for a number of different systems. Postgrex is a direct Phoenix dependency, and it will be automatically installed along with the rest of our dependencies as we start our app. ### inotify-tools (for linux users) This is a Linux-only filesystem watcher that Phoenix uses for live code reloading. (Mac OS X or Windows users can safely ignore it.) Linux users need to install this dependency. Please consult the [inotify-tools wiki](https://github.com/rvoicilas/inotify-tools/wiki) for distribution-specific installation instructions. ### Skeleton Installation Sometimes you want an installation without anything except the bare minimum phoenix setup. The follow command will give you that. `mix phoenix.new web --no-brunch --no-ecto`