This guide is for users using Ubuntu Linux and wants to setup Phoenix Framework. If you want to know more on our setup of Ubuntu, checkout Ubuntu Setup.
Make sure you're in path ~
.
Install Erlang & Elixir
-
Adds Erlang Solutions repo:
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
-
Update
sudo apt update
-
Install the Erlang/OTP platform and all of its applications:
sudo apt install esl-erlang
- Install Elixir
sudo apt install elixir
- Install Hex (Elixir's package manager)
mix local.hex
Install PostgreSQL
Postgresql is the default database used in Phoenix.
-
Check if you have Postgre installed
psql --version
-
If not, install Postgresql from Ubuntu package
sudo apt-get install postgresql postgresql-contrib
-
If you want to add more Postgre features like PostGIS, you can search them:
apt-cache search postgres
-
If you want a handy GUI, you can install it:
sudo apt install pgadmin3
-
Create
postgres
admin user
sudo -u postgres psql postgres
-
Setup default password
postgres
for default user
\password postgres
. Just enterpostgres
. -
Create an admin user based on the the current user
sudo -u postgres createuser --superuser $USER
Install Node
Part of the Ubuntu Setup includes the node setup using NVM.
Install Inotify
The livereloading of phoenix depends on this tool. To install this:
sudo apt install inotify-tools
Install Phoenix
Let's use Elixir utility Mix to install Phoenix:
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez
Run Phoenix
At this point, you should be able to create a phoenix app by running:
mix phoenix.new hello_world
References
https://help.ubuntu.com/community/PostgreSQL
https://www.postgresql.org/download/linux/ubuntu/
http://www.phoenixframework.org/docs/installation
http://elixir-lang.org/install.html#unix-and-unix-like